Sublime Text package for Reason
This plugin simply uses our language server. Every feature is supported. Additionally, we provide the basics: snippets and syntax highlighting.
To install this plugin:
- Go to Command Palette (cmd-shift-p)
- Search
Package Control: Add Repository
- Add
https://github.com/reasonml-editor/sublime-reason.git
- Then do the normal
Package Control: Install Package
and install sublime-reason.
Other prerequisites:
- Install the global binaries
- Install LSP
- Install ocaml-language-server through
npm install -g ocaml-language-server
You might have to restart sublime after installing everything.
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.