Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions download_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
from pathlib import Path
from urllib.request import urlopen

REPO_URL = 'https://raw.githubusercontent.com/microsoft/vscode-languageserver-node'
REPO_URL = 'https://raw.githubusercontent.com/microsoft/language-server-protocol'

with urlopen(f'{REPO_URL}/main/protocol/metaModel.schema.json') as url:
with urlopen(f'{REPO_URL}/refs/heads/gh-pages/_specifications/lsp/3.18/metaModel/metaModel.schema.json') as url:
Path('./lsprotocol/lsp.schema.json').write_text(url.read().decode('utf-8'))

with urlopen(f'{REPO_URL}/main/protocol/metaModel.json') as url:
with urlopen(f'{REPO_URL}/refs/heads/gh-pages/_specifications/lsp/3.18/metaModel/metaModel.json') as url:
Path('./lsprotocol/lsp.json').write_text(url.read().decode('utf-8'))
4 changes: 2 additions & 2 deletions generated/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ class CodeLensResolveResponse(TypedDict):

class ColorPresentationResponse(TypedDict):
method: Literal['textDocument/colorPresentation']
result: List['ColorPresentation']
result: Union[List['ColorPresentation'], None]
Copy link
Copy Markdown
Member

@rchl rchl Apr 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to match https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#textDocument_colorPresentation and also it would be a breaking change.

EDIT: I suppose breaking changes like that are allowed in new spec versions. Technically those should already be guarded by capability.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will assume that someone forgot to update the html version of the spec.

Copy link
Copy Markdown
Member

@jwortmann jwortmann Apr 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a discussion about that in microsoft/language-server-protocol#2235 with some backlash due to it being a breaking change.

But even if it ends up in the specs, our code should be fine because we already handle this case:
https://github.com/sublimelsp/LSP/blob/40c9fe32ad0d4edf084e19b21e71505796c12dcd/plugin/color.py#L32-L34

https://github.com/sublimelsp/LSP/blob/40c9fe32ad0d4edf084e19b21e71505796c12dcd/plugin/session_buffer.py#L570-L571



class CompletionResponse(TypedDict):
Expand Down Expand Up @@ -513,7 +513,7 @@ class DiagnosticRefreshResponse(TypedDict):

class DocumentColorResponse(TypedDict):
method: Literal['textDocument/documentColor']
result: List['ColorInformation']
result: Union[List['ColorInformation'], None]


class DocumentDiagnosticResponse(TypedDict):
Expand Down
18 changes: 11 additions & 7 deletions generated/lsp_types.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ruff: noqa: E501, UP006, UP007
# Code generated. DO NOT EDIT.
# LSP v3.17.0
# LSP v3.18.0

from __future__ import annotations

Expand Down Expand Up @@ -3706,16 +3706,16 @@ class DocumentOnTypeFormattingRegistrationOptions(TypedDict):
class RenameParams(TypedDict):
"""The parameters of a {@link RenameRequest}."""

textDocument: 'TextDocumentIdentifier'
"""The document to rename."""
position: 'Position'
"""The position at which this request was sent."""
newName: str
"""
The new name of the symbol. If the given name is not valid the
request must return a {@link ResponseError} with an
appropriate message set.
"""
textDocument: 'TextDocumentIdentifier'
"""The text document."""
position: 'Position'
"""The position inside the text document."""
workDoneToken: NotRequired['ProgressToken']
"""An optional token that a server can use to report work done progress."""

Expand Down Expand Up @@ -5024,8 +5024,12 @@ class Diagnostic(TypedDict):
diagnostic, e.g. 'typescript' or 'super lint'. It usually
appears in the user interface.
"""
message: str
"""The diagnostic's message. It usually appears in the user interface"""
message: Union[str, 'MarkupContent']
"""
The diagnostic's message. It usually appears in the user interface.

@since 3.18.0 - support for `MarkupContent`. This is guarded by the client capability `textDocument.diagnostic.markupMessageSupport`.
"""
tags: NotRequired[List['DiagnosticTag']]
"""
Additional metadata about the diagnostic.
Expand Down
93 changes: 59 additions & 34 deletions lsprotocol/lsp.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"metaData": {
"version": "3.17.0"
"version": "3.18.0"
},
"requests": [
{
Expand Down Expand Up @@ -159,11 +159,20 @@
"method": "textDocument/documentColor",
"typeName": "DocumentColorRequest",
"result": {
"kind": "array",
"element": {
"kind": "reference",
"name": "ColorInformation"
}
"kind": "or",
"items": [
{
"kind": "array",
"element": {
"kind": "reference",
"name": "ColorInformation"
}
},
{
"kind": "base",
"name": "null"
}
]
},
"messageDirection": "clientToServer",
"clientCapability": "textDocument.colorProvider",
Expand All @@ -189,13 +198,24 @@
"method": "textDocument/colorPresentation",
"typeName": "ColorPresentationRequest",
"result": {
"kind": "array",
"element": {
"kind": "reference",
"name": "ColorPresentation"
}
"kind": "or",
"items": [
{
"kind": "array",
"element": {
"kind": "reference",
"name": "ColorPresentation"
}
},
{
"kind": "base",
"name": "null"
}
]
},
"messageDirection": "clientToServer",
"clientCapability": "textDocument.colorProvider",
"serverCapability": "colorProvider",
"params": {
"kind": "reference",
"name": "ColorPresentationParams"
Expand Down Expand Up @@ -436,6 +456,8 @@
]
},
"messageDirection": "clientToServer",
"clientCapability": "textDocument.callHierarchy",
"serverCapability": "callHierarchyProvider",
"params": {
"kind": "reference",
"name": "CallHierarchyIncomingCallsParams"
Expand Down Expand Up @@ -470,6 +492,8 @@
]
},
"messageDirection": "clientToServer",
"clientCapability": "textDocument.callHierarchy",
"serverCapability": "callHierarchyProvider",
"params": {
"kind": "reference",
"name": "CallHierarchyOutgoingCallsParams"
Expand Down Expand Up @@ -1898,6 +1922,8 @@
]
},
"messageDirection": "clientToServer",
"clientCapability": "textDocument.rangeFormatting",
"serverCapability": "documentRangeFormattingProvider",
"params": {
"kind": "reference",
"name": "DocumentRangeFormattingParams"
Expand Down Expand Up @@ -1928,8 +1954,8 @@
]
},
"messageDirection": "clientToServer",
"clientCapability": "textDocument.rangeFormatting",
"serverCapability": "documentRangeFormattingProvider",
"clientCapability": "textDocument.rangeFormatting.rangesSupport",
"serverCapability": "documentRangeFormattingProvider.rangesSupport",
"params": {
"kind": "reference",
"name": "DocumentRangesFormattingParams"
Expand Down Expand Up @@ -2276,7 +2302,7 @@
"typeName": "DidOpenTextDocumentNotification",
"messageDirection": "clientToServer",
"clientCapability": "textDocument.synchronization",
"serverCapability": "textDocumentSync",
"serverCapability": "textDocumentSync.openClose",
"params": {
"kind": "reference",
"name": "DidOpenTextDocumentParams"
Expand Down Expand Up @@ -2308,7 +2334,7 @@
"typeName": "DidCloseTextDocumentNotification",
"messageDirection": "clientToServer",
"clientCapability": "textDocument.synchronization",
"serverCapability": "textDocumentSync",
"serverCapability": "textDocumentSync.openClose",
"params": {
"kind": "reference",
"name": "DidCloseTextDocumentParams"
Expand Down Expand Up @@ -6397,22 +6423,6 @@
{
"name": "RenameParams",
"properties": [
{
"name": "textDocument",
"type": {
"kind": "reference",
"name": "TextDocumentIdentifier"
},
"documentation": "The document to rename."
},
{
"name": "position",
"type": {
"kind": "reference",
"name": "Position"
},
"documentation": "The position at which this request was sent."
},
{
"name": "newName",
"type": {
Expand All @@ -6422,6 +6432,12 @@
"documentation": "The new name of the symbol. If the given name is not valid the\nrequest must return a {@link ResponseError} with an\nappropriate message set."
}
],
"extends": [
{
"kind": "reference",
"name": "TextDocumentPositionParams"
}
],
"mixins": [
{
"kind": "reference",
Expand Down Expand Up @@ -9143,10 +9159,19 @@
{
"name": "message",
"type": {
"kind": "base",
"name": "string"
"kind": "or",
"items": [
{
"kind": "base",
"name": "string"
},
{
"kind": "reference",
"name": "MarkupContent"
}
]
},
"documentation": "The diagnostic's message. It usually appears in the user interface"
"documentation": "The diagnostic's message. It usually appears in the user interface.\n\n@since 3.18.0 - support for `MarkupContent`. This is guarded by the client capability `textDocument.diagnostic.markupMessageSupport`."
},
{
"name": "tags",
Expand Down