merlin-language-server
merlin-language-server copied to clipboard
Minimal cross-platform LSP wrapper for merlin
merlin-language-server
Simple LSP protocol wrapper for merlin, written in reason
:warning: Alpha quality
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 |
:white_check_mark: | :x: | :x: (1) |
reason-language-server |
:x: | :white_check_mark: | :x: (2) |
merlin-language-server |
:white_check_mark: | :white_check_mark: | :white_check_mark: |
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.
Building
Prerequisites
- You will need
esyto build -npm install -g esy - For running tests, you will need
node.
Build
git clone https://github.com/bryphe/merlin-language-serveresy installesy build
Tests
- Unit tests:
esy x TestRunner.exe - E2E tests:
cd test-e2enpm installnpm test
Roadmap
- Distribution
- [ ] First-class Oni integration
- [ ] VSCode Plugin
- [ ] NPM package with pre-built binaries
- Features
- Text synchronization
- [x]
textDocument/didOpen - [x]
textDocument/didChange - [x] Full document sync
- [ ] Incremental document sync
- [x]
- Language Features
- [x]
completion - [x]
hover - [ ]
definition - [ ]
implementation - [ ]
references - [ ]
signatureHelp - [ ]
codeAction? - [ ]
codeLens - [ ]
formatting - [ ]
rangeFormatting - [ ]
onTypeFormatting
- [x]
- 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
MIT License
Copyright 2018 Bryan Phelps