GitHub - rescript-lang/vim-rescript (original) (raw)

vim-rescript

Vim runtime files for ReScript.

If you are experiencing any troubles, open an issue or visit our Forum and ask for guidance.

Features

See :h rescript for the detailed helpfile.

Installation

vim-rescript can be installed either manually or by using your favourite plugin manager.

" vim-plug Plug 'rescript-lang/vim-rescript'

" Vundle Plugin 'rescript-lang/vim-rescript'

" NeoBundle NeoBundle 'rescript-lang/vim-rescript'

-- Lazy.nvim { 'rescript-lang/vim-rescript', ft="rescript" }

You can also pin your installation to specific tags (check our releases here):

With Plug:

Plug 'rescript-lang/vim-rescript', {'tag': 'v2.1.0'}

With Lazy.nvim:

{ 'rescript-lang/vim-rescript', tag = "v2.1.0" }

Setup LSP

First you need install the language server for ReScript from npm

NoteIf you are using mason.nvim you can install the ReScript Language Server using the command MasonInstall rescript-language-server

npm install -g @rescript/language-server

The binary is called rescript-language-server

Neovim LSP builtin

Install the nvim-lspconfig package and setup the LSP

local lspconfig = require('lspconfig')

lspconfig.rescriptls.setup{}

For more details, see server configuration

COC (Vim or Neovim)

(:h rescript-coc)

After the installation, open your coc config (:CocConfig) and add the following configuration:

"languageserver": { "rescript": { "enable": true, "module": "rescript-language-server", "args": ["--node-ipc"], "filetypes": ["rescript"], "rootPatterns": ["rescript.json", "bsconfig.json"] } }

Credits