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

Reason

by reasonml-editor ST2/ST3

Official Reason plugin for Sublime Text

Details

Installs

  • Total 790
  • Win 127
  • OS X 471
  • Linux 192
Dec 7 Dec 6 Dec 5 Dec 4 Dec 3 Dec 2 Dec 1 Nov 30 Nov 29 Nov 28 Nov 27 Nov 26 Nov 25 Nov 24 Nov 23 Nov 22 Nov 21 Nov 20 Nov 19 Nov 18 Nov 17 Nov 16 Nov 15 Nov 14 Nov 13 Nov 12 Nov 11 Nov 10 Nov 9 Nov 8 Nov 7 Nov 6 Nov 5 Nov 4 Nov 3 Nov 2 Nov 1 Oct 31 Oct 30 Oct 29 Oct 28 Oct 27 Oct 26 Oct 25 Oct 24 Oct 23
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 2 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 2 0 0 1 0 0 0 0 0 0 0 1 0 0
OS X 0 0 0 2 2 1 0 0 1 0 0 1 0 3 0 0 2 0 1 0 2 0 1 1 1 0 0 1 1 1 0 1 1 2 0 0 1 2 0 1 0 0 0 1 0 2
Linux 0 0 1 0 1 0 0 1 1 1 0 0 1 0 0 0 0 1 0 0 0 1 0 0 2 2 0 1 2 0 1 0 0 0 0 2 1 2 0 0 0 0 1 0 0 1

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.