OCaml-LSP 1.28.0
CHANGES:
Features
* Offer parenthesized application snippets for constructors with payloads, with
independent argument slots, while retaining name-only completions. (#2212, @rgrinberg)
* Make generated destruct branch bodies interactive for clients with snippet edit
support. (#2204, @rgrinberg)
* Offer whole-call completions for OCaml functions with multiple labelled or
optional arguments, with editable slots for all arguments. (#2199, @rgrinberg)
* Make generated construct completions interactive for clients with snippet support.
(#2198, @rgrinberg)
* Support ocp-indent as an alternative for document and range formatting.
(#2148, @rgrinberg)
* Support textDocument/onTypeFormatting through the optional, persistent
ocp-indent-rpc helper. (#1986, @rgrinberg)
* Report Dune RPC, build progress, and Merlin configuration process activity
through LSP trace notifications. (#1899, @rgrinberg)
* Add a code action to open the closest Dune file for the current document.
(#1817, fixes #1491, @rgrinberg)
* Distinguish operators from functions in semantic highlighting. (#1831, @rgrinberg)
* Support textDocument/implementation for type declarations in interface files,
including nested modules, functor results, includes, and aliases.
(#2074, fixes #1163, @rgrinberg)
* Classify function parameters and labels in semantic highlighting.
(#1857, @rgrinberg)
* Distinguish built-in from user-defined types in semantic highlighting.
(#1858, fixes #1139, @rgrinberg)
Fixes
* Avoid overlapping semantic tokens in with type constraints and destructive
substitutions. (#2206, @rgrinberg)
* Preserve nested or-patterns when formatting destruct-line case-analysis
replies. (#2194, @rgrinberg)
* Clear stale Dune diagnostics and promotion actions when an RPC instance exits,
without removing a replacement instance for the same root. (#2189, @rgrinberg)
* Ensure recovered selection ranges contain the requested position. (#2170,
@rgrinberg)
* Suppress function extraction when a constructor would move out of scope or
resolve to a shadowing declaration. (#2169, @rgrinberg)
* Clamp recovered selection ranges to the document bounds. (#2061, @rgrinberg)
* Exclude symbol declarations from reference results when requested by the
client. (#2164, @rgrinberg)
* Convert related locations parsed from Merlin diagnostic messages to zero-based
LSP line numbers. (#2163, fixes #2145, @rgrinberg)
* Preserve trailing newlines when computing post-edit ranges. (#2159,
@rgrinberg)
* Return only inlay hints within the range requested by the client. (#2155,
@rgrinberg)
* Return document symbol kinds the client supports, falling back to
Constructor and Class when it does not advertise the newer kinds.
(#2122, fixes #2121, @dayangac)
* Offer the unused-code quick fixes again: they matched diagnostic messages the
server does not emit, and marking an unused open! produced open!!.
(#2117, fixes #2116, @dayangac)
* Offer to create a missing implementation or interface counterpart only when
the client supports the create resource operation. (#2115, fixes #2114,
@dayangac)
* Tag unused and deprecated values in diagnostics, so clients can grey them out
or strike them through. (#2110, fixes #2109, @dayangac)
* Honor client support for deprecation tags in workspace-symbol results.
(#2113, @rgrinberg)
* Respect the client's folding range capabilities: omit character positions for
lineFoldingOnly clients, omit unsupported folding range kinds, and honor
rangeLimit. (#2099, fixes #911, @dayangac)
* Classify module names in with constraints and in signature opens in
semantic highlighting. (#2098, fixes #808, @dayangac)
* Report a type when hovering a variant constructor or an exception where it is
declared. (#2102, fixes #1300, @dayangac)
* Return no location instead of failing the request when a definition,
declaration or type definition cannot be found, so clients that request them
eagerly no longer surface spurious errors. (#2100, fixes #1161, @dayangac)
* Prefer a same-document related location when a Dune diagnostic has an empty
primary range, such as ml/mli mismatches. (#2093, @rgrinberg)
* Stop offering the inferred-interface code action when the interface already
declares everything the implementation exports. (#2096, fixes #347, @dayangac)
* Unregister Dune promotion code actions when an RPC instance finishes.
(#2076, @rgrinberg)
* Avoid unregistering promotion code actions when clearing the last promotion
for an already open document. (#2075, @rgrinberg)
* Find destruct-line cases after module-type constraints in match scrutinees.
(#2072, @rgrinberg)
* Keep Dune RPC registry polling responsive while connected instances are
running. (#1919, @rgrinberg)
* Fix the build on FreeBSD, where statfs(2) is declared in
rather than . (#2070, fixes #1069, @dayangac)
* Deduplicate identical rename text edits returned by Merlin recovery.
(#2064, @rgrinberg)
* Reject cross-line destruct recovery locations before applying line-local
source offsets. (#2063, @rgrinberg)
* Use consistent document snapshots and versions when converting rename
occurrences into workspace edits. (#2062, @rgrinberg)
* Reject malformed destruct-line recovery replies and find match separators
lexically instead of treating identifier substrings as with. (#2043, @rgrinberg)
* Skip inline edit construction for bindings without applicable uses, avoiding
stack exhaustion when printing deeply recovered expressions. (#2041, @rgrinberg)
* Keep construct-completion text edits on the request line when Merlin recovery
returns a multiline location. (#2034, @rgrinberg)
* Advertise Dune promotion code actions using their returned quickfix kind.
(#2055, @rgrinberg)
* Reject interface documents passed to the ocamllsp/inferIntf custom request
with InvalidParams. (#2051, @rgrinberg)
* Report malformed type-enclosing custom-request parameters as InvalidParams
instead of an internal error. (#2050, @rgrinberg)
* Return null from the refactor-extract custom request for empty ranges.
(#2049, @rgrinberg)
* Return null from the destruct custom request for inapplicable ranges.
(#2048, @rgrinberg)
* Return null from the construct custom request when the cursor is not at a
typed hole. (#2047, @rgrinberg)
* Preserve deprecation status in workspace-symbol results. (#2044, @rgrinberg)
* Render empty odoc tables in hover documentation without raising an internal
error. (#2038, @rgrinberg)
* Enable function parameter inlay hints when the client sends no configuration.
(#2097, fixes #1371, @dayangac)
* Respect client support for signature-help parameter-label offsets. (#2009,
@rgrinberg)
* Keep Merlin diagnostic ranges within document bounds. (#2008, @rgrinberg)
* Suppress triggered completion and signature help inside comments after Unicode.
(#1994, @rgrinberg)
* Emit semantic tokens in source order so their relative positions remain valid.
(#1992, @rgrinberg)
* Stop stale signature help at expression boundaries. (#1987, fixes #1162,
@rgrinberg)
* Suppress signature help for completed applications. (#1982, #1162, @rgrinberg)
* Encode remove-unused code-action edits using the client's negotiated position
encoding. (#1969, @rgrinberg)
* Exclude surrounding parentheses from infix operator rename placeholders and
edits. (#1966, fixes #1190, @rgrinberg)
* Suppress signature help for applications after the cursor. (#1965, #1162,
@rgrinberg)
* Use each document's current version in multi-file rename edits. (#1958, @rgrinberg)
* Handle zero-work Dune build progress updates. (#1896, @rgrinberg)
* Do not report Dune build progress when the client disables work-done progress.
(#2082, @rgrinberg)
* Reject malformed Dune promotion commands. (#2084, @rgrinberg)
* Keep Dune promotion registrations balanced when diagnostics share a source.
(#2089, @rgrinberg)
* Reject negative JSON-RPC Content-Length headers. (#1873, @rgrinberg)
* Report unsupported LSP request methods as unavailable instead of internal
server errors. (#1862, @rgrinberg)
* Advertise semantic-token support only to clients that declare the capability.
(#1851, @rgrinberg)
* Advertise semantic-token support only to clients that support the relative
token format. (#1853, @rgrinberg)
* Advertise semantic-token support only to clients that support full-document
requests. (#1856, @rgrinberg)
* Advertise semantic-token delta support only to clients that request it.
(#1859, @rgrinberg)
* Advertise and encode only semantic token types supported by the client.
(#1860, @rgrinberg)
* Advertise and encode only semantic token modifiers supported by the client.
(#1978, @rgrinberg)
* Offer the destruct-line code action on inline match expressions with
incomplete cases. (#1829, fixes #1595, @rgrinberg)
* Replace a lone polymorphic-variant backtick when applying completions.
(#1823, fixes #1427, @rgrinberg)
* Report a missing project build-system executable as a diagnostic without
discarding the opened document. (#1814, @rgrinberg)
* Advertise all code-action kinds that the server may return. (#1803, @rgrinberg)
* Respect hierarchical code-action kind filters from clients. (#1802, @rgrinberg)
* Ensure textDocument/documentSymbol returns a selectionRange contained
within its range, so clients no longer reject the document outline.
(#1775, fixes #1560, @Leonard013)
* Recompute Merlin diagnostics when diagnostic shortening changes. (#1804, @rgrinberg)
* Avoid eagerly computing inline code-action edits when clients support lazy
resolution. (#1808, @rgrinberg)
* Keep URI query parameters separate from filesystem paths. (#1776, @rgrinberg)
* Preserve URI paths beginning with two slashes across serialization. (#1798, @rgrinberg)
* Preserve percent-encoded URI fragments across parsing and serialization. (#1801, @rgrinberg)
* Preserve URI paths whose first segment resembles a non-letter Windows drive. (#1800, @rgrinberg)
* Preserve unescaped Unicode in URI query components. (#1799, @rgrinberg)
* Preserve document offsets across incremental text edits. (#1777, @rgrinberg)
* Respect the client's preferred completion documentation format. (#1885, @rgrinberg)
* Parse non-ASCII completion prefixes and whitespace in CRLF input. (#1886, @rgrinberg)
* Use constructor completion kinds when clients do not support enum members. (#1887, @rgrinberg)
* Use completion deprecation tags when supported by the client. (#1903, @rgrinberg)
* Keep completion sort keys lexically ordered beyond 9,999 items. (#1883, @rgrinberg)
* Replace incorrect identifier suffixes when applying completions. (#1964, fixes #838, @rgrinberg)
* Give synthetic completion items stable ordering metadata. (#1882, @rgrinberg)
* Preserve dotted operators in completion prefixes and resolve requests. (#1890, @rgrinberg)
* Correct code-action ranges after multiline text insertions. (#1748, @rgrinberg)
* Allow clients to add their first workspace folder dynamically. (#1747, @rgrinberg)
* Unregister Dune promotion commands after their diagnostics are cleared. (#1746, @rgrinberg)
* Point workspace symbols for generated sources to their files in the build
directory. (#1742, @tatchi)
* Stop workspace symbol searches from warning when a workspace has not been
built yet. (#1769, @smorimoto)
* Prevent whole-document formatting requests for OCamllex, Menhir, and Cram
files from being routed through Dune's S-expression formatter.
* Refactor ppx hover to use merlin directly (#1606, fixes #1614)