merlin-language-server
merlin
, written in reason
Simple LSP protocol wrapper for Overview
merlin-language-server
is a thin wrapper over the excellent merlin
tooling - implementing the LSP protocol on-top of merlin
's protocol.
As with ocaml-language-server
, this is not intended as a replacement for any existing Reason / OCaml tooling, but to make it more accessible across editors.
Why?
There are already two excellent language server implementations - reason-language-server
and ocaml-language-server
- why another one?
The current language-server landspace could be summarized with this table:
Language Server | Uses merlin |
Implemented in reason |
Supports Windows |
---|---|---|---|
ocaml-language-server |
|||
reason-language-server |
|||
merlin-language-server |
NOTE (1): I believe
ocaml-language-server
may support Windows, but I was not able to get it working.
NOTE (2):
reason-language-server
mentions Windows support as a goal, but again, it did not work for me. I contributed several fixes towards this (PRs #36, #130, #199), but there is still significant investment required to get support on parity withmerlin
on Windows.
The primary issue for me being that there was not a language server implementation that worked well for me on Windows. It turns out that merlin
works great on Windows - so having a native-reason LSP implementation that uses merlin
is a natural choice.
In the future, perhaps we could integrate this more fully into merlin
at some point, or incorporate merlin
as a library that we call directly.
Building
Prerequisites
- You will need
esy
to build -npm install -g esy
- For running tests, you will need
node
.
Build
git clone https://github.com/bryphe/merlin-language-server
esy install
esy build
Tests
- Unit tests:
esy x TestRunner.exe
- E2E tests:
cd test-e2e
npm install
npm test
Roadmap
- Distribution
- First-class Oni integration
- VSCode Plugin
- NPM package with pre-built binaries
- Features
- Text synchronization
-
textDocument/didOpen
-
textDocument/didChange
- Full document sync
- Incremental document sync
-
- Language Features
-
completion
-
hover
-
definition
-
implementation
-
references
-
signatureHelp
-
codeAction
? -
codeLens
-
formatting
-
rangeFormatting
-
onTypeFormatting
-
- Text synchronization
Contributions
Contributions & PRs are welcome! Please ensure that test coverage is added for any new functionality - either in the form of unit tests or E2E tests.
License
Copyright 2018 Bryan Phelps