[ANN] ocaml-lsp-server 1.15.0-4.14 and 1.15.0-5.0

On behalf of the ocaml-lsp team, I’m pleased to announce ocaml-lsp-server versions 1.15.0-4.14 and 1.15.0-5.0 for OCaml 4.14 and 5.0, respectively. This is the first time we release ocaml-lsp supporting two compiler versions. We look forward to your feedback.

(the versions will be available on OPAM soon)

Full change log:

Features

  • Enable semantic highlighting support by default (#933)

  • Support connecting over pipes and socket. Pipes on Windows aren’t yet supported (#946)

    More about communication channels in LSP specification.

  • Re-enable ocamlformat-rpc for formatting code snippets (but not files and
    not on Windows) (#920, #939)

    One needs to have installed either ocamlformat package version > 0.21.0 or,
    otherwise, ocamlformat-rpc package. Note that previously ocamlformat-rpc
    came in a standalone OPAM package, but since ocamlformat version > 0.21.0,
    it comes within ocamlformat package.

  • Add custom ocamllsp/hoverExtended request (#561)

  • Support utf-8 position encoding clients (#919)

    More about position encoding in LSP specification.

  • Show unwrapped module alias types on hovering over module names. This is due
    to upgrading to merlin 4.7 and using merlin’s verbosity=smart by default
    (#942)

Fixes

  • Respect the client’s completion item resolve and preSelect capabilities
    (#925, #936)

  • Disable polling for dune’s watch mode on Windows and OCaml 4.14.0 (#935)

  • Fix semantic highlighting of “long identifiers,” e.g., Foo.Bar.x (#932)

  • Fix syncing of document contents:

    • For ranges that span an entire line (#927)
    • Previously, whole line edits would incorrectly eat the newline characters (#971)
21 Likes

As per usual, incredible work. The LSP server means a great deal to me personally when coding. Im very appreciative of all the lsp contributors!

5 Likes

Nice! Do you perhaps know how to use this with the built in lsp client in neovim? Do we need a neovim color theme that supports semantic highlighting specifically?

Nice! Do you perhaps know how to use this with the built in lsp client in neovim? Do we need a neovim color theme that supports semantic highlighting specifically?

perhaps, @rgrinberg knows

I’m pretty sure this is not yet available in the current version of neovim, so you’ll have to either play with the nightly or look at a plugin like GitHub - theHamsta/nvim-semantic-tokens.
Since the plugin (and probably the official version too) introduce new highlight groups, you’ll need either theming support, or custom configuration.

2 Likes