Repository navigation
Conversation
The LSP spec marks eight enumerations with `supportsCustomValues`,
meaning a peer may legally send a value outside the set the spec defines.
The generated companions only exposed the predefined entries, and `entry`
is `protected`, so there was no way to build such a value.
The `supportsCustomValues` flag was being dropped entirely on decode, so
add it to `langoustine.meta.Enumeration` and have the generator mix a
`CustomStringValues` / `CustomIntValues` / `CustomUIntValues` trait into
the companions that declare it. Each provides a public `apply`, so e.g.
`CodeActionKind("mytool.fixAll")` now works, while enumerations that are
closed in the spec stay closed.
Affects CodeActionKind, ErrorCodes, FoldingRangeKind, LSPErrorCodes,
PositionEncodingKind, SemanticTokenModifiers, SemanticTokenTypes and
WatchKind.
`ALL` is unchanged and still lists the predefined values.
Also add a `.gitattributes` marking the checked-in generated sources and
the vendored spec files as `linguist-generated`, so they collapse in
diffs and stay out of language stats.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Bump `V.LSP_PROTOCOL` to 3.18, refresh the vendored `metaModel.json` /
`metaModel.schema.json` via `sbt updateModelFiles`, and regenerate the
LSP bindings with `sbt generateLSP`.
The 3.18 meta-model adds only optional fields (`sinceTags`,
`clientCapability`, `serverCapability`, `typeName`), which the derived
circe decoders in `langoustine.meta` already ignore, so the generator
needed no changes.
Spec changes that affect the public API:
* `InitializeParams.clientInfo` and `InitializeResult.serverInfo` are now
top-level `ClientInfo` / `ServerInfo` structures rather than anonymous
nested literals, so they are no longer nested in the owning objects.
Both are exported from `langoustine.lsp.all`.
* `TextDocumentItem.languageId` is now `LanguageKind` -- an opaque string
type -- instead of a bare `String`. `LanguageKind` is marked
`supportsCustomValues`, so a custom language id is written
`LanguageKind("my-toy-lang")`, using the constructor added in the
parent commit.
* `TextDocumentEdit.edits` gained `SnippetTextEdit` in its union.
* The `TraceValues` enumeration was renamed to `TraceValue`; the stale
generated file is removed, as the generator does not prune.
* Two new requests: `workspace/textDocumentContent` and
`workspace/textDocumentContent/refresh`.
Callers in the example, docs and tests are updated accordingly, and the
JVM/JS/Native codec snapshots are regenerated for the new field ordering.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
kubukoz
force-pushed
the
update-lsp-spec-3.18
branch
from
September 7, 2026 23:26
572557a to
2aa1055
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bumps
V.LSP_PROTOCOLto3.18, refreshes the vendoredmetaModel.json/metaModel.schema.jsonviasbt updateModelFiles, and regenerates the bindings withsbt generateLSP.The 3.18 meta-model only adds optional fields (
sinceTags,clientCapability,serverCapability,typeName), which the derived circe decoders inlangoustine.metaalready ignore — so the generator needed no changes.Breaking API changes from the spec
InitializeParams.clientInfoandInitializeResult.serverInfoare now top-levelClientInfo/ServerInfostructures instead of anonymous nested literals. They are no longer nested in the owning objects, soInitializeResult.ServerInfo(...)becomesServerInfo(...)(both are exported fromlangoustine.lsp.all).TextDocumentItem.languageIdis nowLanguageKind— an opaque string type, not a bareString. It is markedsupportsCustomValues, so a custom language id is writtenLanguageKind("my-toy-lang"), using the constructor from Allow constructing custom values for open enumerations #217.TextDocumentEdit.editsgainedSnippetTextEditin its union.TraceValuesenumeration was renamed toTraceValue. The stale generated file is deleted here by hand, sincegenerateLSPwrites files but does not prune removed ones.New requests
workspace/textDocumentContentworkspace/textDocumentContent/refreshOther changes
modules/example,modules/e2e-tests,modules/testsand the docs.DeriveScalacheckArbitrarygains agenUnion3for the widened edits union.CustomEnumValuesTest(added in Allow constructing custom values for open enumerations #217) gainsLanguageKindcases.testsJSset was synced to match, as all three are kept identical and Node isn't available locally)..../lsp/3.17/...to3.18.Note for review
LanguageKind.ALLhas 61 entries for 62 named values: upstream spells bothDelphiandPascalas"pascal", so they are aliases. Left as-is, since both names resolve correctly — there is a test pinning this.Testing
tests/test(42 passed),testsNative/test(29 passed),scalafmtCheckAllandheaderCheckall pass. JS tests and the Node.js half ofe2e-testscould not run locally —nodeisn't installed on this machine — so those are left to CI; both modules do compile.🤖 Generated with Claude Code