GithubHelp home page GithubHelp logo

bsansouci / reason-language-server Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jaredly/reason-language-server

0.0 2.0 0.0 400.34 MB

A language server for reason, in reason

Shell 0.05% OCaml 99.66% C 0.01% Standard ML 0.16% JavaScript 0.11% C++ 0.01%

reason-language-server's Introduction

Reason Language Server

This project implements the Language Server Protocol for reason.

It is written in Reason, and compiled via bsb-native. The goal is for it to work equally well on Windows, MacOS, and Linux.

Usage

VSCode

Install through VS Code extensions. Search for reason-vscode

Visual Studio Code Marketplace: reason-vscode

Can also be installed with VS Code Quick Open: press Cmd/Ctrl + P, paste the following command, and press enter.

ext install jaredly.reason-vscode

OniVim

Oni has support for reason baked in, and it only needs a little bit of configuration to integrate this langauge server.

  1. Download the your-platform.zip file from the latest release, and unzip it. put the reason-language-server.exe file somewhere.
  2. Open the oni config file (cmd+,), and add the following to the export const configuration = { block at the end:
    "language.reason.languageServer.command": "/abs/path/to/your/reason-language-server.exe",
    "language.reason.languageServer.arguments": [],
    "language.reason.languageServer.configuration": {},

And you're done!

Sublime Text

  1. Install the sublime reason plugin for syntax highlighting, etc. (has to be done manually)
  2. Install the LSP Plugin via the sublime package manager
  3. Download the your-platform.zip file from the latest release, and unzip it. put the reason-language-server.exe file somewhere.
  4. cmd+shift+p and type "Preferences: LSP Settings" to bring up the settings file, and put in:
{
  "auto_show_diagnostics_panel": false,
  "clients": {
    "reason": {
      "enabled": true,
      "command": ["/absolute/path/to/reason-language-server.exe"],
      "scopes": ["source.reason"],
      "syntaxes": ["Packages/sublime-reason/Reason.tmLanguage"],
      "languageId": "reason"
    }
  }
}

Vim

Install the reason-vim plugin, following the readme. The only change is the LSP configuration should be:

let g:LanguageClient_serverCommands = {
    \ 'reason': ['/absolute/path/to/reason-language-server.exe']
    \ }

Emacs

TODO people have gotten it to work with emacs, but I don't know the steps.

That project uses merlin under the hood, which is a very powerful and well-developed tool for IDE features in OCaml/Reason. I had a couple of reasons for starting a new one. The biggest is that I wanted something with minimal dependencies, so that windows support would be relatively easy, and so that I might be able to ship it with bucklescript at some future point. (it also makes targetting JS easier). I also wanted a server that was written entirely in Reason (not part typescript, part reason), and something that was written from the ground up with the Langauge Server Protocol in mind, instead of taking a different IDE-support-tool and mapping the LSP onto it.

Contributing

  • install esy if you don't have it (npm install -g esy@next)
  • clone this repo
  • cd to the cloned dir
  • run esy from the main project dir
  • install the vscode extension's dependencies cd editor-extensions/vscode && npm i && cd ../..
  • open this project in vscode

To test your changes in one of the example projects

  • open the "Debug" pane in vscode. Select a debug target. Press "Run"
  • it should start up a window titled [Extension development host]
  • you'll have to npm install && npm run build in that project directory if you haven't already.
  • to reload the server if something goes wrong, cmd+shift+p "restart reason language server"

You can then develop on the language server! When you change something, the server will automatically reload.

reason-language-server's People

Contributors

jaredly avatar bsansouci avatar thangngoc89 avatar zploskey avatar bryphe avatar chenglou avatar gaelollivier avatar jchavarri avatar samskivert avatar albertoforni avatar cristianoc avatar dmisdm avatar bluehotdog avatar gsomix avatar bloodyowl avatar olegafx avatar pjhenning avatar aeruhxi avatar stephenlacy avatar

Watchers

James Cloos avatar  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.