OCaml Changelog

RSS

Read the latest releases and updates from the OCaml ecosystem.

We are pleased to announce the release of OCaml LSP 1.18.0. This version comes with a lot of fixes and new features.

Notable features that are included in this release are:

  • Improved hover behavior with less noisy hovers on some parse tree nodes such as keywords, comments, etc., along with support for hovering over PPX annotations and preview the generated code.
  • Some additional custom queries, particularly TypeEnclosing
  • Folding ifthenelse expressions
  • A new configuration option to control Dune diagnostics
  • Improved document symbols

...and many fixes to a handful of issues.

Feedback is very much welcomed on the the Discuss Announcement post and do not hesistate to report issues in the issue tracker.

See full changelog

Features

  • Introduce a configuration option to control Dune diagnostics. The option is called duneDiganostics, and it may be set to { enable: false } to disable diagnostics. (ocaml/ocaml-lsp#1221)

  • Support folding of ifthenelse expressions (ocaml/ocaml-lsp#1031)

  • Improve hover behavior (ocaml/ocaml-lsp#1245)

    Hovers are no longer displayed on useless parse tree nodes such as keywords, comments, etc.

    Multiline hovers are now filtered away.

    Display expanded PPXs in the hover window.

  • Improve document symbols (ocaml/ocaml-lsp#1247)

    Use the parse tree instead of the typed tree. This means that document symbols will work even if the source code doesn't type check.

    Include symbols at arbitrary depth.

    Differentiate functions / types / variants / etc.

    This now includes PPXs like let%expect_test or let%bench in the outline.

  • Introduce a destruct-line code action. This is an improved version of the old destruct code action. (ocaml/ocaml-lsp#1283)

  • Improve signature inference to only include types for elements that were absent from the signature. Previously, all signature items would always be inserted. (ocaml/ocaml-lsp#1289)

  • Add an update-signature code action to update the types of elements that were already present in the signature (ocaml/ocaml-lsp#1289)

  • Add custom ocamllsp/merlinCallCompatible request (ocaml/ocaml-lsp#1265)

  • Add custom ocamllsp/typeEnclosing request (ocaml/ocaml-lsp#1304)

Fixes

  • Detect document kind by looking at Merlin's suffixes config.

    This enables more LSP features for non-.ml/.mli files. Though it still depends on Merlin's support. (ocaml/ocaml-lsp#1237)

  • Correctly accept the --clientProcessId flag. (ocaml/ocaml-lsp#1242)

  • Disable automatic completion and signature help inside comments (ocaml/ocaml-lsp#1246)

  • Includes a new optional/configurable option to toggle syntax documentation. If toggled on, allows display of syntax documentation on hover tooltips. Can be controlled via environment variables and by GUI for VS code. (ocaml/ocaml-lsp#1218)

  • For completions on labels that the LSP gets from Merlin, take into account whether the prefix being completed starts with ~ or ?. Change the label completions that start with ? to start with ~ when the prefix being completed starts with ~. (ocaml/ocaml-lsp#1277)

  • Fix document syncing (ocaml/ocaml-lsp#1278, ocaml/ocaml-lsp#1280, fixes ocaml/ocaml-lsp#1207)

  • Stop generating inlay hints on generated code (ocaml/ocaml-lsp#1290)

  • Fix parenthesising of function types in SignatureHelp (ocaml/ocaml-lsp#1296)

  • Fix syntax documentation rendering (ocaml/ocaml-lsp#1318)

We are pleased to announce the release of OCaml LSP 1.17.0. This version comes packed with fixes and new features.

Notable features that come in this release include:

  • Compatibility with Odoc 2.3.0: This version is fully compatible with Odoc 2.3.0, introducing support for the latest syntax features like tables and "codeblock output."
  • New Actions for Code Cleanup: You can now mark or remove unused elements such as 'open', types, for loop indexes, modules, match cases, 'rec', and constructors, making your code cleaner and more efficient.
  • Auto-completion for 'in' Keyword: To address the long standing issue of the in keyword completing to other terms in the editor, we've added auto-completion for this keyword in OCaml LSP. Typing in will now only suggest auto completion for the in keyword.
See full changelog

Fixes

  • Fix missing super & subscripts in markdown documentation. (#1170)
  • Do not invoke dune at all if --fallback-read-dot-merlin flag is on. (#1173)
  • Fix semantic highlighting of infix operators that contain '.'. (#1186)
  • Disable highlighting unit as an enum member to fix comment highlighting bug. (#1185)
  • Improve type-on-hover and type-annotate efficiency by only formatting the type of the first enclosing. (#1191, #1196)
  • Fix the encoding of URI's to match how vscode does it (#1197)
  • Fix parsing of completion prefixes (#1181)

Features

  • Compatibility with Odoc 2.3.0, with support for the introduced syntax: tables, and "codeblock output" (#1184)
  • Display text of references in doc strings (#1166)
  • Add mark/remove unused actions for open, types, for loop indexes, modules, match cases, rec, and constructors (#1141)
  • Offer auto-completion for the keyword in (#1217)

We've released OCaml LSP 1.16.2 with a fix that was introduced in 1.16.1 that prevented users from using preprocessor such as CPPO.

See full changelog

Fixes

  • Fix file permissions used when specifying output files of pp and ppx. (ocaml-lsp#1153)

We're thrilled to announce the release of OCaml LSP 1.16.1! πŸŽ‰

This release comes with new "Extract local" and "Extract function" code actions to easily refactor your code.

We've also disabled code lenses by default following user feedback. You can follow the discussion on GitHub.

This release is also the first OCaml LSP release to use upstream Merlin. Among other things, this means that it is compatible with all the OCaml versions supported by Merlin: currently OCaml 4.14 and 5.0.0.

We're also releasing numerous bug fixes, including:

  • A fix to the integration with Dune RPC on Windows, which, alongside Dune 3.9.0, makes OCaml LSP report Dune errors to the editors with Dune watch mode enabled.
  • Minor improvements to the Odoc <-> Markdown conversion to return better function documentation on the editor.

And much more! Read the full changelog for a complete list of improvements and bug fixes.

See full changelog

Features

  • Add "Remove type annotation" code action. (#1039)
  • Support settings through didChangeConfiguration notification (#1103)
  • Add "Extract local" and "Extract function" code actions. (#870)
  • Depend directly on merlin-lib 4.9 (#1070)

Fixes

  • Support building with OCaml 5.0 and 5.1 (#1150)

  • Disable code lens by default. The support can be re-enabled by explicitly setting it in the configuration. (#1134)

  • Fix initilization of ocamlformat-rpc in some edge cases when ocamlformat is initialized concurrently (#1132)

  • Kill unnecessary $ dune ocaml-merlin with SIGTERM rather than SIGKILL (#1124)

  • Refactor comment parsing to use odoc-parser and cmarkit instead of octavius and omd (#1088)

    This allows users who migrated to omd 2.X to install ocaml-lsp-server in the same opam switch.

    We also slightly improved markdown generation support and fixed a couple in the generation of inline heading and module types.

  • Allow opening documents that were already open. This is a workaround for neovim's lsp client (#1067)

  • Disable type annotation for functions (#1054)

  • Respect codeActionLiteralSupport capability (#1046)

  • Fix a document syncing issue when utf-16 is the position encoding (#1004)

  • Disable "Type-annotate" action for code that is already annotated. (#1037, fixes #1036)

  • Fix semantic highlighting of long identifiers when using preprocessors (#1049, fixes #1034)

  • Fix the type of DocumentSelector in cram document registration (#1068)

  • Accept the --clientProcessId command line argument. (#1074)

  • Accept --port as a synonym for --socket. (#1075)

  • Fix connecting to dune rpc on Windows. (#1080)

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.

See full changelog

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)
See full changelog

Fixes

  • Fix random requests failing after switching documents (#904, fixes #898)

  • Do not offer related diagnostic information unless the user enables in client capabilities (#905)

  • Do not offer diagnostic tags unless the client supports them (#909)

  • Do not attach extra data to diagnostics unless the client supports this (#910)

  • Use /bin/sh instead of /bin/bash. This fixes ocamllsp on NixOS

See full changelog

Fixes

  • Fix various server crashes when opening non OCaml/Reason files. Files such as dune, cram, etc. would cause the server to crash. (#884, fixes #871)

  • Ignore unknown tags in merlin configuration to improve forward compatibility with Dune. (#883)

On behalf of the ocamllsp team, I'm pleased to announce version 1.14.0. This release contains a new code action to help you inline definitions thanks to @jfeser. We look forward to your feedback.

See full changelog

Features

  • Code action for inlining let bindings within a module or expression. (#847)

  • Tag "unused code" and "deprecated" warnings, allowing clients to better display them. (#848)

  • Refresh merlin configuration after every dune build in watch mode (#853)

Fixes

  • Respect showDocument capabilities. Do not offer commands or code actions that rely on this request without client support. (#836)

  • Fix signatureHelp on .mll files: avoid "Document.dune" exceptions

See full changelog
  • Allow cancellation of workspace symbols requests (#777)

  • Fix unintentionally interleaved jsonrpc IO that would corrupt the session (#786)

  • Ignore SIGPIPE . (#788)

See full changelog

Fixes

  • Fix a bad interaction between inferred interfaces and promotion code actions in watch mode (#753)

  • Fix URI parsing (#739 fixes #471 and #459)

See full changelog

Fixes

  • Fix preprocessing, ppx, and reason support (#735 fixes #696, #706)

  • Support include in folding ranges (#730)

See full changelog

Features

  • Fix cancellation mechanism for all requests (#707)

  • Allow cancellation of formatting requests (#707)

  • Add --fallback-read-dot-merlin to the LSP Server (#705). If ocamllsp is started with this new flag, it will fall back to looking for Merlin configuration in .merlin files rather than calling dune ocaml-merlin. (#705)

  • Support folding more ranges (#692)

See full changelog
  • Fix process termination. Once the lsp server is stepped, the process will gracefully terminate (#697, fixes #694)

  • Forward stderr from dune's merlin configuration to the lsp server's stderr (#697)

See full changelog
  • Fix bug with large buffers being resized incorrectly in Lev

  • Add folding ranges for more AST types (#680)

On behalf of the ocamllsp team, I’m excited to announce the availability of version 1.11.0. This release is an important milestone for the project because it introduces integration with our favorite build system. When you run dune in watch mode, you will now be able to see build errors in the diagnostics panel of your editor. It’s all rather experimental for now, so your feedback and bug reports are appreciated.

As usual, the full change log is below.

Happy hacking.

See full changelog

Features

  • Add support for dune in watch mode. The lsp server will now display build errors in the diagnostics and offer promotion code actions.

  • Re-introduce ocamlformat-rpc (#599, fixes #495)

Fixes

  • Fix workspace symbols that could have a wrong path in some cases (#675)
If you want to contribute to a new release announcement, check out the Contributing Guide on GitHub.