[ANN] New release of Merlin

I am very pleased to announce a new release of Merlin for OCaml 5.2, 5.1 and 4.14. This release brings a handful of fixes but also a handful of of new commands:

  • signature_help and inlay_hint have been upstreamed from ocaml-lsp-server
  • expand_node a command to get the ppxed-source when called on relevant annotations
  • :female_detective: search-by-type a sherlodoc-inspired syntax to search for values in the environment, that superseeds polarity-search.

Only search-by-type has an Emacs binding right now (and one for vim on is in the works), we hope to have some time to work on more client implementations in the near future.

merlin-search-example-1

Complete changelog:

Fri Sep 27 12:02:42 CEST 2024

  • merlin binary
    • A new WRAPPING_PREFIX configuration directive that can be used to tell Merlin
      what to append to the current unit name in the presence of wrapping (ocaml/merlin#1788)
    • Add -unboxed-types and -no-unboxed-types as ocaml ignored flags (ocaml/merlin#1795, fixes ocaml/merlin#1794)
    • destruct: Refinement in the presence of optional arguments (ocaml/merlin#1800 ocaml/merlin#1807, fixes ocaml/merlin#1770)
    • Implement new expand-node command for expanding PPX annotations (ocaml/merlin#1745)
    • Implement new inlay-hints command for adding hints on a sourcetree (ocaml/merlin#1812)
    • Implement new search-by-type command for searching values by types (ocaml/merlin#1828)
    • Canonicalize paths in occurrences. This helps deduplicate the results and
      show more user-friendly paths. (ocaml/merlin#1840)
    • Fix dot-merlin-reader ignoring SOURCE_ROOT and STDLIB directives
      (ocaml/merlin#1839, ocaml/merlin#1803)
  • editor modes
    • vim: fix python-3.12 syntax warnings in merlin.py (ocaml/merlin#1798)
    • vim: Dead code / doc removal for previously deleted MerlinPhrase command (ocaml/merlin#1804)
    • emacs: Improve the way that result of polarity search is displayed (ocaml/merlin#1814)
    • emacs: Add merlin-search-by-type, merlin-search-by-polarity and change the
      behaviour of merlin-search to switch between by-type or by-polarity
      depending on the query (ocaml/merlin#1828)

cc @xvw @PizieDust

16 Likes

The GIFs attached seem to be private and do not render (for me, at least)

1 Like

Should be fixed now, thanks for reporting!

Here’s an example of how to use the search by type:

merlin-search-example-1

which works in a very similar way to Sherlodoc by @art-w, but from your IDE, using the project scope! An article should be written in the next few days, but we’d love to hear your feedback on the feature, to potentially improve the heuristics implemented and the user experience!

14 Likes