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.
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 |
✅ | ❌ | ❌ (1) |
reason-language-server |
❌ | ✅ | ❌ (2) |
merlin-language-server |
✅ | ✅ | ✅ |
NOTE (1): I believe
ocaml-language-servermay support Windows, but I was not able to get it working.
NOTE (2):
reason-language-servermentions 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 withmerlinon 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.
- You will need
esyto build -npm install -g esy - For running tests, you will need
node.
git clone https://github.com/bryphe/merlin-language-serveresy installesy build
- Unit tests:
esy x TestRunner.exe - E2E tests:
cd test-e2enpm installnpm test
- 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 & PRs are welcome! Please ensure that test coverage is added for any new functionality - either in the form of unit tests or E2E tests.
Copyright 2018 Bryan Phelps