|
1 | | -# VSCode OCaml Platform |
2 | | - |
3 | | -[](https://github.com/ocamllabs/vscode-ocaml-platform/actions?query=workflow%3A%22Main+workflow%22+branch%3Amaster) |
4 | | - |
5 | 1 | # This extension is a fork from [vscode-ocaml-platform](https://github.com/ocamllabs/vscode-ocaml-platform) for github1s. |
6 | 2 |
|
7 | | -Visual Studio Code extension for OCaml and relevant tools. |
8 | | - |
9 | | -_Please report any bugs you encounter._ |
10 | | - |
11 | | -## Quick start |
12 | | - |
13 | | -1. Install this extension from |
14 | | - [the VSCode Marketplace](https://marketplace.visualstudio.com/items?itemName=ocamllabs.ocaml-platform) |
15 | | - (or by entering `ext install ocamllabs.ocaml-platform` at the command palette |
16 | | - <kbd>Ctrl</kbd>+<kbd>P</kbd> (<kbd>Cmd</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> on |
17 | | - MacOS) |
18 | | -2. Open a OCaml/ReasonML project (`File > Add Folder to Workspace...`) |
19 | | -3. Install [OCaml-LSP](https://github.com/ocaml/ocaml-lsp) with |
20 | | - [opam](https://github.com/ocaml/opam) or [esy](https://github.com/esy/esy). |
21 | | - E.g. `opam install ocaml-lsp-server` |
22 | | - |
23 | | -### Windows |
24 | | - |
25 | | -Install [OCaml for Windows](https://fdopen.github.io/opam-repository-mingw/) and |
26 | | -make sure the `ocaml-env` program is accessible on the PATH (`ocaml-env` is in |
27 | | -the `usr/local/bin` folder relative to the installation directory). |
28 | | - |
29 | | -### ReScript / BuckleScript |
30 | | - |
31 | | -The new ReScript syntax (`res` and `resi` files) is not supported, you should |
32 | | -use [rescript-vscode](https://github.com/rescript-lang/rescript-vscode) instead. |
33 | | - |
34 | | -ReasonML, as an alternative syntax for OCaml, is supported out-of-the-box, as |
35 | | -long as `reason` is installed in your environment. |
36 | | - |
37 | | -If you're looking for a way to use OCaml or ReasonML syntax in a ReScript |
38 | | -project, you'll need to install `ocaml-lsp` in your environment. We recommend |
39 | | -using Esy for this: |
| 3 | +# At present only languages features is reserved |
40 | 4 |
|
41 | | -1. Install esy |
| 5 | +# I have deleted some files and only reserved the necessary code |
42 | 6 |
|
43 | | -```bash |
44 | | -npm install esy --global |
45 | | -``` |
46 | | - |
47 | | -2. Add `esy.json` to the project root with following content: |
| 7 | +# VSCode OCaml Platform |
48 | 8 |
|
49 | | -```json |
50 | | -{ |
51 | | - "dependencies": { |
52 | | - "@opam/ocaml-lsp-server": "*", |
53 | | - "@opam/ocamlfind-secondary": "*", |
54 | | - "@opam/reason": "*", |
55 | | - "ocaml": "4.6.x" |
56 | | - } |
57 | | -} |
58 | | -``` |
| 9 | +[](https://github.com/ocamllabs/vscode-ocaml-platform/actions?query=workflow%3A%22Main+workflow%22+branch%3Amaster) |
59 | 10 |
|
60 | | -3. Install and build packages |
| 11 | +Visual Studio Code extension for OCaml and relevant tools. |
61 | 12 |
|
62 | | -```bash |
63 | | -esy |
64 | | -``` |
| 13 | +_Please report any bugs you encounter._ |
65 | 14 |
|
66 | 15 | ## Features |
67 | 16 |
|
|
87 | 36 | - OCamllex |
88 | 37 | - Task Provider |
89 | 38 | - Dune |
90 | | - |
91 | | -## Configuration |
92 | | - |
93 | | -This extension provides options in VSCode's configuration settings. You can find |
94 | | -the settings under `File > Preferences > Settings`. |
95 | | - |
96 | | -| Name | Description | Default | |
97 | | -| ---------------------------------- | ------------------------------------------------------------------------------------------------------- | ------- | |
98 | | -| `ocaml.sandbox` | Determines where to find the sandbox for a given project | `null` | |
99 | | -| `ocaml.dune.autoDetect` | Controls whether dune tasks should be automatically detected. | `true` | |
100 | | -| `ocaml.trace.server` | Controls the logging output of the language server. Valid settings are `off`, `messages`, or `verbose`. | `off` | |
101 | | -| `ocaml.useOcamlEnv` | Controls whether to use ocaml-env for opam commands from OCaml for Windows. | `true` | |
102 | | -| `ocaml.terminal.shell.linux` | The path of the shell that the sandbox terminal uses on Linux | `null` | |
103 | | -| `ocaml.terminal.shell.osx` | The path of the shell that the sandbox terminal uses on macOS | `null` | |
104 | | -| `ocaml.terminal.shell.windows` | The path of the shell that the sandbox terminal uses on Windows | `null` | |
105 | | -| `ocaml.terminal.shellArgs.linux` | The command line arguments that the sandbox terminal uses on Linux | `null` | |
106 | | -| `ocaml.terminal.shellArgs.osx` | The command line arguments that the sandbox terminal uses on macOS | `null` | |
107 | | -| `ocaml.terminal.shellArgs.windows` | The command line arguments that the sandbox terminal uses on Window | `null` | |
108 | | - |
109 | | -If `ocaml.terminal.shell.*` or `ocaml.terminal.shellArgs.*` is `null`, the |
110 | | -configured VSCode shell and shell arguments will be used instead. |
111 | | - |
112 | | -## Commands |
113 | | - |
114 | | -You can execute it by entering the following command at the command palette |
115 | | -<kbd>Ctrl</kbd>+<kbd>P</kbd> (<kbd>Cmd</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> on |
116 | | -MacOS). |
117 | | - |
118 | | -| Name | Description | Keyboard Shortcuts | Menu Contents | |
119 | | -| ---------------------------- | ------------------------------------------- | ------------------ | ------------- | |
120 | | -| `ocaml.select-sandbox` | Select sandbox for this workspace | | | |
121 | | -| `ocaml.server.restart` | Restart language server | | | |
122 | | -| `ocaml.open-terminal` | Open a terminal (current sandbox) | | | |
123 | | -| `ocaml.open-terminal-select` | Open a terminal (select a sandbox) | | | |
124 | | -| `ocaml.current-dune-file` | Open Dune File (located in the same folder) | | | |
125 | | - |
126 | | -## Requirements |
127 | | - |
128 | | -- [ocaml/ocaml-lsp](https://github.com/ocaml/ocaml-lsp) |
0 commit comments