Sublime Text package for Reason

Features

This plugin simply uses our language server. Every feature is supported. Additionally, we provide the basics: snippets and syntax highlighting.

Installation (Sublime Text 3)

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:

You might have to restart sublime after installing everything.

Configuration

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 means command on macOS) so you can do e.g. cmd-shift-c to format your Reason files.