Sublime Text package for Reason
This plugin provides syntax highlight and snippets for Reason.
All other Reason editor functionalities are independently provided by our language server.
Both installations instructions are below.
- Go to Sublime Text -> Preferences -> Browse Packages
- In the terminal,
cd
into that folder (if you're on macOS, you can click & drag the folder icon into your terminal window) git clone https://github.com/reasonml-editor/sublime-reason
The other 90% of Reason's editor experience (intelligent autocompletion, type hint, formatting, jump-to-definition, etc.) is provided by ocaml-language-server (a code analysis backend shared by all editors).
- Install the global binaries.
- Install ocaml-language-server itself through
npm install -g ocaml-language-server
. - Install LSP, the sublime text plugin that communicates with ocaml-language-server.
Restart sublime after installing these.
Nothing. Sublime's LSP above has built-in OCaml/Reason support. But you might want to set up some keyboard shorcuts for common actions. See them here. They're exposed as these functions.
Our recommendations:
-
Go to Command Palette (
cmd-shift-p
) -> Preferences: Key Bindings -
Add the following to your configuration:
[ // ...whatevever config you had before { "keys": ["super+alt+enter"], "command": "lsp_symbol_definition", "context": [ { "key": "selector", "operator": "equal", "operand": ["source.reason", "source.ocaml"] } ] }, { "keys": ["super+shift+c"], "command": "lsp_format_document", "context": [ { "key": "selector", "operator": "equal", "operand": ["source.reason"] } ] } ]
(
super
meanscommand
on macOS) so you can do e.g.cmd-shift-c
to format your Reason files.