ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Reason

Official Reason plugin for Sublime Text

Details

Installs

  • Total 1K
  • Win 238
  • Mac 741
  • Linux 388
Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8 Apr 7 Apr 6 Apr 5 Apr 4 Apr 3 Apr 2 Apr 1 Mar 31 Mar 30 Mar 29 Mar 28 Mar 27 Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11 Mar 10 Mar 9 Mar 8 Mar 7
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0
Mac 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 1 0 0 1 0 0 1 0 1 0 0 1 0 1 0 0 0 0 0 1 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

Sublime Text package for Reason

To have the complete Sublime Text Reason experience, there are two plugins to install: this one, and language-server.

This one provides syntax highlight, snippets for Reason and allows related features to recognize the Reason syntax.

Language-server provides all the others (autocompletion, type hint, jump-to-definition, etc.).

This Plugin's Installation

The plugin's published on Package Control.

  • Go to Command Palette (cmd-shift-p) -> Package Control: Install Package.
  • Choose “Reason”.

Language Server Installation

See https://github.com/jaredly/reason-language-server#sublime-text for language-server installation and configuration.

If you're doing native development, instead of reason-language-server, you can try ocaml-language-server.

Bonus Language Server Configuration

In addition to the installation & configuration above, you might want to set some extra keyboard shortcuts.

  • 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"]
        }
      ]
    },
    {
      "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.

Here are all the commands you can assign shortcuts to.

Develop This Package

Thanks for the help!

To test this package locally, do Preferences: Browse Packages and symlink this repo into Packages/User. Disable the existing Reason package, if any.

Install PackageDev, change whichever JSON file in the repo, then call PackageDev: Convert ... from the command palette and convert the file into the corresponding XML files.