You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+7-1
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,15 @@
2
2
3
3
## master
4
4
5
+
**Breaking Changes:**
6
+
7
+
- Remove vendored ReScript LS and remove native Vim Commands (e.g. `:RescriptBuild`, etc)
8
+
- The ReScript Language Server will now be shipped as a dedicated npm package [rescript-language-server](https://github.com/rescript-lang/rescript-vscode/tree/master/server#rescript-language-server)
9
+
- Migrate to the official language server as described in our README instructions
10
+
5
11
**Improvements:**
6
12
7
-
- Improve syntax highlighting for escaped backticks in interpolated strings ([#55](https://github.com/rescript-lang/vim-rescript/pull/55))
13
+
- Improve syntax highlighting for escaped backticks in interpolated strings ([#55](https://github.com/rescript-lang/vim-rescript/pull/55))
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+1-72
Original file line number
Diff line number
Diff line change
@@ -3,9 +3,7 @@
3
3
## Development
4
4
5
5
- Clone the repo
6
-
-`npm install` dependencies
7
-
-`make test` to run the tests
8
-
-`make test-syntax`, require Neovim >= 0.9.0
6
+
-`make test-syntax` to run the syntax tests, require Neovim >= 0.9.0
9
7
10
8
**Working within VIM**
11
9
@@ -19,9 +17,6 @@ Plug ~/Projects/vim-rescript
19
17
- Run `:PlugInstall` (you'll not see the plugin in the interactive vim-plug list, because it is a local project)
20
18
- You can open and edit functionality in any plugin file. After any changes, just run `:so %` in the same buffer to source the current file, then proceed to do your manual tests
21
19
22
-
**Integration Specs:**
23
-
For all the informal specs about editor integration & the ReScript platform, check out the [CONTRIBUTING](https://github.com/rescript-lang/rescript-vscode/blob/master/CONTRIBUTING.md) file of the rescript-vscode reference implementation.
> Note: Don't do this as a ReScript user. This is only intended for extension development purposes only.
42
-
> We won't consider bug reports that are caused by custom editor-support setups.
43
-
44
-
We are currently using a forked version of RLS to be able to do type-hinting (without using an LSP client actually). To build the binary, do the following:
- Check in the changes and push to a working branch
101
-
- Do a last sanity check, update your `PlugInstall` to point to the newly created branch. Run `PlugUpdate` and check if the LSP / vim setup works as expected
102
-
- Run `:RescriptInfo` and check if the output reflects all the changes
103
-
- To wrap up, merge the branch, update CHANGELOG, push a new tag
- Proper tooling detection for monorepo like setups (yarn workspaces)
19
-
20
-
**Provided by vim-rescript commands:**
21
-
- Formatting `.res` files w/ syntax error diagnostics in VIM quickfix
22
-
- Convert existing `.re` /`.rei` files to `.res` /`.resi`
23
-
- Type hint for current cursor position
24
-
- Jump to definition for current cursor position
25
-
- Building the current projec w/ build diagnostics in VIM quickfix
26
-
- Autocompletion w/ Vim's omnicomplete
27
-
28
-
**Monorepo support:**
29
-
30
-
The vim-rescript plugin automatically updates its project environment on each file open separately.
31
-
- Tested for yarn workspaces (see [./examples/monorepo-yarn-workspaces])
32
-
-**Note for non-LSP usage:** Always make sure to switch to a `.res` file **within the project you want to compile** before running `:RescriptBuild` etc.
33
12
34
13
See `:h rescript` for the detailed [helpfile](./doc/rescript.txt).
35
14
36
-
## Requirements
37
-
38
-
The plugin works with projects based on `[email protected]` or later
39
-
40
15
## Installation
41
16
42
17
`vim-rescript` can be installed either manually or by using your favourite plugin manager.
- The config above assumes that you were using `vim-plug` for plugin installations.
84
-
- Adapt your `module` path according to the install location of your vim-rescript plugin.
85
-
- Save the configuration, run `:CocRestart` and open a (built) ReScript project and check your code for type-hints.
86
-
87
-
**Note:** Even if you are using COC, we recommend checking out the builtin commands that come with `vim-rescript` (`:h rescript-commands).
88
-
89
-
## Using vim-rescript's functionality (no vim-coc, no vim-ale, etc)
49
+
## Setup LSP
90
50
91
-
(`:h rescript-config`)
51
+
First you need install the language server for ReScript from npm
92
52
93
-
Vim comes with a set of useful functions that are completely self contained and work with any neovim setup without any plugins:
53
+
> **Note**
54
+
> If you are using [mason.nvim](https://github.com/williamboman/mason.nvim) you can install the ReScript Language Server using the command `MasonInstall rescript-language-server`
94
55
56
+
```sh
57
+
npm install -g @rescript/language-server
95
58
```
96
-
:h :RescriptFormat
97
-
:h :RescriptUpgradeFromReason
98
-
:h :RescriptBuild
99
-
:h :RescriptTypeHint
100
-
:h :RescriptJumpToDefinition
101
-
:h :RescriptInfo
102
-
```
103
-
Please refer to the [doc](./doc/rescript.txt) file for more details!
104
59
105
-
We don't come with any predefined keybindings, but provide a basic set of keymappings down below.
60
+
The binary is called `rescript-language-server`
106
61
107
-
### Basic Key Bindings
62
+
### Neovim LSP builtin
108
63
109
-
These bindings won't collide with any other mappings in your vimrc setup, since they are scoped to `rescript` buffers only:
64
+
Install the [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig) package and setup the LSP
110
65
111
-
```vim
112
-
" Note that <buffer> allows us to use different commands with the same keybindings depending
113
-
" on the filetype. This is useful if to override your e.g. ALE bindings while working on
0 commit comments