Giter VIP home page Giter VIP logo

sublime-reason's Introduction

Sublime Text package for Reason

Features

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.

This Plugin's Installation

  • 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

Language Server Installation

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.

Language Server 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.

sublime-reason's People

Contributors

chenglou avatar jsdf avatar gilbert avatar pchaigno avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.