diff --git a/download_schemas.py b/download_schemas.py index 1092ea8..f90300b 100755 --- a/download_schemas.py +++ b/download_schemas.py @@ -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')) diff --git a/generated/custom.py b/generated/custom.py index fb80b78..3f707da 100644 --- a/generated/custom.py +++ b/generated/custom.py @@ -478,7 +478,7 @@ class CodeLensResolveResponse(TypedDict): class ColorPresentationResponse(TypedDict): method: Literal['textDocument/colorPresentation'] - result: List['ColorPresentation'] + result: Union[List['ColorPresentation'], None] class CompletionResponse(TypedDict): @@ -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): diff --git a/generated/lsp_types.py b/generated/lsp_types.py index 6608342..e5d46c2 100644 --- a/generated/lsp_types.py +++ b/generated/lsp_types.py @@ -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 @@ -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.""" @@ -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. diff --git a/lsprotocol/lsp.json b/lsprotocol/lsp.json index 3f39b71..fedaab6 100644 --- a/lsprotocol/lsp.json +++ b/lsprotocol/lsp.json @@ -1,6 +1,6 @@ { "metaData": { - "version": "3.17.0" + "version": "3.18.0" }, "requests": [ { @@ -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", @@ -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" @@ -436,6 +456,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.callHierarchy", + "serverCapability": "callHierarchyProvider", "params": { "kind": "reference", "name": "CallHierarchyIncomingCallsParams" @@ -470,6 +492,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.callHierarchy", + "serverCapability": "callHierarchyProvider", "params": { "kind": "reference", "name": "CallHierarchyOutgoingCallsParams" @@ -1898,6 +1922,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.rangeFormatting", + "serverCapability": "documentRangeFormattingProvider", "params": { "kind": "reference", "name": "DocumentRangeFormattingParams" @@ -1928,8 +1954,8 @@ ] }, "messageDirection": "clientToServer", - "clientCapability": "textDocument.rangeFormatting", - "serverCapability": "documentRangeFormattingProvider", + "clientCapability": "textDocument.rangeFormatting.rangesSupport", + "serverCapability": "documentRangeFormattingProvider.rangesSupport", "params": { "kind": "reference", "name": "DocumentRangesFormattingParams" @@ -2276,7 +2302,7 @@ "typeName": "DidOpenTextDocumentNotification", "messageDirection": "clientToServer", "clientCapability": "textDocument.synchronization", - "serverCapability": "textDocumentSync", + "serverCapability": "textDocumentSync.openClose", "params": { "kind": "reference", "name": "DidOpenTextDocumentParams" @@ -2308,7 +2334,7 @@ "typeName": "DidCloseTextDocumentNotification", "messageDirection": "clientToServer", "clientCapability": "textDocument.synchronization", - "serverCapability": "textDocumentSync", + "serverCapability": "textDocumentSync.openClose", "params": { "kind": "reference", "name": "DidCloseTextDocumentParams" @@ -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": { @@ -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", @@ -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",