Skip to content

v0.2.5

Choose a tag to compare

@owenrumney owenrumney released this 02 Aug 10:52
· 6 commits to main since this release
Immutable release. Only release title and notes can be modified.
a060039

Protocol conformance and correctness release. Most servers only need the mechanical migration below.

Breaking changes

  • Hover.Contents is now a union type — replace lsp.MarkupContent{...} literals with lsp.NewHoverContents(kind, value).
  • CompletionItem.TextEdit is now *lsp.CompletionTextEdit — wrap edits with lsp.NewCompletionTextEdit(...) or lsp.NewCompletionInsertReplaceEdit(...).
  • WorkspaceEdit.DocumentChanges is now []lsp.DocumentChange and supports create/rename/delete file operations — use the lsp.New*Change constructors.
  • DocumentSymbolProvider / WorkspaceSymbolProvider are option structs instead of *bool; check them with .Enabled().
  • The LSP lifecycle is enforced: requests before initialize get -32002, requests after shutdown are rejected, and notifications outside the initialized window are dropped (custom methods registered with HandleMethod included).
  • server.Run now returns nil after a clean shutdown/exit handshake and server.ErrExitWithoutShutdown when exit arrives without shutdown.

Fixed

  • The exit notification actually terminates the server, including over stdio.
  • Notification handlers can call the client (Configuration, ApplyEdit, ...) without deadlocking the connection.
  • Malformed input no longer kills the connection: bad JSON, invalid messages, and non-string/int request ids get -32700/-32600 replies and the server keeps serving; hostile Content-Length values are rejected safely.
  • UTF-16 position handling clamps per spec and can no longer split a \r\n pair when applying edits.
  • $/cancelRequest reaches requests that are still queued, and cancelled requests always receive a response.
  • Concurrent initialize requests can no longer both run; zero-value union structs marshal to their legacy shapes instead of erroring.
  • The debug UI binds loopback by default and rejects non-loopback websocket origins.

Added

  • LSP 3.17: notebook document sync, workspaceSymbol/resolve, completion itemDefaults/labelDetails, code action triggerKind, window/workDoneProgress/cancel, and workspace/did{Create,Rename,Delete}Files.
  • LocationLink handler variants for the definition family, automatic workspace.workspaceFolders advertisement, and WithOnTypeFormattingOptions / WithNotebookSyncOptions.

Full Changelog: v0.2.4...v0.2.5