From 5fec6713ccf313f9397d03583a9ec96115e65324 Mon Sep 17 00:00:00 2001 From: Jimmy Byrd Date: Wed, 12 Jun 2024 22:18:05 -0400 Subject: [PATCH] Generate types from LSP meta model (#49) Generates F# types and serialization infrastructure directly from the LSP metamodel.sjon --------- Co-authored-by: Edgar Gonzalez Co-authored-by: Chet Husk --- .editorconfig | 7 +- .github/workflows/build.yml | 5 + .gitignore | 1 + .vscode/settings.json | 2 +- LanguageServerProtocol.sln | 11 + data/3.17.0/metaModel.json | 14835 ++++++++++++++++ data/3.17.0/metaModel.schema.json | 783 + src/Client.fs | 4 +- src/Ionide.LanguageServerProtocol.fsproj | 41 +- src/JsonUtils.fs | 151 +- src/LanguageServerProtocol.fs | 183 +- src/OptionConverter.fs | 126 + src/Server.fs | 23 +- src/TypeDefaults.fs | 213 + src/Types.cg.fs | 7517 ++++++++ src/Types.fs | 3961 +---- tests/Benchmarks.fs | 60 +- ...Ionide.LanguageServerProtocol.Tests.fsproj | 83 +- tests/Shotgun.fs | 21 +- tests/Tests.fs | 102 +- tests/Utils.fs | 10 +- .../GenerateClientServer.fs | 7 + tools/MetaModelGenerator/GenerateTypes.fs | 999 ++ tools/MetaModelGenerator/MetaModel.fs | 479 + .../MetaModelGenerator.fsproj | 19 + .../MetaModelGenerator/PrimitiveExtensions.fs | 40 + tools/MetaModelGenerator/Program.fs | 101 + 27 files changed, 25570 insertions(+), 4214 deletions(-) create mode 100644 data/3.17.0/metaModel.json create mode 100644 data/3.17.0/metaModel.schema.json create mode 100644 src/OptionConverter.fs create mode 100644 src/TypeDefaults.fs create mode 100644 src/Types.cg.fs create mode 100644 tools/MetaModelGenerator/GenerateClientServer.fs create mode 100644 tools/MetaModelGenerator/GenerateTypes.fs create mode 100644 tools/MetaModelGenerator/MetaModel.fs create mode 100644 tools/MetaModelGenerator/MetaModelGenerator.fsproj create mode 100644 tools/MetaModelGenerator/PrimitiveExtensions.fs create mode 100644 tools/MetaModelGenerator/Program.fs diff --git a/.editorconfig b/.editorconfig index 4d3687f..d4e1f5a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -12,9 +12,14 @@ trim_trailing_whitespace = false insert_final_newline = false max_line_length=120 fsharp_max_if_then_else_short_width=60 -fsharp_max_infix_operator_expression=60 fsharp_max_record_width=80 fsharp_max_array_or_list_width=80 fsharp_max_value_binding_width=120 fsharp_max_function_binding_width=120 fsharp_max_dot_get_expression_width=120 +fsharp_multiline_bracket_style = stroustrup +fsharp_keep_max_number_of_blank_lines=2 +fsharp_max_array_or_list_number_of_items=1 +fsharp_array_or_list_multiline_formatter=number_of_items +fsharp_max_infix_operator_expression=10 +fsharp_multi_line_lambda_closing_newline=true \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f8e4d35..65e2eb3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,6 +17,11 @@ jobs: show-progress: false - name: Setup .NET Core uses: actions/setup-dotnet@v4 + with: + global-json-file: global.json + dotnet-version: | + 8.x + 6.x - name: Run build run: dotnet build -c Release src - name: Run tests diff --git a/.gitignore b/.gitignore index 0eefb3e..57d583c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ bin obj release BenchmarkDotNet.Artifacts +.idea diff --git a/.vscode/settings.json b/.vscode/settings.json index 88c8839..ebcf8fd 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,5 @@ { - "editor.formatOnSave": true, + // "editor.formatOnSave": true, "yaml.schemas": { "https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/github-workflow.json": ".github/workflows/**" }, diff --git a/LanguageServerProtocol.sln b/LanguageServerProtocol.sln index 0eb0b46..638d661 100644 --- a/LanguageServerProtocol.sln +++ b/LanguageServerProtocol.sln @@ -7,6 +7,10 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Ionide.LanguageServerProtoc EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Ionide.LanguageServerProtocol.Tests", "tests\Ionide.LanguageServerProtocol.Tests.fsproj", "{8E54FA2A-C7E4-4D70-AF23-7F8D56EB6B9C}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{47733741-07EF-431B-A1DC-2A22E4090CCC}" +EndProject +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "MetaModelGenerator", "tools\MetaModelGenerator\MetaModelGenerator.fsproj", "{4BA36C85-8414-4965-AAA3-B6D8EDE14B7D}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -24,5 +28,12 @@ Global {8E54FA2A-C7E4-4D70-AF23-7F8D56EB6B9C}.Debug|Any CPU.Build.0 = Debug|Any CPU {8E54FA2A-C7E4-4D70-AF23-7F8D56EB6B9C}.Release|Any CPU.ActiveCfg = Release|Any CPU {8E54FA2A-C7E4-4D70-AF23-7F8D56EB6B9C}.Release|Any CPU.Build.0 = Release|Any CPU + {4BA36C85-8414-4965-AAA3-B6D8EDE14B7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4BA36C85-8414-4965-AAA3-B6D8EDE14B7D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4BA36C85-8414-4965-AAA3-B6D8EDE14B7D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4BA36C85-8414-4965-AAA3-B6D8EDE14B7D}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {4BA36C85-8414-4965-AAA3-B6D8EDE14B7D} = {47733741-07EF-431B-A1DC-2A22E4090CCC} EndGlobalSection EndGlobal diff --git a/data/3.17.0/metaModel.json b/data/3.17.0/metaModel.json new file mode 100644 index 0000000..51bb692 --- /dev/null +++ b/data/3.17.0/metaModel.json @@ -0,0 +1,14835 @@ +{ + "metaData": { + "version": "3.17.0" + }, + "requests": [ + { + "method": "textDocument/implementation", + "result": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "Definition" + }, + { + "kind": "array", + "element": { + "kind": "reference", + "name": "DefinitionLink" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "ImplementationParams" + }, + "partialResult": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "Location" + } + }, + { + "kind": "array", + "element": { + "kind": "reference", + "name": "DefinitionLink" + } + } + ] + }, + "registrationOptions": { + "kind": "reference", + "name": "ImplementationRegistrationOptions" + }, + "documentation": "A request to resolve the implementation locations of a symbol at a given text\ndocument position. The request's parameter is of type {@link TextDocumentPositionParams}\nthe response is of type {@link Definition} or a Thenable that resolves to such." + }, + { + "method": "textDocument/typeDefinition", + "result": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "Definition" + }, + { + "kind": "array", + "element": { + "kind": "reference", + "name": "DefinitionLink" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "TypeDefinitionParams" + }, + "partialResult": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "Location" + } + }, + { + "kind": "array", + "element": { + "kind": "reference", + "name": "DefinitionLink" + } + } + ] + }, + "registrationOptions": { + "kind": "reference", + "name": "TypeDefinitionRegistrationOptions" + }, + "documentation": "A request to resolve the type definition locations of a symbol at a given text\ndocument position. The request's parameter is of type {@link TextDocumentPositionParams}\nthe response is of type {@link Definition} or a Thenable that resolves to such." + }, + { + "method": "workspace/workspaceFolders", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "WorkspaceFolder" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "serverToClient", + "documentation": "The `workspace/workspaceFolders` is sent from the server to the client to fetch the open workspace folders." + }, + { + "method": "workspace/configuration", + "result": { + "kind": "array", + "element": { + "kind": "reference", + "name": "LSPAny" + } + }, + "messageDirection": "serverToClient", + "params": { + "kind": "reference", + "name": "ConfigurationParams" + }, + "documentation": "The 'workspace/configuration' request is sent from the server to the client to fetch a certain\nconfiguration setting.\n\nThis pull model replaces the old push model where the client signaled configuration change via an\nevent. If the server still needs to react to configuration changes (since the server caches the\nresult of `workspace/configuration` requests) the server should register for an empty configuration\nchange event and empty the cache if such an event is received." + }, + { + "method": "textDocument/documentColor", + "result": { + "kind": "array", + "element": { + "kind": "reference", + "name": "ColorInformation" + } + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "DocumentColorParams" + }, + "partialResult": { + "kind": "array", + "element": { + "kind": "reference", + "name": "ColorInformation" + } + }, + "registrationOptions": { + "kind": "reference", + "name": "DocumentColorRegistrationOptions" + }, + "documentation": "A request to list all color symbols found in a given text document. The request's\nparameter is of type {@link DocumentColorParams} the\nresponse is of type {@link ColorInformation ColorInformation[]} or a Thenable\nthat resolves to such." + }, + { + "method": "textDocument/colorPresentation", + "result": { + "kind": "array", + "element": { + "kind": "reference", + "name": "ColorPresentation" + } + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "ColorPresentationParams" + }, + "partialResult": { + "kind": "array", + "element": { + "kind": "reference", + "name": "ColorPresentation" + } + }, + "registrationOptions": { + "kind": "and", + "items": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + }, + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + } + ] + }, + "documentation": "A request to list all presentation for a color. The request's\nparameter is of type {@link ColorPresentationParams} the\nresponse is of type {@link ColorInformation ColorInformation[]} or a Thenable\nthat resolves to such." + }, + { + "method": "textDocument/foldingRange", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "FoldingRange" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "FoldingRangeParams" + }, + "partialResult": { + "kind": "array", + "element": { + "kind": "reference", + "name": "FoldingRange" + } + }, + "registrationOptions": { + "kind": "reference", + "name": "FoldingRangeRegistrationOptions" + }, + "documentation": "A request to provide folding ranges in a document. The request's\nparameter is of type {@link FoldingRangeParams}, the\nresponse is of type {@link FoldingRangeList} or a Thenable\nthat resolves to such." + }, + { + "method": "workspace/foldingRange/refresh", + "result": { + "kind": "base", + "name": "null" + }, + "messageDirection": "serverToClient", + "documentation": "@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "method": "textDocument/declaration", + "result": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "Declaration" + }, + { + "kind": "array", + "element": { + "kind": "reference", + "name": "DeclarationLink" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "DeclarationParams" + }, + "partialResult": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "Location" + } + }, + { + "kind": "array", + "element": { + "kind": "reference", + "name": "DeclarationLink" + } + } + ] + }, + "registrationOptions": { + "kind": "reference", + "name": "DeclarationRegistrationOptions" + }, + "documentation": "A request to resolve the type definition locations of a symbol at a given text\ndocument position. The request's parameter is of type {@link TextDocumentPositionParams}\nthe response is of type {@link Declaration} or a typed array of {@link DeclarationLink}\nor a Thenable that resolves to such." + }, + { + "method": "textDocument/selectionRange", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "SelectionRange" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "SelectionRangeParams" + }, + "partialResult": { + "kind": "array", + "element": { + "kind": "reference", + "name": "SelectionRange" + } + }, + "registrationOptions": { + "kind": "reference", + "name": "SelectionRangeRegistrationOptions" + }, + "documentation": "A request to provide selection ranges in a document. The request's\nparameter is of type {@link SelectionRangeParams}, the\nresponse is of type {@link SelectionRange SelectionRange[]} or a Thenable\nthat resolves to such." + }, + { + "method": "window/workDoneProgress/create", + "result": { + "kind": "base", + "name": "null" + }, + "messageDirection": "serverToClient", + "params": { + "kind": "reference", + "name": "WorkDoneProgressCreateParams" + }, + "documentation": "The `window/workDoneProgress/create` request is sent from the server to the client to initiate progress\nreporting from the server." + }, + { + "method": "textDocument/prepareCallHierarchy", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "CallHierarchyItem" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "CallHierarchyPrepareParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "CallHierarchyRegistrationOptions" + }, + "documentation": "A request to result a `CallHierarchyItem` in a document at a given position.\nCan be used as an input to an incoming or outgoing call hierarchy.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "method": "callHierarchy/incomingCalls", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "CallHierarchyIncomingCall" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "CallHierarchyIncomingCallsParams" + }, + "partialResult": { + "kind": "array", + "element": { + "kind": "reference", + "name": "CallHierarchyIncomingCall" + } + }, + "documentation": "A request to resolve the incoming calls for a given `CallHierarchyItem`.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "method": "callHierarchy/outgoingCalls", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "CallHierarchyOutgoingCall" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "CallHierarchyOutgoingCallsParams" + }, + "partialResult": { + "kind": "array", + "element": { + "kind": "reference", + "name": "CallHierarchyOutgoingCall" + } + }, + "documentation": "A request to resolve the outgoing calls for a given `CallHierarchyItem`.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "method": "textDocument/semanticTokens/full", + "result": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "SemanticTokens" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "SemanticTokensParams" + }, + "partialResult": { + "kind": "reference", + "name": "SemanticTokensPartialResult" + }, + "registrationMethod": "textDocument/semanticTokens", + "registrationOptions": { + "kind": "reference", + "name": "SemanticTokensRegistrationOptions" + }, + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "method": "textDocument/semanticTokens/full/delta", + "result": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "SemanticTokens" + }, + { + "kind": "reference", + "name": "SemanticTokensDelta" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "SemanticTokensDeltaParams" + }, + "partialResult": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "SemanticTokensPartialResult" + }, + { + "kind": "reference", + "name": "SemanticTokensDeltaPartialResult" + } + ] + }, + "registrationMethod": "textDocument/semanticTokens", + "registrationOptions": { + "kind": "reference", + "name": "SemanticTokensRegistrationOptions" + }, + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "method": "textDocument/semanticTokens/range", + "result": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "SemanticTokens" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "SemanticTokensRangeParams" + }, + "partialResult": { + "kind": "reference", + "name": "SemanticTokensPartialResult" + }, + "registrationMethod": "textDocument/semanticTokens", + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "method": "workspace/semanticTokens/refresh", + "result": { + "kind": "base", + "name": "null" + }, + "messageDirection": "serverToClient", + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "method": "window/showDocument", + "result": { + "kind": "reference", + "name": "ShowDocumentResult" + }, + "messageDirection": "serverToClient", + "params": { + "kind": "reference", + "name": "ShowDocumentParams" + }, + "documentation": "A request to show a document. This request might open an\nexternal program depending on the value of the URI to open.\nFor example a request to open `https://code.visualstudio.com/`\nwill very likely open the URI in a WEB browser.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "method": "textDocument/linkedEditingRange", + "result": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "LinkedEditingRanges" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "LinkedEditingRangeParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "LinkedEditingRangeRegistrationOptions" + }, + "documentation": "A request to provide ranges that can be edited together.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "method": "workspace/willCreateFiles", + "result": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "WorkspaceEdit" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "CreateFilesParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "FileOperationRegistrationOptions" + }, + "documentation": "The will create files request is sent from the client to the server before files are actually\ncreated as long as the creation is triggered from within the client.\n\nThe request can return a `WorkspaceEdit` which will be applied to workspace before the\nfiles are created. Hence the `WorkspaceEdit` can not manipulate the content of the file\nto be created.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "method": "workspace/willRenameFiles", + "result": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "WorkspaceEdit" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "RenameFilesParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "FileOperationRegistrationOptions" + }, + "documentation": "The will rename files request is sent from the client to the server before files are actually\nrenamed as long as the rename is triggered from within the client.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "method": "workspace/willDeleteFiles", + "result": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "WorkspaceEdit" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "DeleteFilesParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "FileOperationRegistrationOptions" + }, + "documentation": "The did delete files notification is sent from the client to the server when\nfiles were deleted from within the client.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "method": "textDocument/moniker", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "Moniker" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "MonikerParams" + }, + "partialResult": { + "kind": "array", + "element": { + "kind": "reference", + "name": "Moniker" + } + }, + "registrationOptions": { + "kind": "reference", + "name": "MonikerRegistrationOptions" + }, + "documentation": "A request to get the moniker of a symbol at a given text document position.\nThe request parameter is of type {@link TextDocumentPositionParams}.\nThe response is of type {@link Moniker Moniker[]} or `null`." + }, + { + "method": "textDocument/prepareTypeHierarchy", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "TypeHierarchyItem" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "TypeHierarchyPrepareParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "TypeHierarchyRegistrationOptions" + }, + "documentation": "A request to result a `TypeHierarchyItem` in a document at a given position.\nCan be used as an input to a subtypes or supertypes type hierarchy.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "method": "typeHierarchy/supertypes", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "TypeHierarchyItem" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "TypeHierarchySupertypesParams" + }, + "partialResult": { + "kind": "array", + "element": { + "kind": "reference", + "name": "TypeHierarchyItem" + } + }, + "documentation": "A request to resolve the supertypes for a given `TypeHierarchyItem`.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "method": "typeHierarchy/subtypes", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "TypeHierarchyItem" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "TypeHierarchySubtypesParams" + }, + "partialResult": { + "kind": "array", + "element": { + "kind": "reference", + "name": "TypeHierarchyItem" + } + }, + "documentation": "A request to resolve the subtypes for a given `TypeHierarchyItem`.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "method": "textDocument/inlineValue", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "InlineValue" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "InlineValueParams" + }, + "partialResult": { + "kind": "array", + "element": { + "kind": "reference", + "name": "InlineValue" + } + }, + "registrationOptions": { + "kind": "reference", + "name": "InlineValueRegistrationOptions" + }, + "documentation": "A request to provide inline values in a document. The request's parameter is of\ntype {@link InlineValueParams}, the response is of type\n{@link InlineValue InlineValue[]} or a Thenable that resolves to such.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "method": "workspace/inlineValue/refresh", + "result": { + "kind": "base", + "name": "null" + }, + "messageDirection": "serverToClient", + "documentation": "@since 3.17.0", + "since": "3.17.0" + }, + { + "method": "textDocument/inlayHint", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "InlayHint" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "InlayHintParams" + }, + "partialResult": { + "kind": "array", + "element": { + "kind": "reference", + "name": "InlayHint" + } + }, + "registrationOptions": { + "kind": "reference", + "name": "InlayHintRegistrationOptions" + }, + "documentation": "A request to provide inlay hints in a document. The request's parameter is of\ntype {@link InlayHintsParams}, the response is of type\n{@link InlayHint InlayHint[]} or a Thenable that resolves to such.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "method": "inlayHint/resolve", + "result": { + "kind": "reference", + "name": "InlayHint" + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "InlayHint" + }, + "documentation": "A request to resolve additional properties for an inlay hint.\nThe request's parameter is of type {@link InlayHint}, the response is\nof type {@link InlayHint} or a Thenable that resolves to such.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "method": "workspace/inlayHint/refresh", + "result": { + "kind": "base", + "name": "null" + }, + "messageDirection": "serverToClient", + "documentation": "@since 3.17.0", + "since": "3.17.0" + }, + { + "method": "textDocument/diagnostic", + "result": { + "kind": "reference", + "name": "DocumentDiagnosticReport" + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "DocumentDiagnosticParams" + }, + "partialResult": { + "kind": "reference", + "name": "DocumentDiagnosticReportPartialResult" + }, + "errorData": { + "kind": "reference", + "name": "DiagnosticServerCancellationData" + }, + "registrationOptions": { + "kind": "reference", + "name": "DiagnosticRegistrationOptions" + }, + "documentation": "The document diagnostic request definition.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "method": "workspace/diagnostic", + "result": { + "kind": "reference", + "name": "WorkspaceDiagnosticReport" + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "WorkspaceDiagnosticParams" + }, + "partialResult": { + "kind": "reference", + "name": "WorkspaceDiagnosticReportPartialResult" + }, + "errorData": { + "kind": "reference", + "name": "DiagnosticServerCancellationData" + }, + "documentation": "The workspace diagnostic request definition.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "method": "workspace/diagnostic/refresh", + "result": { + "kind": "base", + "name": "null" + }, + "messageDirection": "serverToClient", + "documentation": "The diagnostic refresh request definition.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "method": "textDocument/inlineCompletion", + "result": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "InlineCompletionList" + }, + { + "kind": "array", + "element": { + "kind": "reference", + "name": "InlineCompletionItem" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "InlineCompletionParams" + }, + "partialResult": { + "kind": "array", + "element": { + "kind": "reference", + "name": "InlineCompletionItem" + } + }, + "registrationOptions": { + "kind": "reference", + "name": "InlineCompletionRegistrationOptions" + }, + "documentation": "A request to provide inline completions in a document. The request's parameter is of\ntype {@link InlineCompletionParams}, the response is of type\n{@link InlineCompletion InlineCompletion[]} or a Thenable that resolves to such.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "method": "client/registerCapability", + "result": { + "kind": "base", + "name": "null" + }, + "messageDirection": "serverToClient", + "params": { + "kind": "reference", + "name": "RegistrationParams" + }, + "documentation": "The `client/registerCapability` request is sent from the server to the client to register a new capability\nhandler on the client side." + }, + { + "method": "client/unregisterCapability", + "result": { + "kind": "base", + "name": "null" + }, + "messageDirection": "serverToClient", + "params": { + "kind": "reference", + "name": "UnregistrationParams" + }, + "documentation": "The `client/unregisterCapability` request is sent from the server to the client to unregister a previously registered capability\nhandler on the client side." + }, + { + "method": "initialize", + "result": { + "kind": "reference", + "name": "InitializeResult" + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "InitializeParams" + }, + "errorData": { + "kind": "reference", + "name": "InitializeError" + }, + "documentation": "The initialize request is sent from the client to the server.\nIt is sent once as the request after starting up the server.\nThe requests parameter is of type {@link InitializeParams}\nthe response if of type {@link InitializeResult} of a Thenable that\nresolves to such." + }, + { + "method": "shutdown", + "result": { + "kind": "base", + "name": "null" + }, + "messageDirection": "clientToServer", + "documentation": "A shutdown request is sent from the client to the server.\nIt is sent once when the client decides to shutdown the\nserver. The only notification that is sent after a shutdown request\nis the exit event." + }, + { + "method": "window/showMessageRequest", + "result": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "MessageActionItem" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "serverToClient", + "params": { + "kind": "reference", + "name": "ShowMessageRequestParams" + }, + "documentation": "The show message request is sent from the server to the client to show a message\nand a set of options actions to the user." + }, + { + "method": "textDocument/willSaveWaitUntil", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "TextEdit" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "WillSaveTextDocumentParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + "documentation": "A document will save request is sent from the client to the server before\nthe document is actually saved. The request can return an array of TextEdits\nwhich will be applied to the text document before it is saved. Please note that\nclients might drop results if computing the text edits took too long or if a\nserver constantly fails on this request. This is done to keep the save fast and\nreliable." + }, + { + "method": "textDocument/completion", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "CompletionItem" + } + }, + { + "kind": "reference", + "name": "CompletionList" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "CompletionParams" + }, + "partialResult": { + "kind": "array", + "element": { + "kind": "reference", + "name": "CompletionItem" + } + }, + "registrationOptions": { + "kind": "reference", + "name": "CompletionRegistrationOptions" + }, + "documentation": "Request to request completion at a given text document position. The request's\nparameter is of type {@link TextDocumentPosition} the response\nis of type {@link CompletionItem CompletionItem[]} or {@link CompletionList}\nor a Thenable that resolves to such.\n\nThe request can delay the computation of the {@link CompletionItem.detail `detail`}\nand {@link CompletionItem.documentation `documentation`} properties to the `completionItem/resolve`\nrequest. However, properties that are needed for the initial sorting and filtering, like `sortText`,\n`filterText`, `insertText`, and `textEdit`, must not be changed during resolve." + }, + { + "method": "completionItem/resolve", + "result": { + "kind": "reference", + "name": "CompletionItem" + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "CompletionItem" + }, + "documentation": "Request to resolve additional information for a given completion item.The request's\nparameter is of type {@link CompletionItem} the response\nis of type {@link CompletionItem} or a Thenable that resolves to such." + }, + { + "method": "textDocument/hover", + "result": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "Hover" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "HoverParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "HoverRegistrationOptions" + }, + "documentation": "Request to request hover information at a given text document position. The request's\nparameter is of type {@link TextDocumentPosition} the response is of\ntype {@link Hover} or a Thenable that resolves to such." + }, + { + "method": "textDocument/signatureHelp", + "result": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "SignatureHelp" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "SignatureHelpParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "SignatureHelpRegistrationOptions" + } + }, + { + "method": "textDocument/definition", + "result": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "Definition" + }, + { + "kind": "array", + "element": { + "kind": "reference", + "name": "DefinitionLink" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "DefinitionParams" + }, + "partialResult": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "Location" + } + }, + { + "kind": "array", + "element": { + "kind": "reference", + "name": "DefinitionLink" + } + } + ] + }, + "registrationOptions": { + "kind": "reference", + "name": "DefinitionRegistrationOptions" + }, + "documentation": "A request to resolve the definition location of a symbol at a given text\ndocument position. The request's parameter is of type {@link TextDocumentPosition}\nthe response is of either type {@link Definition} or a typed array of\n{@link DefinitionLink} or a Thenable that resolves to such." + }, + { + "method": "textDocument/references", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "Location" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "ReferenceParams" + }, + "partialResult": { + "kind": "array", + "element": { + "kind": "reference", + "name": "Location" + } + }, + "registrationOptions": { + "kind": "reference", + "name": "ReferenceRegistrationOptions" + }, + "documentation": "A request to resolve project-wide references for the symbol denoted\nby the given text document position. The request's parameter is of\ntype {@link ReferenceParams} the response is of type\n{@link Location Location[]} or a Thenable that resolves to such." + }, + { + "method": "textDocument/documentHighlight", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "DocumentHighlight" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "DocumentHighlightParams" + }, + "partialResult": { + "kind": "array", + "element": { + "kind": "reference", + "name": "DocumentHighlight" + } + }, + "registrationOptions": { + "kind": "reference", + "name": "DocumentHighlightRegistrationOptions" + }, + "documentation": "Request to resolve a {@link DocumentHighlight} for a given\ntext document position. The request's parameter is of type {@link TextDocumentPosition}\nthe request response is an array of type {@link DocumentHighlight}\nor a Thenable that resolves to such." + }, + { + "method": "textDocument/documentSymbol", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "SymbolInformation" + } + }, + { + "kind": "array", + "element": { + "kind": "reference", + "name": "DocumentSymbol" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "DocumentSymbolParams" + }, + "partialResult": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "SymbolInformation" + } + }, + { + "kind": "array", + "element": { + "kind": "reference", + "name": "DocumentSymbol" + } + } + ] + }, + "registrationOptions": { + "kind": "reference", + "name": "DocumentSymbolRegistrationOptions" + }, + "documentation": "A request to list all symbols found in a given text document. The request's\nparameter is of type {@link TextDocumentIdentifier} the\nresponse is of type {@link SymbolInformation SymbolInformation[]} or a Thenable\nthat resolves to such." + }, + { + "method": "textDocument/codeAction", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "Command" + }, + { + "kind": "reference", + "name": "CodeAction" + } + ] + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "CodeActionParams" + }, + "partialResult": { + "kind": "array", + "element": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "Command" + }, + { + "kind": "reference", + "name": "CodeAction" + } + ] + } + }, + "registrationOptions": { + "kind": "reference", + "name": "CodeActionRegistrationOptions" + }, + "documentation": "A request to provide commands for the given text document and range." + }, + { + "method": "codeAction/resolve", + "result": { + "kind": "reference", + "name": "CodeAction" + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "CodeAction" + }, + "documentation": "Request to resolve additional information for a given code action.The request's\nparameter is of type {@link CodeAction} the response\nis of type {@link CodeAction} or a Thenable that resolves to such." + }, + { + "method": "workspace/symbol", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "SymbolInformation" + } + }, + { + "kind": "array", + "element": { + "kind": "reference", + "name": "WorkspaceSymbol" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "WorkspaceSymbolParams" + }, + "partialResult": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "SymbolInformation" + } + }, + { + "kind": "array", + "element": { + "kind": "reference", + "name": "WorkspaceSymbol" + } + } + ] + }, + "registrationOptions": { + "kind": "reference", + "name": "WorkspaceSymbolRegistrationOptions" + }, + "documentation": "A request to list project-wide symbols matching the query string given\nby the {@link WorkspaceSymbolParams}. The response is\nof type {@link SymbolInformation SymbolInformation[]} or a Thenable that\nresolves to such.\n\n@since 3.17.0 - support for WorkspaceSymbol in the returned data. Clients\n need to advertise support for WorkspaceSymbols via the client capability\n `workspace.symbol.resolveSupport`.\n", + "since": "3.17.0 - support for WorkspaceSymbol in the returned data. Clients\nneed to advertise support for WorkspaceSymbols via the client capability\n`workspace.symbol.resolveSupport`." + }, + { + "method": "workspaceSymbol/resolve", + "result": { + "kind": "reference", + "name": "WorkspaceSymbol" + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "WorkspaceSymbol" + }, + "documentation": "A request to resolve the range inside the workspace\nsymbol's location.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "method": "textDocument/codeLens", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "CodeLens" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "CodeLensParams" + }, + "partialResult": { + "kind": "array", + "element": { + "kind": "reference", + "name": "CodeLens" + } + }, + "registrationOptions": { + "kind": "reference", + "name": "CodeLensRegistrationOptions" + }, + "documentation": "A request to provide code lens for the given text document." + }, + { + "method": "codeLens/resolve", + "result": { + "kind": "reference", + "name": "CodeLens" + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "CodeLens" + }, + "documentation": "A request to resolve a command for a given code lens." + }, + { + "method": "workspace/codeLens/refresh", + "result": { + "kind": "base", + "name": "null" + }, + "messageDirection": "serverToClient", + "documentation": "A request to refresh all code actions\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "method": "textDocument/documentLink", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "DocumentLink" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "DocumentLinkParams" + }, + "partialResult": { + "kind": "array", + "element": { + "kind": "reference", + "name": "DocumentLink" + } + }, + "registrationOptions": { + "kind": "reference", + "name": "DocumentLinkRegistrationOptions" + }, + "documentation": "A request to provide document links" + }, + { + "method": "documentLink/resolve", + "result": { + "kind": "reference", + "name": "DocumentLink" + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "DocumentLink" + }, + "documentation": "Request to resolve additional information for a given document link. The request's\nparameter is of type {@link DocumentLink} the response\nis of type {@link DocumentLink} or a Thenable that resolves to such." + }, + { + "method": "textDocument/formatting", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "TextEdit" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "DocumentFormattingParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "DocumentFormattingRegistrationOptions" + }, + "documentation": "A request to format a whole document." + }, + { + "method": "textDocument/rangeFormatting", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "TextEdit" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "DocumentRangeFormattingParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "DocumentRangeFormattingRegistrationOptions" + }, + "documentation": "A request to format a range in a document." + }, + { + "method": "textDocument/rangesFormatting", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "TextEdit" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "DocumentRangesFormattingParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "DocumentRangeFormattingRegistrationOptions" + }, + "documentation": "A request to format ranges in a document.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "method": "textDocument/onTypeFormatting", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "TextEdit" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "DocumentOnTypeFormattingParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "DocumentOnTypeFormattingRegistrationOptions" + }, + "documentation": "A request to format a document on type." + }, + { + "method": "textDocument/rename", + "result": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "WorkspaceEdit" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "RenameParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "RenameRegistrationOptions" + }, + "documentation": "A request to rename a symbol." + }, + { + "method": "textDocument/prepareRename", + "result": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "PrepareRenameResult" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "PrepareRenameParams" + }, + "documentation": "A request to test and perform the setup necessary for a rename.\n\n@since 3.16 - support for default behavior", + "since": "3.16 - support for default behavior" + }, + { + "method": "workspace/executeCommand", + "result": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "LSPAny" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "ExecuteCommandParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "ExecuteCommandRegistrationOptions" + }, + "documentation": "A request send from the client to the server to execute a command. The request might return\na workspace edit which the client will apply to the workspace." + }, + { + "method": "workspace/applyEdit", + "result": { + "kind": "reference", + "name": "ApplyWorkspaceEditResult" + }, + "messageDirection": "serverToClient", + "params": { + "kind": "reference", + "name": "ApplyWorkspaceEditParams" + }, + "documentation": "A request sent from the server to the client to modified certain resources." + } + ], + "notifications": [ + { + "method": "workspace/didChangeWorkspaceFolders", + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "DidChangeWorkspaceFoldersParams" + }, + "documentation": "The `workspace/didChangeWorkspaceFolders` notification is sent from the client to the server when the workspace\nfolder configuration changes." + }, + { + "method": "window/workDoneProgress/cancel", + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "WorkDoneProgressCancelParams" + }, + "documentation": "The `window/workDoneProgress/cancel` notification is sent from the client to the server to cancel a progress\ninitiated on the server side." + }, + { + "method": "workspace/didCreateFiles", + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "CreateFilesParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "FileOperationRegistrationOptions" + }, + "documentation": "The did create files notification is sent from the client to the server when\nfiles were created from within the client.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "method": "workspace/didRenameFiles", + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "RenameFilesParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "FileOperationRegistrationOptions" + }, + "documentation": "The did rename files notification is sent from the client to the server when\nfiles were renamed from within the client.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "method": "workspace/didDeleteFiles", + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "DeleteFilesParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "FileOperationRegistrationOptions" + }, + "documentation": "The will delete files request is sent from the client to the server before files are actually\ndeleted as long as the deletion is triggered from within the client.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "method": "notebookDocument/didOpen", + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "DidOpenNotebookDocumentParams" + }, + "registrationMethod": "notebookDocument/sync", + "documentation": "A notification sent when a notebook opens.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "method": "notebookDocument/didChange", + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "DidChangeNotebookDocumentParams" + }, + "registrationMethod": "notebookDocument/sync" + }, + { + "method": "notebookDocument/didSave", + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "DidSaveNotebookDocumentParams" + }, + "registrationMethod": "notebookDocument/sync", + "documentation": "A notification sent when a notebook document is saved.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "method": "notebookDocument/didClose", + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "DidCloseNotebookDocumentParams" + }, + "registrationMethod": "notebookDocument/sync", + "documentation": "A notification sent when a notebook closes.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "method": "initialized", + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "InitializedParams" + }, + "documentation": "The initialized notification is sent from the client to the\nserver after the client is fully initialized and the server\nis allowed to send requests from the server to the client." + }, + { + "method": "exit", + "messageDirection": "clientToServer", + "documentation": "The exit event is sent from the client to the server to\nask the server to exit its process." + }, + { + "method": "workspace/didChangeConfiguration", + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "DidChangeConfigurationParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "DidChangeConfigurationRegistrationOptions" + }, + "documentation": "The configuration change notification is sent from the client to the server\nwhen the client's configuration has changed. The notification contains\nthe changed configuration as defined by the language client." + }, + { + "method": "window/showMessage", + "messageDirection": "serverToClient", + "params": { + "kind": "reference", + "name": "ShowMessageParams" + }, + "documentation": "The show message notification is sent from a server to a client to ask\nthe client to display a particular message in the user interface." + }, + { + "method": "window/logMessage", + "messageDirection": "serverToClient", + "params": { + "kind": "reference", + "name": "LogMessageParams" + }, + "documentation": "The log message notification is sent from the server to the client to ask\nthe client to log a particular message." + }, + { + "method": "telemetry/event", + "messageDirection": "serverToClient", + "params": { + "kind": "reference", + "name": "LSPAny" + }, + "documentation": "The telemetry event notification is sent from the server to the client to ask\nthe client to log telemetry data." + }, + { + "method": "textDocument/didOpen", + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "DidOpenTextDocumentParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + "documentation": "The document open notification is sent from the client to the server to signal\nnewly opened text documents. The document's truth is now managed by the client\nand the server must not try to read the document's truth using the document's\nuri. Open in this sense means it is managed by the client. It doesn't necessarily\nmean that its content is presented in an editor. An open notification must not\nbe sent more than once without a corresponding close notification send before.\nThis means open and close notification must be balanced and the max open count\nis one." + }, + { + "method": "textDocument/didChange", + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "DidChangeTextDocumentParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "TextDocumentChangeRegistrationOptions" + }, + "documentation": "The document change notification is sent from the client to the server to signal\nchanges to a text document." + }, + { + "method": "textDocument/didClose", + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "DidCloseTextDocumentParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + "documentation": "The document close notification is sent from the client to the server when\nthe document got closed in the client. The document's truth now exists where\nthe document's uri points to (e.g. if the document's uri is a file uri the\ntruth now exists on disk). As with the open notification the close notification\nis about managing the document's content. Receiving a close notification\ndoesn't mean that the document was open in an editor before. A close\nnotification requires a previous open notification to be sent." + }, + { + "method": "textDocument/didSave", + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "DidSaveTextDocumentParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "TextDocumentSaveRegistrationOptions" + }, + "documentation": "The document save notification is sent from the client to the server when\nthe document got saved in the client." + }, + { + "method": "textDocument/willSave", + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "WillSaveTextDocumentParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + "documentation": "A document will save notification is sent from the client to the server before\nthe document is actually saved." + }, + { + "method": "workspace/didChangeWatchedFiles", + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "DidChangeWatchedFilesParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "DidChangeWatchedFilesRegistrationOptions" + }, + "documentation": "The watched files notification is sent from the client to the server when\nthe client detects changes to file watched by the language client." + }, + { + "method": "textDocument/publishDiagnostics", + "messageDirection": "serverToClient", + "params": { + "kind": "reference", + "name": "PublishDiagnosticsParams" + }, + "documentation": "Diagnostics notification are sent from the server to the client to signal\nresults of validation runs." + }, + { + "method": "$/setTrace", + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "SetTraceParams" + } + }, + { + "method": "$/logTrace", + "messageDirection": "serverToClient", + "params": { + "kind": "reference", + "name": "LogTraceParams" + } + }, + { + "method": "$/cancelRequest", + "messageDirection": "both", + "params": { + "kind": "reference", + "name": "CancelParams" + } + }, + { + "method": "$/progress", + "messageDirection": "both", + "params": { + "kind": "reference", + "name": "ProgressParams" + } + } + ], + "structures": [ + { + "name": "ImplementationParams", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentPositionParams" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ] + }, + { + "name": "Location", + "properties": [ + { + "name": "uri", + "type": { + "kind": "base", + "name": "DocumentUri" + } + }, + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + } + } + ], + "documentation": "Represents a location inside a resource, such as a line\ninside a text file." + }, + { + "name": "ImplementationRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "ImplementationOptions" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "StaticRegistrationOptions" + } + ] + }, + { + "name": "TypeDefinitionParams", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentPositionParams" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ] + }, + { + "name": "TypeDefinitionRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "TypeDefinitionOptions" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "StaticRegistrationOptions" + } + ] + }, + { + "name": "WorkspaceFolder", + "properties": [ + { + "name": "uri", + "type": { + "kind": "base", + "name": "URI" + }, + "documentation": "The associated URI for this workspace folder." + }, + { + "name": "name", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The name of the workspace folder. Used to refer to this\nworkspace folder in the user interface." + } + ], + "documentation": "A workspace folder inside a client." + }, + { + "name": "DidChangeWorkspaceFoldersParams", + "properties": [ + { + "name": "event", + "type": { + "kind": "reference", + "name": "WorkspaceFoldersChangeEvent" + }, + "documentation": "The actual workspace folder change event." + } + ], + "documentation": "The parameters of a `workspace/didChangeWorkspaceFolders` notification." + }, + { + "name": "ConfigurationParams", + "properties": [ + { + "name": "items", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "ConfigurationItem" + } + } + } + ], + "documentation": "The parameters of a configuration request." + }, + { + "name": "DocumentColorParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The text document." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "Parameters for a {@link DocumentColorRequest}." + }, + { + "name": "ColorInformation", + "properties": [ + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range in the document where this color appears." + }, + { + "name": "color", + "type": { + "kind": "reference", + "name": "Color" + }, + "documentation": "The actual color value for this color range." + } + ], + "documentation": "Represents a color range from a document." + }, + { + "name": "DocumentColorRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "DocumentColorOptions" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "StaticRegistrationOptions" + } + ] + }, + { + "name": "ColorPresentationParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The text document." + }, + { + "name": "color", + "type": { + "kind": "reference", + "name": "Color" + }, + "documentation": "The color to request presentations for." + }, + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range where the color would be inserted. Serves as a context." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "Parameters for a {@link ColorPresentationRequest}." + }, + { + "name": "ColorPresentation", + "properties": [ + { + "name": "label", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The label of this color presentation. It will be shown on the color\npicker header. By default this is also the text that is inserted when selecting\nthis color presentation." + }, + { + "name": "textEdit", + "type": { + "kind": "reference", + "name": "TextEdit" + }, + "optional": true, + "documentation": "An {@link TextEdit edit} which is applied to a document when selecting\nthis presentation for the color. When `falsy` the {@link ColorPresentation.label label}\nis used." + }, + { + "name": "additionalTextEdits", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "TextEdit" + } + }, + "optional": true, + "documentation": "An optional array of additional {@link TextEdit text edits} that are applied when\nselecting this color presentation. Edits must not overlap with the main {@link ColorPresentation.textEdit edit} nor with themselves." + } + ] + }, + { + "name": "WorkDoneProgressOptions", + "properties": [ + { + "name": "workDoneProgress", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true + } + ] + }, + { + "name": "TextDocumentRegistrationOptions", + "properties": [ + { + "name": "documentSelector", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "DocumentSelector" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "documentation": "A document selector to identify the scope of the registration. If set to null\nthe document selector provided on the client side will be used." + } + ], + "documentation": "General text document registration options." + }, + { + "name": "FoldingRangeParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The text document." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "Parameters for a {@link FoldingRangeRequest}." + }, + { + "name": "FoldingRange", + "properties": [ + { + "name": "startLine", + "type": { + "kind": "base", + "name": "uinteger" + }, + "documentation": "The zero-based start line of the range to fold. The folded area starts after the line's last character.\nTo be valid, the end must be zero or larger and smaller than the number of lines in the document." + }, + { + "name": "startCharacter", + "type": { + "kind": "base", + "name": "uinteger" + }, + "optional": true, + "documentation": "The zero-based character offset from where the folded range starts. If not defined, defaults to the length of the start line." + }, + { + "name": "endLine", + "type": { + "kind": "base", + "name": "uinteger" + }, + "documentation": "The zero-based end line of the range to fold. The folded area ends with the line's last character.\nTo be valid, the end must be zero or larger and smaller than the number of lines in the document." + }, + { + "name": "endCharacter", + "type": { + "kind": "base", + "name": "uinteger" + }, + "optional": true, + "documentation": "The zero-based character offset before the folded range ends. If not defined, defaults to the length of the end line." + }, + { + "name": "kind", + "type": { + "kind": "reference", + "name": "FoldingRangeKind" + }, + "optional": true, + "documentation": "Describes the kind of the folding range such as `comment' or 'region'. The kind\nis used to categorize folding ranges and used by commands like 'Fold all comments'.\nSee {@link FoldingRangeKind} for an enumeration of standardized kinds." + }, + { + "name": "collapsedText", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The text that the client should show when the specified range is\ncollapsed. If not defined or not supported by the client, a default\nwill be chosen by the client.\n\n@since 3.17.0", + "since": "3.17.0" + } + ], + "documentation": "Represents a folding range. To be valid, start and end line must be bigger than zero and smaller\nthan the number of lines in the document. Clients are free to ignore invalid ranges." + }, + { + "name": "FoldingRangeRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "FoldingRangeOptions" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "StaticRegistrationOptions" + } + ] + }, + { + "name": "DeclarationParams", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentPositionParams" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ] + }, + { + "name": "DeclarationRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "DeclarationOptions" + }, + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "StaticRegistrationOptions" + } + ] + }, + { + "name": "SelectionRangeParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The text document." + }, + { + "name": "positions", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "Position" + } + }, + "documentation": "The positions inside the text document." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "A parameter literal used in selection range requests." + }, + { + "name": "SelectionRange", + "properties": [ + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The {@link Range range} of this selection range." + }, + { + "name": "parent", + "type": { + "kind": "reference", + "name": "SelectionRange" + }, + "optional": true, + "documentation": "The parent selection range containing this range. Therefore `parent.range` must contain `this.range`." + } + ], + "documentation": "A selection range represents a part of a selection hierarchy. A selection range\nmay have a parent selection range that contains it." + }, + { + "name": "SelectionRangeRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "SelectionRangeOptions" + }, + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "StaticRegistrationOptions" + } + ] + }, + { + "name": "WorkDoneProgressCreateParams", + "properties": [ + { + "name": "token", + "type": { + "kind": "reference", + "name": "ProgressToken" + }, + "documentation": "The token to be used to report progress." + } + ] + }, + { + "name": "WorkDoneProgressCancelParams", + "properties": [ + { + "name": "token", + "type": { + "kind": "reference", + "name": "ProgressToken" + }, + "documentation": "The token to be used to report progress." + } + ] + }, + { + "name": "CallHierarchyPrepareParams", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentPositionParams" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + } + ], + "documentation": "The parameter of a `textDocument/prepareCallHierarchy` request.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "CallHierarchyItem", + "properties": [ + { + "name": "name", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The name of this item." + }, + { + "name": "kind", + "type": { + "kind": "reference", + "name": "SymbolKind" + }, + "documentation": "The kind of this item." + }, + { + "name": "tags", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "SymbolTag" + } + }, + "optional": true, + "documentation": "Tags for this item." + }, + { + "name": "detail", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "More detail for this item, e.g. the signature of a function." + }, + { + "name": "uri", + "type": { + "kind": "base", + "name": "DocumentUri" + }, + "documentation": "The resource identifier of this item." + }, + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range enclosing this symbol not including leading/trailing whitespace but everything else, e.g. comments and code." + }, + { + "name": "selectionRange", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range that should be selected and revealed when this symbol is being picked, e.g. the name of a function.\nMust be contained by the {@link CallHierarchyItem.range `range`}." + }, + { + "name": "data", + "type": { + "kind": "reference", + "name": "LSPAny" + }, + "optional": true, + "documentation": "A data entry field that is preserved between a call hierarchy prepare and\nincoming calls or outgoing calls requests." + } + ], + "documentation": "Represents programming constructs like functions or constructors in the context\nof call hierarchy.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "CallHierarchyRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "CallHierarchyOptions" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "StaticRegistrationOptions" + } + ], + "documentation": "Call hierarchy options used during static or dynamic registration.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "CallHierarchyIncomingCallsParams", + "properties": [ + { + "name": "item", + "type": { + "kind": "reference", + "name": "CallHierarchyItem" + } + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "The parameter of a `callHierarchy/incomingCalls` request.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "CallHierarchyIncomingCall", + "properties": [ + { + "name": "from", + "type": { + "kind": "reference", + "name": "CallHierarchyItem" + }, + "documentation": "The item that makes the call." + }, + { + "name": "fromRanges", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "Range" + } + }, + "documentation": "The ranges at which the calls appear. This is relative to the caller\ndenoted by {@link CallHierarchyIncomingCall.from `this.from`}." + } + ], + "documentation": "Represents an incoming call, e.g. a caller of a method or constructor.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "CallHierarchyOutgoingCallsParams", + "properties": [ + { + "name": "item", + "type": { + "kind": "reference", + "name": "CallHierarchyItem" + } + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "The parameter of a `callHierarchy/outgoingCalls` request.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "CallHierarchyOutgoingCall", + "properties": [ + { + "name": "to", + "type": { + "kind": "reference", + "name": "CallHierarchyItem" + }, + "documentation": "The item that is called." + }, + { + "name": "fromRanges", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "Range" + } + }, + "documentation": "The range at which this item is called. This is the range relative to the caller, e.g the item\npassed to {@link CallHierarchyItemProvider.provideCallHierarchyOutgoingCalls `provideCallHierarchyOutgoingCalls`}\nand not {@link CallHierarchyOutgoingCall.to `this.to`}." + } + ], + "documentation": "Represents an outgoing call, e.g. calling a getter from a method or a method from a constructor etc.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "SemanticTokensParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The text document." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "SemanticTokens", + "properties": [ + { + "name": "resultId", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "An optional result id. If provided and clients support delta updating\nthe client will include the result id in the next semantic token request.\nA server can then instead of computing all semantic tokens again simply\nsend a delta." + }, + { + "name": "data", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "uinteger" + } + }, + "documentation": "The actual tokens." + } + ], + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "SemanticTokensPartialResult", + "properties": [ + { + "name": "data", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "uinteger" + } + } + } + ], + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "SemanticTokensRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "SemanticTokensOptions" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "StaticRegistrationOptions" + } + ], + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "SemanticTokensDeltaParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The text document." + }, + { + "name": "previousResultId", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The result id of a previous response. The result Id can either point to a full response\nor a delta response depending on what was received last." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "SemanticTokensDelta", + "properties": [ + { + "name": "resultId", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true + }, + { + "name": "edits", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "SemanticTokensEdit" + } + }, + "documentation": "The semantic token edits to transform a previous result into a new result." + } + ], + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "SemanticTokensDeltaPartialResult", + "properties": [ + { + "name": "edits", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "SemanticTokensEdit" + } + } + } + ], + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "SemanticTokensRangeParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The text document." + }, + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range the semantic tokens are requested for." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "ShowDocumentParams", + "properties": [ + { + "name": "uri", + "type": { + "kind": "base", + "name": "URI" + }, + "documentation": "The uri to show." + }, + { + "name": "external", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Indicates to show the resource in an external program.\nTo show, for example, `https://code.visualstudio.com/`\nin the default WEB browser set `external` to `true`." + }, + { + "name": "takeFocus", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "An optional property to indicate whether the editor\nshowing the document should take focus or not.\nClients might ignore this property if an external\nprogram is started." + }, + { + "name": "selection", + "type": { + "kind": "reference", + "name": "Range" + }, + "optional": true, + "documentation": "An optional selection range if the document is a text\ndocument. Clients might ignore the property if an\nexternal program is started or the file is not a text\nfile." + } + ], + "documentation": "Params to show a resource in the UI.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "ShowDocumentResult", + "properties": [ + { + "name": "success", + "type": { + "kind": "base", + "name": "boolean" + }, + "documentation": "A boolean indicating if the show was successful." + } + ], + "documentation": "The result of a showDocument request.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "LinkedEditingRangeParams", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentPositionParams" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + } + ] + }, + { + "name": "LinkedEditingRanges", + "properties": [ + { + "name": "ranges", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "Range" + } + }, + "documentation": "A list of ranges that can be edited together. The ranges must have\nidentical length and contain identical text content. The ranges cannot overlap." + }, + { + "name": "wordPattern", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "An optional word pattern (regular expression) that describes valid contents for\nthe given ranges. If no pattern is provided, the client configuration's word\npattern will be used." + } + ], + "documentation": "The result of a linked editing range request.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "LinkedEditingRangeRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "LinkedEditingRangeOptions" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "StaticRegistrationOptions" + } + ] + }, + { + "name": "CreateFilesParams", + "properties": [ + { + "name": "files", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "FileCreate" + } + }, + "documentation": "An array of all files/folders created in this operation." + } + ], + "documentation": "The parameters sent in notifications/requests for user-initiated creation of\nfiles.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "WorkspaceEdit", + "properties": [ + { + "name": "changes", + "type": { + "kind": "map", + "key": { + "kind": "base", + "name": "DocumentUri" + }, + "value": { + "kind": "array", + "element": { + "kind": "reference", + "name": "TextEdit" + } + } + }, + "optional": true, + "documentation": "Holds changes to existing resources." + }, + { + "name": "documentChanges", + "type": { + "kind": "array", + "element": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "TextDocumentEdit" + }, + { + "kind": "reference", + "name": "CreateFile" + }, + { + "kind": "reference", + "name": "RenameFile" + }, + { + "kind": "reference", + "name": "DeleteFile" + } + ] + } + }, + "optional": true, + "documentation": "Depending on the client capability `workspace.workspaceEdit.resourceOperations` document changes\nare either an array of `TextDocumentEdit`s to express changes to n different text documents\nwhere each text document edit addresses a specific version of a text document. Or it can contain\nabove `TextDocumentEdit`s mixed with create, rename and delete file / folder operations.\n\nWhether a client supports versioned document edits is expressed via\n`workspace.workspaceEdit.documentChanges` client capability.\n\nIf a client neither supports `documentChanges` nor `workspace.workspaceEdit.resourceOperations` then\nonly plain `TextEdit`s using the `changes` property are supported." + }, + { + "name": "changeAnnotations", + "type": { + "kind": "map", + "key": { + "kind": "reference", + "name": "ChangeAnnotationIdentifier" + }, + "value": { + "kind": "reference", + "name": "ChangeAnnotation" + } + }, + "optional": true, + "documentation": "A map of change annotations that can be referenced in `AnnotatedTextEdit`s or create, rename and\ndelete file / folder operations.\n\nWhether clients honor this property depends on the client capability `workspace.changeAnnotationSupport`.\n\n@since 3.16.0", + "since": "3.16.0" + } + ], + "documentation": "A workspace edit represents changes to many resources managed in the workspace. The edit\nshould either provide `changes` or `documentChanges`. If documentChanges are present\nthey are preferred over `changes` if the client can handle versioned document edits.\n\nSince version 3.13.0 a workspace edit can contain resource operations as well. If resource\noperations are present clients need to execute the operations in the order in which they\nare provided. So a workspace edit for example can consist of the following two changes:\n(1) a create file a.txt and (2) a text document edit which insert text into file a.txt.\n\nAn invalid sequence (e.g. (1) delete file a.txt and (2) insert text into file a.txt) will\ncause failure of the operation. How the client recovers from the failure is described by\nthe client capability: `workspace.workspaceEdit.failureHandling`" + }, + { + "name": "FileOperationRegistrationOptions", + "properties": [ + { + "name": "filters", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "FileOperationFilter" + } + }, + "documentation": "The actual filters." + } + ], + "documentation": "The options to register for file operations.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "RenameFilesParams", + "properties": [ + { + "name": "files", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "FileRename" + } + }, + "documentation": "An array of all files/folders renamed in this operation. When a folder is renamed, only\nthe folder will be included, and not its children." + } + ], + "documentation": "The parameters sent in notifications/requests for user-initiated renames of\nfiles.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "DeleteFilesParams", + "properties": [ + { + "name": "files", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "FileDelete" + } + }, + "documentation": "An array of all files/folders deleted in this operation." + } + ], + "documentation": "The parameters sent in notifications/requests for user-initiated deletes of\nfiles.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "MonikerParams", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentPositionParams" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ] + }, + { + "name": "Moniker", + "properties": [ + { + "name": "scheme", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The scheme of the moniker. For example tsc or .Net" + }, + { + "name": "identifier", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The identifier of the moniker. The value is opaque in LSIF however\nschema owners are allowed to define the structure if they want." + }, + { + "name": "unique", + "type": { + "kind": "reference", + "name": "UniquenessLevel" + }, + "documentation": "The scope in which the moniker is unique" + }, + { + "name": "kind", + "type": { + "kind": "reference", + "name": "MonikerKind" + }, + "optional": true, + "documentation": "The moniker kind if known." + } + ], + "documentation": "Moniker definition to match LSIF 0.5 moniker definition.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "MonikerRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "MonikerOptions" + } + ] + }, + { + "name": "TypeHierarchyPrepareParams", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentPositionParams" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + } + ], + "documentation": "The parameter of a `textDocument/prepareTypeHierarchy` request.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "TypeHierarchyItem", + "properties": [ + { + "name": "name", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The name of this item." + }, + { + "name": "kind", + "type": { + "kind": "reference", + "name": "SymbolKind" + }, + "documentation": "The kind of this item." + }, + { + "name": "tags", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "SymbolTag" + } + }, + "optional": true, + "documentation": "Tags for this item." + }, + { + "name": "detail", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "More detail for this item, e.g. the signature of a function." + }, + { + "name": "uri", + "type": { + "kind": "base", + "name": "DocumentUri" + }, + "documentation": "The resource identifier of this item." + }, + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range enclosing this symbol not including leading/trailing whitespace\nbut everything else, e.g. comments and code." + }, + { + "name": "selectionRange", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range that should be selected and revealed when this symbol is being\npicked, e.g. the name of a function. Must be contained by the\n{@link TypeHierarchyItem.range `range`}." + }, + { + "name": "data", + "type": { + "kind": "reference", + "name": "LSPAny" + }, + "optional": true, + "documentation": "A data entry field that is preserved between a type hierarchy prepare and\nsupertypes or subtypes requests. It could also be used to identify the\ntype hierarchy in the server, helping improve the performance on\nresolving supertypes and subtypes." + } + ], + "documentation": "@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "TypeHierarchyRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "TypeHierarchyOptions" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "StaticRegistrationOptions" + } + ], + "documentation": "Type hierarchy options used during static or dynamic registration.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "TypeHierarchySupertypesParams", + "properties": [ + { + "name": "item", + "type": { + "kind": "reference", + "name": "TypeHierarchyItem" + } + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "The parameter of a `typeHierarchy/supertypes` request.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "TypeHierarchySubtypesParams", + "properties": [ + { + "name": "item", + "type": { + "kind": "reference", + "name": "TypeHierarchyItem" + } + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "The parameter of a `typeHierarchy/subtypes` request.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "InlineValueParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The text document." + }, + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The document range for which inline values should be computed." + }, + { + "name": "context", + "type": { + "kind": "reference", + "name": "InlineValueContext" + }, + "documentation": "Additional information about the context in which inline values were\nrequested." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + } + ], + "documentation": "A parameter literal used in inline value requests.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "InlineValueRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "InlineValueOptions" + }, + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "StaticRegistrationOptions" + } + ], + "documentation": "Inline value options used during static or dynamic registration.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "InlayHintParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The text document." + }, + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The document range for which inlay hints should be computed." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + } + ], + "documentation": "A parameter literal used in inlay hint requests.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "InlayHint", + "properties": [ + { + "name": "position", + "type": { + "kind": "reference", + "name": "Position" + }, + "documentation": "The position of this hint.\n\nIf multiple hints have the same position, they will be shown in the order\nthey appear in the response." + }, + { + "name": "label", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "string" + }, + { + "kind": "array", + "element": { + "kind": "reference", + "name": "InlayHintLabelPart" + } + } + ] + }, + "documentation": "The label of this hint. A human readable string or an array of\nInlayHintLabelPart label parts.\n\n*Note* that neither the string nor the label part can be empty." + }, + { + "name": "kind", + "type": { + "kind": "reference", + "name": "InlayHintKind" + }, + "optional": true, + "documentation": "The kind of this hint. Can be omitted in which case the client\nshould fall back to a reasonable default." + }, + { + "name": "textEdits", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "TextEdit" + } + }, + "optional": true, + "documentation": "Optional text edits that are performed when accepting this inlay hint.\n\n*Note* that edits are expected to change the document so that the inlay\nhint (or its nearest variant) is now part of the document and the inlay\nhint itself is now obsolete." + }, + { + "name": "tooltip", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "string" + }, + { + "kind": "reference", + "name": "MarkupContent" + } + ] + }, + "optional": true, + "documentation": "The tooltip text when you hover over this item." + }, + { + "name": "paddingLeft", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Render padding before the hint.\n\nNote: Padding should use the editor's background color, not the\nbackground color of the hint itself. That means padding can be used\nto visually align/separate an inlay hint." + }, + { + "name": "paddingRight", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Render padding after the hint.\n\nNote: Padding should use the editor's background color, not the\nbackground color of the hint itself. That means padding can be used\nto visually align/separate an inlay hint." + }, + { + "name": "data", + "type": { + "kind": "reference", + "name": "LSPAny" + }, + "optional": true, + "documentation": "A data entry field that is preserved on an inlay hint between\na `textDocument/inlayHint` and a `inlayHint/resolve` request." + } + ], + "documentation": "Inlay hint information.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "InlayHintRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "InlayHintOptions" + }, + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "StaticRegistrationOptions" + } + ], + "documentation": "Inlay hint options used during static or dynamic registration.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "DocumentDiagnosticParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The text document." + }, + { + "name": "identifier", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The additional identifier provided during registration." + }, + { + "name": "previousResultId", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The result id of a previous response if provided." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "Parameters of the document diagnostic request.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "DocumentDiagnosticReportPartialResult", + "properties": [ + { + "name": "relatedDocuments", + "type": { + "kind": "map", + "key": { + "kind": "base", + "name": "DocumentUri" + }, + "value": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "FullDocumentDiagnosticReport" + }, + { + "kind": "reference", + "name": "UnchangedDocumentDiagnosticReport" + } + ] + } + } + } + ], + "documentation": "A partial result for a document diagnostic report.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "DiagnosticServerCancellationData", + "properties": [ + { + "name": "retriggerRequest", + "type": { + "kind": "base", + "name": "boolean" + } + } + ], + "documentation": "Cancellation data returned from a diagnostic request.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "DiagnosticRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "DiagnosticOptions" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "StaticRegistrationOptions" + } + ], + "documentation": "Diagnostic registration options.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "WorkspaceDiagnosticParams", + "properties": [ + { + "name": "identifier", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The additional identifier provided during registration." + }, + { + "name": "previousResultIds", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "PreviousResultId" + } + }, + "documentation": "The currently known diagnostic reports with their\nprevious result ids." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "Parameters of the workspace diagnostic request.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "WorkspaceDiagnosticReport", + "properties": [ + { + "name": "items", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "WorkspaceDocumentDiagnosticReport" + } + } + } + ], + "documentation": "A workspace diagnostic report.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "WorkspaceDiagnosticReportPartialResult", + "properties": [ + { + "name": "items", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "WorkspaceDocumentDiagnosticReport" + } + } + } + ], + "documentation": "A partial result for a workspace diagnostic report.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "DidOpenNotebookDocumentParams", + "properties": [ + { + "name": "notebookDocument", + "type": { + "kind": "reference", + "name": "NotebookDocument" + }, + "documentation": "The notebook document that got opened." + }, + { + "name": "cellTextDocuments", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "TextDocumentItem" + } + }, + "documentation": "The text documents that represent the content\nof a notebook cell." + } + ], + "documentation": "The params sent in an open notebook document notification.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "DidChangeNotebookDocumentParams", + "properties": [ + { + "name": "notebookDocument", + "type": { + "kind": "reference", + "name": "VersionedNotebookDocumentIdentifier" + }, + "documentation": "The notebook document that did change. The version number points\nto the version after all provided changes have been applied. If\nonly the text document content of a cell changes the notebook version\ndoesn't necessarily have to change." + }, + { + "name": "change", + "type": { + "kind": "reference", + "name": "NotebookDocumentChangeEvent" + }, + "documentation": "The actual changes to the notebook document.\n\nThe changes describe single state changes to the notebook document.\nSo if there are two changes c1 (at array index 0) and c2 (at array\nindex 1) for a notebook in state S then c1 moves the notebook from\nS to S' and c2 from S' to S''. So c1 is computed on the state S and\nc2 is computed on the state S'.\n\nTo mirror the content of a notebook using change events use the following approach:\n- start with the same initial content\n- apply the 'notebookDocument/didChange' notifications in the order you receive them.\n- apply the `NotebookChangeEvent`s in a single notification in the order\n you receive them." + } + ], + "documentation": "The params sent in a change notebook document notification.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "DidSaveNotebookDocumentParams", + "properties": [ + { + "name": "notebookDocument", + "type": { + "kind": "reference", + "name": "NotebookDocumentIdentifier" + }, + "documentation": "The notebook document that got saved." + } + ], + "documentation": "The params sent in a save notebook document notification.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "DidCloseNotebookDocumentParams", + "properties": [ + { + "name": "notebookDocument", + "type": { + "kind": "reference", + "name": "NotebookDocumentIdentifier" + }, + "documentation": "The notebook document that got closed." + }, + { + "name": "cellTextDocuments", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "TextDocumentIdentifier" + } + }, + "documentation": "The text documents that represent the content\nof a notebook cell that got closed." + } + ], + "documentation": "The params sent in a close notebook document notification.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "InlineCompletionParams", + "properties": [ + { + "name": "context", + "type": { + "kind": "reference", + "name": "InlineCompletionContext" + }, + "documentation": "Additional information about the context in which inline completions were\nrequested." + } + ], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentPositionParams" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + } + ], + "documentation": "A parameter literal used in inline completion requests.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "InlineCompletionList", + "properties": [ + { + "name": "items", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "InlineCompletionItem" + } + }, + "documentation": "The inline completion items" + } + ], + "documentation": "Represents a collection of {@link InlineCompletionItem inline completion items} to be presented in the editor.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "InlineCompletionItem", + "properties": [ + { + "name": "insertText", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "string" + }, + { + "kind": "reference", + "name": "StringValue" + } + ] + }, + "documentation": "The text to replace the range with. Must be set." + }, + { + "name": "filterText", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A text that is used to decide if this inline completion should be shown. When `falsy` the {@link InlineCompletionItem.insertText} is used." + }, + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "optional": true, + "documentation": "The range to replace. Must begin and end on the same line." + }, + { + "name": "command", + "type": { + "kind": "reference", + "name": "Command" + }, + "optional": true, + "documentation": "An optional {@link Command} that is executed *after* inserting this completion." + } + ], + "documentation": "An inline completion item represents a text snippet that is proposed inline to complete text that is being typed.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "InlineCompletionRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "InlineCompletionOptions" + }, + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "StaticRegistrationOptions" + } + ], + "documentation": "Inline completion options used during static or dynamic registration.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "RegistrationParams", + "properties": [ + { + "name": "registrations", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "Registration" + } + } + } + ] + }, + { + "name": "UnregistrationParams", + "properties": [ + { + "name": "unregisterations", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "Unregistration" + } + } + } + ] + }, + { + "name": "InitializeParams", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "_InitializeParams" + }, + { + "kind": "reference", + "name": "WorkspaceFoldersInitializeParams" + } + ] + }, + { + "name": "InitializeResult", + "properties": [ + { + "name": "capabilities", + "type": { + "kind": "reference", + "name": "ServerCapabilities" + }, + "documentation": "The capabilities the language server provides." + }, + { + "name": "serverInfo", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "name", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The name of the server as defined by the server." + }, + { + "name": "version", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The server's version as defined by the server." + } + ] + } + }, + "optional": true, + "documentation": "Information about the server.\n\n@since 3.15.0", + "since": "3.15.0" + } + ], + "documentation": "The result returned from an initialize request." + }, + { + "name": "InitializeError", + "properties": [ + { + "name": "retry", + "type": { + "kind": "base", + "name": "boolean" + }, + "documentation": "Indicates whether the client execute the following retry logic:\n(1) show the message provided by the ResponseError to the user\n(2) user selects retry or cancel\n(3) if user selected retry the initialize method is sent again." + } + ], + "documentation": "The data type of the ResponseError if the\ninitialize request fails." + }, + { + "name": "InitializedParams", + "properties": [] + }, + { + "name": "DidChangeConfigurationParams", + "properties": [ + { + "name": "settings", + "type": { + "kind": "reference", + "name": "LSPAny" + }, + "documentation": "The actual changed settings" + } + ], + "documentation": "The parameters of a change configuration notification." + }, + { + "name": "DidChangeConfigurationRegistrationOptions", + "properties": [ + { + "name": "section", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "string" + }, + { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + } + ] + }, + "optional": true + } + ] + }, + { + "name": "ShowMessageParams", + "properties": [ + { + "name": "type", + "type": { + "kind": "reference", + "name": "MessageType" + }, + "documentation": "The message type. See {@link MessageType}" + }, + { + "name": "message", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The actual message." + } + ], + "documentation": "The parameters of a notification message." + }, + { + "name": "ShowMessageRequestParams", + "properties": [ + { + "name": "type", + "type": { + "kind": "reference", + "name": "MessageType" + }, + "documentation": "The message type. See {@link MessageType}" + }, + { + "name": "message", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The actual message." + }, + { + "name": "actions", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "MessageActionItem" + } + }, + "optional": true, + "documentation": "The message action items to present." + } + ] + }, + { + "name": "MessageActionItem", + "properties": [ + { + "name": "title", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A short title like 'Retry', 'Open Log' etc." + } + ] + }, + { + "name": "LogMessageParams", + "properties": [ + { + "name": "type", + "type": { + "kind": "reference", + "name": "MessageType" + }, + "documentation": "The message type. See {@link MessageType}" + }, + { + "name": "message", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The actual message." + } + ], + "documentation": "The log message parameters." + }, + { + "name": "DidOpenTextDocumentParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentItem" + }, + "documentation": "The document that was opened." + } + ], + "documentation": "The parameters sent in an open text document notification" + }, + { + "name": "DidChangeTextDocumentParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "VersionedTextDocumentIdentifier" + }, + "documentation": "The document that did change. The version number points\nto the version after all provided content changes have\nbeen applied." + }, + { + "name": "contentChanges", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "TextDocumentContentChangeEvent" + } + }, + "documentation": "The actual content changes. The content changes describe single state changes\nto the document. So if there are two content changes c1 (at array index 0) and\nc2 (at array index 1) for a document in state S then c1 moves the document from\nS to S' and c2 from S' to S''. So c1 is computed on the state S and c2 is computed\non the state S'.\n\nTo mirror the content of a document using change events use the following approach:\n- start with the same initial content\n- apply the 'textDocument/didChange' notifications in the order you receive them.\n- apply the `TextDocumentContentChangeEvent`s in a single notification in the order\n you receive them." + } + ], + "documentation": "The change text document notification's parameters." + }, + { + "name": "TextDocumentChangeRegistrationOptions", + "properties": [ + { + "name": "syncKind", + "type": { + "kind": "reference", + "name": "TextDocumentSyncKind" + }, + "documentation": "How documents are synced to the server." + } + ], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + } + ], + "documentation": "Describe options to be used when registered for text document change events." + }, + { + "name": "DidCloseTextDocumentParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The document that was closed." + } + ], + "documentation": "The parameters sent in a close text document notification" + }, + { + "name": "DidSaveTextDocumentParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The document that was saved." + }, + { + "name": "text", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "Optional the content when saved. Depends on the includeText value\nwhen the save notification was requested." + } + ], + "documentation": "The parameters sent in a save text document notification" + }, + { + "name": "TextDocumentSaveRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "SaveOptions" + } + ], + "documentation": "Save registration options." + }, + { + "name": "WillSaveTextDocumentParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The document that will be saved." + }, + { + "name": "reason", + "type": { + "kind": "reference", + "name": "TextDocumentSaveReason" + }, + "documentation": "The 'TextDocumentSaveReason'." + } + ], + "documentation": "The parameters sent in a will save text document notification." + }, + { + "name": "TextEdit", + "properties": [ + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range of the text document to be manipulated. To insert\ntext into a document create a range where start === end." + }, + { + "name": "newText", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The string to be inserted. For delete operations use an\nempty string." + } + ], + "documentation": "A text edit applicable to a text document." + }, + { + "name": "DidChangeWatchedFilesParams", + "properties": [ + { + "name": "changes", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "FileEvent" + } + }, + "documentation": "The actual file events." + } + ], + "documentation": "The watched files change notification's parameters." + }, + { + "name": "DidChangeWatchedFilesRegistrationOptions", + "properties": [ + { + "name": "watchers", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "FileSystemWatcher" + } + }, + "documentation": "The watchers to register." + } + ], + "documentation": "Describe options to be used when registered for text document change events." + }, + { + "name": "PublishDiagnosticsParams", + "properties": [ + { + "name": "uri", + "type": { + "kind": "base", + "name": "DocumentUri" + }, + "documentation": "The URI for which diagnostic information is reported." + }, + { + "name": "version", + "type": { + "kind": "base", + "name": "integer" + }, + "optional": true, + "documentation": "Optional the version number of the document the diagnostics are published for.\n\n@since 3.15.0", + "since": "3.15.0" + }, + { + "name": "diagnostics", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "Diagnostic" + } + }, + "documentation": "An array of diagnostic information items." + } + ], + "documentation": "The publish diagnostic notification's parameters." + }, + { + "name": "CompletionParams", + "properties": [ + { + "name": "context", + "type": { + "kind": "reference", + "name": "CompletionContext" + }, + "optional": true, + "documentation": "The completion context. This is only available it the client specifies\nto send this using the client capability `textDocument.completion.contextSupport === true`" + } + ], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentPositionParams" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "Completion parameters" + }, + { + "name": "CompletionItem", + "properties": [ + { + "name": "label", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The label of this completion item.\n\nThe label property is also by default the text that\nis inserted when selecting this completion.\n\nIf label details are provided the label itself should\nbe an unqualified name of the completion item." + }, + { + "name": "labelDetails", + "type": { + "kind": "reference", + "name": "CompletionItemLabelDetails" + }, + "optional": true, + "documentation": "Additional details for the label\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "kind", + "type": { + "kind": "reference", + "name": "CompletionItemKind" + }, + "optional": true, + "documentation": "The kind of this completion item. Based of the kind\nan icon is chosen by the editor." + }, + { + "name": "tags", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "CompletionItemTag" + } + }, + "optional": true, + "documentation": "Tags for this completion item.\n\n@since 3.15.0", + "since": "3.15.0" + }, + { + "name": "detail", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A human-readable string with additional information\nabout this item, like type or symbol information." + }, + { + "name": "documentation", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "string" + }, + { + "kind": "reference", + "name": "MarkupContent" + } + ] + }, + "optional": true, + "documentation": "A human-readable string that represents a doc-comment." + }, + { + "name": "deprecated", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Indicates if this item is deprecated.\n@deprecated Use `tags` instead.", + "deprecated": "Use `tags` instead." + }, + { + "name": "preselect", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Select this item when showing.\n\n*Note* that only one completion item can be selected and that the\ntool / client decides which item that is. The rule is that the *first*\nitem of those that match best is selected." + }, + { + "name": "sortText", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A string that should be used when comparing this item\nwith other items. When `falsy` the {@link CompletionItem.label label}\nis used." + }, + { + "name": "filterText", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A string that should be used when filtering a set of\ncompletion items. When `falsy` the {@link CompletionItem.label label}\nis used." + }, + { + "name": "insertText", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A string that should be inserted into a document when selecting\nthis completion. When `falsy` the {@link CompletionItem.label label}\nis used.\n\nThe `insertText` is subject to interpretation by the client side.\nSome tools might not take the string literally. For example\nVS Code when code complete is requested in this example\n`con` and a completion item with an `insertText` of\n`console` is provided it will only insert `sole`. Therefore it is\nrecommended to use `textEdit` instead since it avoids additional client\nside interpretation." + }, + { + "name": "insertTextFormat", + "type": { + "kind": "reference", + "name": "InsertTextFormat" + }, + "optional": true, + "documentation": "The format of the insert text. The format applies to both the\n`insertText` property and the `newText` property of a provided\n`textEdit`. If omitted defaults to `InsertTextFormat.PlainText`.\n\nPlease note that the insertTextFormat doesn't apply to\n`additionalTextEdits`." + }, + { + "name": "insertTextMode", + "type": { + "kind": "reference", + "name": "InsertTextMode" + }, + "optional": true, + "documentation": "How whitespace and indentation is handled during completion\nitem insertion. If not provided the clients default value depends on\nthe `textDocument.completion.insertTextMode` client capability.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "textEdit", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "TextEdit" + }, + { + "kind": "reference", + "name": "InsertReplaceEdit" + } + ] + }, + "optional": true, + "documentation": "An {@link TextEdit edit} which is applied to a document when selecting\nthis completion. When an edit is provided the value of\n{@link CompletionItem.insertText insertText} is ignored.\n\nMost editors support two different operations when accepting a completion\nitem. One is to insert a completion text and the other is to replace an\nexisting text with a completion text. Since this can usually not be\npredetermined by a server it can report both ranges. Clients need to\nsignal support for `InsertReplaceEdits` via the\n`textDocument.completion.insertReplaceSupport` client capability\nproperty.\n\n*Note 1:* The text edit's range as well as both ranges from an insert\nreplace edit must be a [single line] and they must contain the position\nat which completion has been requested.\n*Note 2:* If an `InsertReplaceEdit` is returned the edit's insert range\nmust be a prefix of the edit's replace range, that means it must be\ncontained and starting at the same position.\n\n@since 3.16.0 additional type `InsertReplaceEdit`", + "since": "3.16.0 additional type `InsertReplaceEdit`" + }, + { + "name": "textEditText", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The edit text used if the completion item is part of a CompletionList and\nCompletionList defines an item default for the text edit range.\n\nClients will only honor this property if they opt into completion list\nitem defaults using the capability `completionList.itemDefaults`.\n\nIf not provided and a list's default range is provided the label\nproperty is used as a text.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "additionalTextEdits", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "TextEdit" + } + }, + "optional": true, + "documentation": "An optional array of additional {@link TextEdit text edits} that are applied when\nselecting this completion. Edits must not overlap (including the same insert position)\nwith the main {@link CompletionItem.textEdit edit} nor with themselves.\n\nAdditional text edits should be used to change text unrelated to the current cursor position\n(for example adding an import statement at the top of the file if the completion item will\ninsert an unqualified type)." + }, + { + "name": "commitCharacters", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "optional": true, + "documentation": "An optional set of characters that when pressed while this completion is active will accept it first and\nthen type that character. *Note* that all commit characters should have `length=1` and that superfluous\ncharacters will be ignored." + }, + { + "name": "command", + "type": { + "kind": "reference", + "name": "Command" + }, + "optional": true, + "documentation": "An optional {@link Command command} that is executed *after* inserting this completion. *Note* that\nadditional modifications to the current document should be described with the\n{@link CompletionItem.additionalTextEdits additionalTextEdits}-property." + }, + { + "name": "data", + "type": { + "kind": "reference", + "name": "LSPAny" + }, + "optional": true, + "documentation": "A data entry field that is preserved on a completion item between a\n{@link CompletionRequest} and a {@link CompletionResolveRequest}." + } + ], + "documentation": "A completion item represents a text snippet that is\nproposed to complete text that is being typed." + }, + { + "name": "CompletionList", + "properties": [ + { + "name": "isIncomplete", + "type": { + "kind": "base", + "name": "boolean" + }, + "documentation": "This list it not complete. Further typing results in recomputing this list.\n\nRecomputed lists have all their items replaced (not appended) in the\nincomplete completion sessions." + }, + { + "name": "itemDefaults", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "commitCharacters", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "optional": true, + "documentation": "A default commit character set.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "editRange", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "Range" + }, + { + "kind": "literal", + "value": { + "properties": [ + { + "name": "insert", + "type": { + "kind": "reference", + "name": "Range" + } + }, + { + "name": "replace", + "type": { + "kind": "reference", + "name": "Range" + } + } + ] + } + } + ] + }, + "optional": true, + "documentation": "A default edit range.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "insertTextFormat", + "type": { + "kind": "reference", + "name": "InsertTextFormat" + }, + "optional": true, + "documentation": "A default insert text format.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "insertTextMode", + "type": { + "kind": "reference", + "name": "InsertTextMode" + }, + "optional": true, + "documentation": "A default insert text mode.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "data", + "type": { + "kind": "reference", + "name": "LSPAny" + }, + "optional": true, + "documentation": "A default data value.\n\n@since 3.17.0", + "since": "3.17.0" + } + ] + } + }, + "optional": true, + "documentation": "In many cases the items of an actual completion result share the same\nvalue for properties like `commitCharacters` or the range of a text\nedit. A completion list can therefore define item defaults which will\nbe used if a completion item itself doesn't specify the value.\n\nIf a completion list specifies a default value and a completion item\nalso specifies a corresponding value the one from the item is used.\n\nServers are only allowed to return default values if the client\nsignals support for this via the `completionList.itemDefaults`\ncapability.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "items", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "CompletionItem" + } + }, + "documentation": "The completion items." + } + ], + "documentation": "Represents a collection of {@link CompletionItem completion items} to be presented\nin the editor." + }, + { + "name": "CompletionRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "CompletionOptions" + } + ], + "documentation": "Registration options for a {@link CompletionRequest}." + }, + { + "name": "HoverParams", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentPositionParams" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + } + ], + "documentation": "Parameters for a {@link HoverRequest}." + }, + { + "name": "Hover", + "properties": [ + { + "name": "contents", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "MarkupContent" + }, + { + "kind": "reference", + "name": "MarkedString" + }, + { + "kind": "array", + "element": { + "kind": "reference", + "name": "MarkedString" + } + } + ] + }, + "documentation": "The hover's content" + }, + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "optional": true, + "documentation": "An optional range inside the text document that is used to\nvisualize the hover, e.g. by changing the background color." + } + ], + "documentation": "The result of a hover request." + }, + { + "name": "HoverRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "HoverOptions" + } + ], + "documentation": "Registration options for a {@link HoverRequest}." + }, + { + "name": "SignatureHelpParams", + "properties": [ + { + "name": "context", + "type": { + "kind": "reference", + "name": "SignatureHelpContext" + }, + "optional": true, + "documentation": "The signature help context. This is only available if the client specifies\nto send this using the client capability `textDocument.signatureHelp.contextSupport === true`\n\n@since 3.15.0", + "since": "3.15.0" + } + ], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentPositionParams" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + } + ], + "documentation": "Parameters for a {@link SignatureHelpRequest}." + }, + { + "name": "SignatureHelp", + "properties": [ + { + "name": "signatures", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "SignatureInformation" + } + }, + "documentation": "One or more signatures." + }, + { + "name": "activeSignature", + "type": { + "kind": "base", + "name": "uinteger" + }, + "optional": true, + "documentation": "The active signature. If omitted or the value lies outside the\nrange of `signatures` the value defaults to zero or is ignored if\nthe `SignatureHelp` has no signatures.\n\nWhenever possible implementors should make an active decision about\nthe active signature and shouldn't rely on a default value.\n\nIn future version of the protocol this property might become\nmandatory to better express this." + }, + { + "name": "activeParameter", + "type": { + "kind": "base", + "name": "uinteger" + }, + "optional": true, + "documentation": "The active parameter of the active signature. If omitted or the value\nlies outside the range of `signatures[activeSignature].parameters`\ndefaults to 0 if the active signature has parameters. If\nthe active signature has no parameters it is ignored.\nIn future version of the protocol this property might become\nmandatory to better express the active parameter if the\nactive signature does have any." + } + ], + "documentation": "Signature help represents the signature of something\ncallable. There can be multiple signature but only one\nactive and only one active parameter." + }, + { + "name": "SignatureHelpRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "SignatureHelpOptions" + } + ], + "documentation": "Registration options for a {@link SignatureHelpRequest}." + }, + { + "name": "DefinitionParams", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentPositionParams" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "Parameters for a {@link DefinitionRequest}." + }, + { + "name": "DefinitionRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "DefinitionOptions" + } + ], + "documentation": "Registration options for a {@link DefinitionRequest}." + }, + { + "name": "ReferenceParams", + "properties": [ + { + "name": "context", + "type": { + "kind": "reference", + "name": "ReferenceContext" + } + } + ], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentPositionParams" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "Parameters for a {@link ReferencesRequest}." + }, + { + "name": "ReferenceRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "ReferenceOptions" + } + ], + "documentation": "Registration options for a {@link ReferencesRequest}." + }, + { + "name": "DocumentHighlightParams", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentPositionParams" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "Parameters for a {@link DocumentHighlightRequest}." + }, + { + "name": "DocumentHighlight", + "properties": [ + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range this highlight applies to." + }, + { + "name": "kind", + "type": { + "kind": "reference", + "name": "DocumentHighlightKind" + }, + "optional": true, + "documentation": "The highlight kind, default is {@link DocumentHighlightKind.Text text}." + } + ], + "documentation": "A document highlight is a range inside a text document which deserves\nspecial attention. Usually a document highlight is visualized by changing\nthe background color of its range." + }, + { + "name": "DocumentHighlightRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "DocumentHighlightOptions" + } + ], + "documentation": "Registration options for a {@link DocumentHighlightRequest}." + }, + { + "name": "DocumentSymbolParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The text document." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "Parameters for a {@link DocumentSymbolRequest}." + }, + { + "name": "SymbolInformation", + "properties": [ + { + "name": "deprecated", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Indicates if this symbol is deprecated.\n\n@deprecated Use tags instead", + "deprecated": "Use tags instead" + }, + { + "name": "location", + "type": { + "kind": "reference", + "name": "Location" + }, + "documentation": "The location of this symbol. The location's range is used by a tool\nto reveal the location in the editor. If the symbol is selected in the\ntool the range's start information is used to position the cursor. So\nthe range usually spans more than the actual symbol's name and does\nnormally include things like visibility modifiers.\n\nThe range doesn't have to denote a node range in the sense of an abstract\nsyntax tree. It can therefore not be used to re-construct a hierarchy of\nthe symbols." + } + ], + "extends": [ + { + "kind": "reference", + "name": "BaseSymbolInformation" + } + ], + "documentation": "Represents information about programming constructs like variables, classes,\ninterfaces etc." + }, + { + "name": "DocumentSymbol", + "properties": [ + { + "name": "name", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The name of this symbol. Will be displayed in the user interface and therefore must not be\nan empty string or a string only consisting of white spaces." + }, + { + "name": "detail", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "More detail for this symbol, e.g the signature of a function." + }, + { + "name": "kind", + "type": { + "kind": "reference", + "name": "SymbolKind" + }, + "documentation": "The kind of this symbol." + }, + { + "name": "tags", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "SymbolTag" + } + }, + "optional": true, + "documentation": "Tags for this document symbol.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "deprecated", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Indicates if this symbol is deprecated.\n\n@deprecated Use tags instead", + "deprecated": "Use tags instead" + }, + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range enclosing this symbol not including leading/trailing whitespace but everything else\nlike comments. This information is typically used to determine if the clients cursor is\ninside the symbol to reveal in the symbol in the UI." + }, + { + "name": "selectionRange", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range that should be selected and revealed when this symbol is being picked, e.g the name of a function.\nMust be contained by the `range`." + }, + { + "name": "children", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "DocumentSymbol" + } + }, + "optional": true, + "documentation": "Children of this symbol, e.g. properties of a class." + } + ], + "documentation": "Represents programming constructs like variables, classes, interfaces etc.\nthat appear in a document. Document symbols can be hierarchical and they\nhave two ranges: one that encloses its definition and one that points to\nits most interesting range, e.g. the range of an identifier." + }, + { + "name": "DocumentSymbolRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "DocumentSymbolOptions" + } + ], + "documentation": "Registration options for a {@link DocumentSymbolRequest}." + }, + { + "name": "CodeActionParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The document in which the command was invoked." + }, + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range for which the command was invoked." + }, + { + "name": "context", + "type": { + "kind": "reference", + "name": "CodeActionContext" + }, + "documentation": "Context carrying additional information." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "The parameters of a {@link CodeActionRequest}." + }, + { + "name": "Command", + "properties": [ + { + "name": "title", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "Title of the command, like `save`." + }, + { + "name": "command", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The identifier of the actual command handler." + }, + { + "name": "arguments", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "LSPAny" + } + }, + "optional": true, + "documentation": "Arguments that the command handler should be\ninvoked with." + } + ], + "documentation": "Represents a reference to a command. Provides a title which\nwill be used to represent a command in the UI and, optionally,\nan array of arguments which will be passed to the command handler\nfunction when invoked." + }, + { + "name": "CodeAction", + "properties": [ + { + "name": "title", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A short, human-readable, title for this code action." + }, + { + "name": "kind", + "type": { + "kind": "reference", + "name": "CodeActionKind" + }, + "optional": true, + "documentation": "The kind of the code action.\n\nUsed to filter code actions." + }, + { + "name": "diagnostics", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "Diagnostic" + } + }, + "optional": true, + "documentation": "The diagnostics that this code action resolves." + }, + { + "name": "isPreferred", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Marks this as a preferred action. Preferred actions are used by the `auto fix` command and can be targeted\nby keybindings.\n\nA quick fix should be marked preferred if it properly addresses the underlying error.\nA refactoring should be marked preferred if it is the most reasonable choice of actions to take.\n\n@since 3.15.0", + "since": "3.15.0" + }, + { + "name": "disabled", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "reason", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "Human readable description of why the code action is currently disabled.\n\nThis is displayed in the code actions UI." + } + ] + } + }, + "optional": true, + "documentation": "Marks that the code action cannot currently be applied.\n\nClients should follow the following guidelines regarding disabled code actions:\n\n - Disabled code actions are not shown in automatic [lightbulbs](https://code.visualstudio.com/docs/editor/editingevolved#_code-action)\n code action menus.\n\n - Disabled actions are shown as faded out in the code action menu when the user requests a more specific type\n of code action, such as refactorings.\n\n - If the user has a [keybinding](https://code.visualstudio.com/docs/editor/refactoring#_keybindings-for-code-actions)\n that auto applies a code action and only disabled code actions are returned, the client should show the user an\n error message with `reason` in the editor.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "edit", + "type": { + "kind": "reference", + "name": "WorkspaceEdit" + }, + "optional": true, + "documentation": "The workspace edit this code action performs." + }, + { + "name": "command", + "type": { + "kind": "reference", + "name": "Command" + }, + "optional": true, + "documentation": "A command this code action executes. If a code action\nprovides an edit and a command, first the edit is\nexecuted and then the command." + }, + { + "name": "data", + "type": { + "kind": "reference", + "name": "LSPAny" + }, + "optional": true, + "documentation": "A data entry field that is preserved on a code action between\na `textDocument/codeAction` and a `codeAction/resolve` request.\n\n@since 3.16.0", + "since": "3.16.0" + } + ], + "documentation": "A code action represents a change that can be performed in code, e.g. to fix a problem or\nto refactor code.\n\nA CodeAction must set either `edit` and/or a `command`. If both are supplied, the `edit` is applied first, then the `command` is executed." + }, + { + "name": "CodeActionRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "CodeActionOptions" + } + ], + "documentation": "Registration options for a {@link CodeActionRequest}." + }, + { + "name": "WorkspaceSymbolParams", + "properties": [ + { + "name": "query", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A query string to filter symbols by. Clients may send an empty\nstring here to request all symbols." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "The parameters of a {@link WorkspaceSymbolRequest}." + }, + { + "name": "WorkspaceSymbol", + "properties": [ + { + "name": "location", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "Location" + }, + { + "kind": "literal", + "value": { + "properties": [ + { + "name": "uri", + "type": { + "kind": "base", + "name": "DocumentUri" + } + } + ] + } + } + ] + }, + "documentation": "The location of the symbol. Whether a server is allowed to\nreturn a location without a range depends on the client\ncapability `workspace.symbol.resolveSupport`.\n\nSee SymbolInformation#location for more details." + }, + { + "name": "data", + "type": { + "kind": "reference", + "name": "LSPAny" + }, + "optional": true, + "documentation": "A data entry field that is preserved on a workspace symbol between a\nworkspace symbol request and a workspace symbol resolve request." + } + ], + "extends": [ + { + "kind": "reference", + "name": "BaseSymbolInformation" + } + ], + "documentation": "A special workspace symbol that supports locations without a range.\n\nSee also SymbolInformation.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "WorkspaceSymbolRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "WorkspaceSymbolOptions" + } + ], + "documentation": "Registration options for a {@link WorkspaceSymbolRequest}." + }, + { + "name": "CodeLensParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The document to request code lens for." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "The parameters of a {@link CodeLensRequest}." + }, + { + "name": "CodeLens", + "properties": [ + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range in which this code lens is valid. Should only span a single line." + }, + { + "name": "command", + "type": { + "kind": "reference", + "name": "Command" + }, + "optional": true, + "documentation": "The command this code lens represents." + }, + { + "name": "data", + "type": { + "kind": "reference", + "name": "LSPAny" + }, + "optional": true, + "documentation": "A data entry field that is preserved on a code lens item between\na {@link CodeLensRequest} and a {@link CodeLensResolveRequest}" + } + ], + "documentation": "A code lens represents a {@link Command command} that should be shown along with\nsource text, like the number of references, a way to run tests, etc.\n\nA code lens is _unresolved_ when no command is associated to it. For performance\nreasons the creation of a code lens and resolving should be done in two stages." + }, + { + "name": "CodeLensRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "CodeLensOptions" + } + ], + "documentation": "Registration options for a {@link CodeLensRequest}." + }, + { + "name": "DocumentLinkParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The document to provide document links for." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "The parameters of a {@link DocumentLinkRequest}." + }, + { + "name": "DocumentLink", + "properties": [ + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range this link applies to." + }, + { + "name": "target", + "type": { + "kind": "base", + "name": "URI" + }, + "optional": true, + "documentation": "The uri this link points to. If missing a resolve request is sent later." + }, + { + "name": "tooltip", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The tooltip text when you hover over this link.\n\nIf a tooltip is provided, is will be displayed in a string that includes instructions on how to\ntrigger the link, such as `{0} (ctrl + click)`. The specific instructions vary depending on OS,\nuser settings, and localization.\n\n@since 3.15.0", + "since": "3.15.0" + }, + { + "name": "data", + "type": { + "kind": "reference", + "name": "LSPAny" + }, + "optional": true, + "documentation": "A data entry field that is preserved on a document link between a\nDocumentLinkRequest and a DocumentLinkResolveRequest." + } + ], + "documentation": "A document link is a range in a text document that links to an internal or external resource, like another\ntext document or a web site." + }, + { + "name": "DocumentLinkRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "DocumentLinkOptions" + } + ], + "documentation": "Registration options for a {@link DocumentLinkRequest}." + }, + { + "name": "DocumentFormattingParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The document to format." + }, + { + "name": "options", + "type": { + "kind": "reference", + "name": "FormattingOptions" + }, + "documentation": "The format options." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + } + ], + "documentation": "The parameters of a {@link DocumentFormattingRequest}." + }, + { + "name": "DocumentFormattingRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "DocumentFormattingOptions" + } + ], + "documentation": "Registration options for a {@link DocumentFormattingRequest}." + }, + { + "name": "DocumentRangeFormattingParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The document to format." + }, + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range to format" + }, + { + "name": "options", + "type": { + "kind": "reference", + "name": "FormattingOptions" + }, + "documentation": "The format options" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + } + ], + "documentation": "The parameters of a {@link DocumentRangeFormattingRequest}." + }, + { + "name": "DocumentRangeFormattingRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "DocumentRangeFormattingOptions" + } + ], + "documentation": "Registration options for a {@link DocumentRangeFormattingRequest}." + }, + { + "name": "DocumentRangesFormattingParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The document to format." + }, + { + "name": "ranges", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "Range" + } + }, + "documentation": "The ranges to format" + }, + { + "name": "options", + "type": { + "kind": "reference", + "name": "FormattingOptions" + }, + "documentation": "The format options" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + } + ], + "documentation": "The parameters of a {@link DocumentRangesFormattingRequest}.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "DocumentOnTypeFormattingParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The document to format." + }, + { + "name": "position", + "type": { + "kind": "reference", + "name": "Position" + }, + "documentation": "The position around which the on type formatting should happen.\nThis is not necessarily the exact position where the character denoted\nby the property `ch` got typed." + }, + { + "name": "ch", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The character that has been typed that triggered the formatting\non type request. That is not necessarily the last character that\ngot inserted into the document since the client could auto insert\ncharacters as well (e.g. like automatic brace completion)." + }, + { + "name": "options", + "type": { + "kind": "reference", + "name": "FormattingOptions" + }, + "documentation": "The formatting options." + } + ], + "documentation": "The parameters of a {@link DocumentOnTypeFormattingRequest}." + }, + { + "name": "DocumentOnTypeFormattingRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "DocumentOnTypeFormattingOptions" + } + ], + "documentation": "Registration options for a {@link DocumentOnTypeFormattingRequest}." + }, + { + "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": { + "kind": "base", + "name": "string" + }, + "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." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + } + ], + "documentation": "The parameters of a {@link RenameRequest}." + }, + { + "name": "RenameRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "RenameOptions" + } + ], + "documentation": "Registration options for a {@link RenameRequest}." + }, + { + "name": "PrepareRenameParams", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentPositionParams" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + } + ] + }, + { + "name": "ExecuteCommandParams", + "properties": [ + { + "name": "command", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The identifier of the actual command handler." + }, + { + "name": "arguments", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "LSPAny" + } + }, + "optional": true, + "documentation": "Arguments that the command should be invoked with." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + } + ], + "documentation": "The parameters of a {@link ExecuteCommandRequest}." + }, + { + "name": "ExecuteCommandRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "ExecuteCommandOptions" + } + ], + "documentation": "Registration options for a {@link ExecuteCommandRequest}." + }, + { + "name": "ApplyWorkspaceEditParams", + "properties": [ + { + "name": "label", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "An optional label of the workspace edit. This label is\npresented in the user interface for example on an undo\nstack to undo the workspace edit." + }, + { + "name": "edit", + "type": { + "kind": "reference", + "name": "WorkspaceEdit" + }, + "documentation": "The edits to apply." + } + ], + "documentation": "The parameters passed via an apply workspace edit request." + }, + { + "name": "ApplyWorkspaceEditResult", + "properties": [ + { + "name": "applied", + "type": { + "kind": "base", + "name": "boolean" + }, + "documentation": "Indicates whether the edit was applied or not." + }, + { + "name": "failureReason", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "An optional textual description for why the edit was not applied.\nThis may be used by the server for diagnostic logging or to provide\na suitable error for a request that triggered the edit." + }, + { + "name": "failedChange", + "type": { + "kind": "base", + "name": "uinteger" + }, + "optional": true, + "documentation": "Depending on the client's failure handling strategy `failedChange` might\ncontain the index of the change that failed. This property is only available\nif the client signals a `failureHandlingStrategy` in its client capabilities." + } + ], + "documentation": "The result returned from the apply workspace edit request.\n\n@since 3.17 renamed from ApplyWorkspaceEditResponse", + "since": "3.17 renamed from ApplyWorkspaceEditResponse" + }, + { + "name": "WorkDoneProgressBegin", + "properties": [ + { + "name": "kind", + "type": { + "kind": "stringLiteral", + "value": "begin" + } + }, + { + "name": "title", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "Mandatory title of the progress operation. Used to briefly inform about\nthe kind of operation being performed.\n\nExamples: \"Indexing\" or \"Linking dependencies\"." + }, + { + "name": "cancellable", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Controls if a cancel button should show to allow the user to cancel the\nlong running operation. Clients that don't support cancellation are allowed\nto ignore the setting." + }, + { + "name": "message", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "Optional, more detailed associated progress message. Contains\ncomplementary information to the `title`.\n\nExamples: \"3/25 files\", \"project/src/module2\", \"node_modules/some_dep\".\nIf unset, the previous progress message (if any) is still valid." + }, + { + "name": "percentage", + "type": { + "kind": "base", + "name": "uinteger" + }, + "optional": true, + "documentation": "Optional progress percentage to display (value 100 is considered 100%).\nIf not provided infinite progress is assumed and clients are allowed\nto ignore the `percentage` value in subsequent in report notifications.\n\nThe value should be steadily rising. Clients are free to ignore values\nthat are not following this rule. The value range is [0, 100]." + } + ] + }, + { + "name": "WorkDoneProgressReport", + "properties": [ + { + "name": "kind", + "type": { + "kind": "stringLiteral", + "value": "report" + } + }, + { + "name": "cancellable", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Controls enablement state of a cancel button.\n\nClients that don't support cancellation or don't support controlling the button's\nenablement state are allowed to ignore the property." + }, + { + "name": "message", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "Optional, more detailed associated progress message. Contains\ncomplementary information to the `title`.\n\nExamples: \"3/25 files\", \"project/src/module2\", \"node_modules/some_dep\".\nIf unset, the previous progress message (if any) is still valid." + }, + { + "name": "percentage", + "type": { + "kind": "base", + "name": "uinteger" + }, + "optional": true, + "documentation": "Optional progress percentage to display (value 100 is considered 100%).\nIf not provided infinite progress is assumed and clients are allowed\nto ignore the `percentage` value in subsequent in report notifications.\n\nThe value should be steadily rising. Clients are free to ignore values\nthat are not following this rule. The value range is [0, 100]" + } + ] + }, + { + "name": "WorkDoneProgressEnd", + "properties": [ + { + "name": "kind", + "type": { + "kind": "stringLiteral", + "value": "end" + } + }, + { + "name": "message", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "Optional, a final message indicating to for example indicate the outcome\nof the operation." + } + ] + }, + { + "name": "SetTraceParams", + "properties": [ + { + "name": "value", + "type": { + "kind": "reference", + "name": "TraceValues" + } + } + ] + }, + { + "name": "LogTraceParams", + "properties": [ + { + "name": "message", + "type": { + "kind": "base", + "name": "string" + } + }, + { + "name": "verbose", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true + } + ] + }, + { + "name": "CancelParams", + "properties": [ + { + "name": "id", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "integer" + }, + { + "kind": "base", + "name": "string" + } + ] + }, + "documentation": "The request id to cancel." + } + ] + }, + { + "name": "ProgressParams", + "properties": [ + { + "name": "token", + "type": { + "kind": "reference", + "name": "ProgressToken" + }, + "documentation": "The progress token provided by the client or server." + }, + { + "name": "value", + "type": { + "kind": "reference", + "name": "LSPAny" + }, + "documentation": "The progress data." + } + ] + }, + { + "name": "TextDocumentPositionParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The text document." + }, + { + "name": "position", + "type": { + "kind": "reference", + "name": "Position" + }, + "documentation": "The position inside the text document." + } + ], + "documentation": "A parameter literal used in requests to pass a text document and a position inside that\ndocument." + }, + { + "name": "WorkDoneProgressParams", + "properties": [ + { + "name": "workDoneToken", + "type": { + "kind": "reference", + "name": "ProgressToken" + }, + "optional": true, + "documentation": "An optional token that a server can use to report work done progress." + } + ] + }, + { + "name": "PartialResultParams", + "properties": [ + { + "name": "partialResultToken", + "type": { + "kind": "reference", + "name": "ProgressToken" + }, + "optional": true, + "documentation": "An optional token that a server can use to report partial results (e.g. streaming) to\nthe client." + } + ] + }, + { + "name": "LocationLink", + "properties": [ + { + "name": "originSelectionRange", + "type": { + "kind": "reference", + "name": "Range" + }, + "optional": true, + "documentation": "Span of the origin of this link.\n\nUsed as the underlined span for mouse interaction. Defaults to the word range at\nthe definition position." + }, + { + "name": "targetUri", + "type": { + "kind": "base", + "name": "DocumentUri" + }, + "documentation": "The target resource identifier of this link." + }, + { + "name": "targetRange", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The full target range of this link. If the target for example is a symbol then target range is the\nrange enclosing this symbol not including leading/trailing whitespace but everything else\nlike comments. This information is typically used to highlight the range in the editor." + }, + { + "name": "targetSelectionRange", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range that should be selected and revealed when this link is being followed, e.g the name of a function.\nMust be contained by the `targetRange`. See also `DocumentSymbol#range`" + } + ], + "documentation": "Represents the connection of two locations. Provides additional metadata over normal {@link Location locations},\nincluding an origin range." + }, + { + "name": "Range", + "properties": [ + { + "name": "start", + "type": { + "kind": "reference", + "name": "Position" + }, + "documentation": "The range's start position." + }, + { + "name": "end", + "type": { + "kind": "reference", + "name": "Position" + }, + "documentation": "The range's end position." + } + ], + "documentation": "A range in a text document expressed as (zero-based) start and end positions.\n\nIf you want to specify a range that contains a line including the line ending\ncharacter(s) then use an end position denoting the start of the next line.\nFor example:\n```ts\n{\n start: { line: 5, character: 23 }\n end : { line 6, character : 0 }\n}\n```" + }, + { + "name": "ImplementationOptions", + "properties": [], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ] + }, + { + "name": "StaticRegistrationOptions", + "properties": [ + { + "name": "id", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The id used to register the request. The id can be used to deregister\nthe request again. See also Registration#id." + } + ], + "documentation": "Static registration options to be returned in the initialize\nrequest." + }, + { + "name": "TypeDefinitionOptions", + "properties": [], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ] + }, + { + "name": "WorkspaceFoldersChangeEvent", + "properties": [ + { + "name": "added", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "WorkspaceFolder" + } + }, + "documentation": "The array of added workspace folders" + }, + { + "name": "removed", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "WorkspaceFolder" + } + }, + "documentation": "The array of the removed workspace folders" + } + ], + "documentation": "The workspace folder change event." + }, + { + "name": "ConfigurationItem", + "properties": [ + { + "name": "scopeUri", + "type": { + "kind": "base", + "name": "URI" + }, + "optional": true, + "documentation": "The scope to get the configuration section for." + }, + { + "name": "section", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The configuration section asked for." + } + ] + }, + { + "name": "TextDocumentIdentifier", + "properties": [ + { + "name": "uri", + "type": { + "kind": "base", + "name": "DocumentUri" + }, + "documentation": "The text document's uri." + } + ], + "documentation": "A literal to identify a text document in the client." + }, + { + "name": "Color", + "properties": [ + { + "name": "red", + "type": { + "kind": "base", + "name": "decimal" + }, + "documentation": "The red component of this color in the range [0-1]." + }, + { + "name": "green", + "type": { + "kind": "base", + "name": "decimal" + }, + "documentation": "The green component of this color in the range [0-1]." + }, + { + "name": "blue", + "type": { + "kind": "base", + "name": "decimal" + }, + "documentation": "The blue component of this color in the range [0-1]." + }, + { + "name": "alpha", + "type": { + "kind": "base", + "name": "decimal" + }, + "documentation": "The alpha component of this color in the range [0-1]." + } + ], + "documentation": "Represents a color in RGBA space." + }, + { + "name": "DocumentColorOptions", + "properties": [], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ] + }, + { + "name": "FoldingRangeOptions", + "properties": [], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ] + }, + { + "name": "DeclarationOptions", + "properties": [], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ] + }, + { + "name": "Position", + "properties": [ + { + "name": "line", + "type": { + "kind": "base", + "name": "uinteger" + }, + "documentation": "Line position in a document (zero-based).\n\nIf a line number is greater than the number of lines in a document, it defaults back to the number of lines in the document.\nIf a line number is negative, it defaults to 0." + }, + { + "name": "character", + "type": { + "kind": "base", + "name": "uinteger" + }, + "documentation": "Character offset on a line in a document (zero-based).\n\nThe meaning of this offset is determined by the negotiated\n`PositionEncodingKind`.\n\nIf the character value is greater than the line length it defaults back to the\nline length." + } + ], + "documentation": "Position in a text document expressed as zero-based line and character\noffset. Prior to 3.17 the offsets were always based on a UTF-16 string\nrepresentation. So a string of the form `a𐐀b` the character offset of the\ncharacter `a` is 0, the character offset of `𐐀` is 1 and the character\noffset of b is 3 since `𐐀` is represented using two code units in UTF-16.\nSince 3.17 clients and servers can agree on a different string encoding\nrepresentation (e.g. UTF-8). The client announces it's supported encoding\nvia the client capability [`general.positionEncodings`](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#clientCapabilities).\nThe value is an array of position encodings the client supports, with\ndecreasing preference (e.g. the encoding at index `0` is the most preferred\none). To stay backwards compatible the only mandatory encoding is UTF-16\nrepresented via the string `utf-16`. The server can pick one of the\nencodings offered by the client and signals that encoding back to the\nclient via the initialize result's property\n[`capabilities.positionEncoding`](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#serverCapabilities). If the string value\n`utf-16` is missing from the client's capability `general.positionEncodings`\nservers can safely assume that the client supports UTF-16. If the server\nomits the position encoding in its initialize result the encoding defaults\nto the string value `utf-16`. Implementation considerations: since the\nconversion from one encoding into another requires the content of the\nfile / line the conversion is best done where the file is read which is\nusually on the server side.\n\nPositions are line end character agnostic. So you can not specify a position\nthat denotes `\\r|\\n` or `\\n|` where `|` represents the character offset.\n\n@since 3.17.0 - support for negotiated position encoding.", + "since": "3.17.0 - support for negotiated position encoding." + }, + { + "name": "SelectionRangeOptions", + "properties": [], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ] + }, + { + "name": "CallHierarchyOptions", + "properties": [], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "Call hierarchy options used during static registration.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "SemanticTokensOptions", + "properties": [ + { + "name": "legend", + "type": { + "kind": "reference", + "name": "SemanticTokensLegend" + }, + "documentation": "The legend used by the server" + }, + { + "name": "range", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "literal", + "value": { + "properties": [] + } + } + ] + }, + "optional": true, + "documentation": "Server supports providing semantic tokens for a specific range\nof a document." + }, + { + "name": "full", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "literal", + "value": { + "properties": [ + { + "name": "delta", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The server supports deltas for full documents." + } + ] + } + } + ] + }, + "optional": true, + "documentation": "Server supports providing semantic tokens for a full document." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "SemanticTokensEdit", + "properties": [ + { + "name": "start", + "type": { + "kind": "base", + "name": "uinteger" + }, + "documentation": "The start offset of the edit." + }, + { + "name": "deleteCount", + "type": { + "kind": "base", + "name": "uinteger" + }, + "documentation": "The count of elements to remove." + }, + { + "name": "data", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "uinteger" + } + }, + "optional": true, + "documentation": "The elements to insert." + } + ], + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "LinkedEditingRangeOptions", + "properties": [], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ] + }, + { + "name": "FileCreate", + "properties": [ + { + "name": "uri", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A file:// URI for the location of the file/folder being created." + } + ], + "documentation": "Represents information on a file/folder create.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "TextDocumentEdit", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "OptionalVersionedTextDocumentIdentifier" + }, + "documentation": "The text document to change." + }, + { + "name": "edits", + "type": { + "kind": "array", + "element": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "TextEdit" + }, + { + "kind": "reference", + "name": "AnnotatedTextEdit" + } + ] + } + }, + "documentation": "The edits to be applied.\n\n@since 3.16.0 - support for AnnotatedTextEdit. This is guarded using a\nclient capability.", + "since": "3.16.0 - support for AnnotatedTextEdit. This is guarded using a\nclient capability." + } + ], + "documentation": "Describes textual changes on a text document. A TextDocumentEdit describes all changes\non a document version Si and after they are applied move the document to version Si+1.\nSo the creator of a TextDocumentEdit doesn't need to sort the array of edits or do any\nkind of ordering. However the edits must be non overlapping." + }, + { + "name": "CreateFile", + "properties": [ + { + "name": "kind", + "type": { + "kind": "stringLiteral", + "value": "create" + }, + "documentation": "A create" + }, + { + "name": "uri", + "type": { + "kind": "base", + "name": "DocumentUri" + }, + "documentation": "The resource to create." + }, + { + "name": "options", + "type": { + "kind": "reference", + "name": "CreateFileOptions" + }, + "optional": true, + "documentation": "Additional options" + } + ], + "extends": [ + { + "kind": "reference", + "name": "ResourceOperation" + } + ], + "documentation": "Create file operation." + }, + { + "name": "RenameFile", + "properties": [ + { + "name": "kind", + "type": { + "kind": "stringLiteral", + "value": "rename" + }, + "documentation": "A rename" + }, + { + "name": "oldUri", + "type": { + "kind": "base", + "name": "DocumentUri" + }, + "documentation": "The old (existing) location." + }, + { + "name": "newUri", + "type": { + "kind": "base", + "name": "DocumentUri" + }, + "documentation": "The new location." + }, + { + "name": "options", + "type": { + "kind": "reference", + "name": "RenameFileOptions" + }, + "optional": true, + "documentation": "Rename options." + } + ], + "extends": [ + { + "kind": "reference", + "name": "ResourceOperation" + } + ], + "documentation": "Rename file operation" + }, + { + "name": "DeleteFile", + "properties": [ + { + "name": "kind", + "type": { + "kind": "stringLiteral", + "value": "delete" + }, + "documentation": "A delete" + }, + { + "name": "uri", + "type": { + "kind": "base", + "name": "DocumentUri" + }, + "documentation": "The file to delete." + }, + { + "name": "options", + "type": { + "kind": "reference", + "name": "DeleteFileOptions" + }, + "optional": true, + "documentation": "Delete options." + } + ], + "extends": [ + { + "kind": "reference", + "name": "ResourceOperation" + } + ], + "documentation": "Delete file operation" + }, + { + "name": "ChangeAnnotation", + "properties": [ + { + "name": "label", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A human-readable string describing the actual change. The string\nis rendered prominent in the user interface." + }, + { + "name": "needsConfirmation", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "A flag which indicates that user confirmation is needed\nbefore applying the change." + }, + { + "name": "description", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A human-readable string which is rendered less prominent in\nthe user interface." + } + ], + "documentation": "Additional information that describes document changes.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "FileOperationFilter", + "properties": [ + { + "name": "scheme", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A Uri scheme like `file` or `untitled`." + }, + { + "name": "pattern", + "type": { + "kind": "reference", + "name": "FileOperationPattern" + }, + "documentation": "The actual file operation pattern." + } + ], + "documentation": "A filter to describe in which file operation requests or notifications\nthe server is interested in receiving.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "FileRename", + "properties": [ + { + "name": "oldUri", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A file:// URI for the original location of the file/folder being renamed." + }, + { + "name": "newUri", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A file:// URI for the new location of the file/folder being renamed." + } + ], + "documentation": "Represents information on a file/folder rename.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "FileDelete", + "properties": [ + { + "name": "uri", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A file:// URI for the location of the file/folder being deleted." + } + ], + "documentation": "Represents information on a file/folder delete.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "MonikerOptions", + "properties": [], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ] + }, + { + "name": "TypeHierarchyOptions", + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "properties": [], + "documentation": "Type hierarchy options used during static registration.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "InlineValueContext", + "properties": [ + { + "name": "frameId", + "type": { + "kind": "base", + "name": "integer" + }, + "documentation": "The stack frame (as a DAP Id) where the execution has stopped." + }, + { + "name": "stoppedLocation", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The document range where execution has stopped.\nTypically the end position of the range denotes the line where the inline values are shown." + } + ], + "documentation": "@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "InlineValueText", + "properties": [ + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The document range for which the inline value applies." + }, + { + "name": "text", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The text of the inline value." + } + ], + "documentation": "Provide inline value as text.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "InlineValueVariableLookup", + "properties": [ + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The document range for which the inline value applies.\nThe range is used to extract the variable name from the underlying document." + }, + { + "name": "variableName", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "If specified the name of the variable to look up." + }, + { + "name": "caseSensitiveLookup", + "type": { + "kind": "base", + "name": "boolean" + }, + "documentation": "How to perform the lookup." + } + ], + "documentation": "Provide inline value through a variable lookup.\nIf only a range is specified, the variable name will be extracted from the underlying document.\nAn optional variable name can be used to override the extracted name.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "InlineValueEvaluatableExpression", + "properties": [ + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The document range for which the inline value applies.\nThe range is used to extract the evaluatable expression from the underlying document." + }, + { + "name": "expression", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "If specified the expression overrides the extracted expression." + } + ], + "documentation": "Provide an inline value through an expression evaluation.\nIf only a range is specified, the expression will be extracted from the underlying document.\nAn optional expression can be used to override the extracted expression.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "InlineValueOptions", + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "properties": [], + "documentation": "Inline value options used during static registration.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "InlayHintLabelPart", + "properties": [ + { + "name": "value", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The value of this label part." + }, + { + "name": "tooltip", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "string" + }, + { + "kind": "reference", + "name": "MarkupContent" + } + ] + }, + "optional": true, + "documentation": "The tooltip text when you hover over this label part. Depending on\nthe client capability `inlayHint.resolveSupport` clients might resolve\nthis property late using the resolve request." + }, + { + "name": "location", + "type": { + "kind": "reference", + "name": "Location" + }, + "optional": true, + "documentation": "An optional source code location that represents this\nlabel part.\n\nThe editor will use this location for the hover and for code navigation\nfeatures: This part will become a clickable link that resolves to the\ndefinition of the symbol at the given location (not necessarily the\nlocation itself), it shows the hover that shows at the given location,\nand it shows a context menu with further code navigation commands.\n\nDepending on the client capability `inlayHint.resolveSupport` clients\nmight resolve this property late using the resolve request." + }, + { + "name": "command", + "type": { + "kind": "reference", + "name": "Command" + }, + "optional": true, + "documentation": "An optional command for this label part.\n\nDepending on the client capability `inlayHint.resolveSupport` clients\nmight resolve this property late using the resolve request." + } + ], + "documentation": "An inlay hint label part allows for interactive and composite labels\nof inlay hints.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "MarkupContent", + "properties": [ + { + "name": "kind", + "type": { + "kind": "reference", + "name": "MarkupKind" + }, + "documentation": "The type of the Markup" + }, + { + "name": "value", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The content itself" + } + ], + "documentation": "A `MarkupContent` literal represents a string value which content is interpreted base on its\nkind flag. Currently the protocol supports `plaintext` and `markdown` as markup kinds.\n\nIf the kind is `markdown` then the value can contain fenced code blocks like in GitHub issues.\nSee https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting\n\nHere is an example how such a string can be constructed using JavaScript / TypeScript:\n```ts\nlet markdown: MarkdownContent = {\n kind: MarkupKind.Markdown,\n value: [\n '# Header',\n 'Some text',\n '```typescript',\n 'someCode();',\n '```'\n ].join('\\n')\n};\n```\n\n*Please Note* that clients might sanitize the return markdown. A client could decide to\nremove HTML from the markdown to avoid script execution." + }, + { + "name": "InlayHintOptions", + "properties": [ + { + "name": "resolveProvider", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The server provides support to resolve additional\ninformation for an inlay hint item." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "Inlay hint options used during static registration.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "RelatedFullDocumentDiagnosticReport", + "properties": [ + { + "name": "relatedDocuments", + "type": { + "kind": "map", + "key": { + "kind": "base", + "name": "DocumentUri" + }, + "value": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "FullDocumentDiagnosticReport" + }, + { + "kind": "reference", + "name": "UnchangedDocumentDiagnosticReport" + } + ] + } + }, + "optional": true, + "documentation": "Diagnostics of related documents. This information is useful\nin programming languages where code in a file A can generate\ndiagnostics in a file B which A depends on. An example of\nsuch a language is C/C++ where marco definitions in a file\na.cpp and result in errors in a header file b.hpp.\n\n@since 3.17.0", + "since": "3.17.0" + } + ], + "extends": [ + { + "kind": "reference", + "name": "FullDocumentDiagnosticReport" + } + ], + "documentation": "A full diagnostic report with a set of related documents.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "RelatedUnchangedDocumentDiagnosticReport", + "properties": [ + { + "name": "relatedDocuments", + "type": { + "kind": "map", + "key": { + "kind": "base", + "name": "DocumentUri" + }, + "value": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "FullDocumentDiagnosticReport" + }, + { + "kind": "reference", + "name": "UnchangedDocumentDiagnosticReport" + } + ] + } + }, + "optional": true, + "documentation": "Diagnostics of related documents. This information is useful\nin programming languages where code in a file A can generate\ndiagnostics in a file B which A depends on. An example of\nsuch a language is C/C++ where marco definitions in a file\na.cpp and result in errors in a header file b.hpp.\n\n@since 3.17.0", + "since": "3.17.0" + } + ], + "extends": [ + { + "kind": "reference", + "name": "UnchangedDocumentDiagnosticReport" + } + ], + "documentation": "An unchanged diagnostic report with a set of related documents.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "FullDocumentDiagnosticReport", + "properties": [ + { + "name": "kind", + "type": { + "kind": "stringLiteral", + "value": "full" + }, + "documentation": "A full document diagnostic report." + }, + { + "name": "resultId", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "An optional result id. If provided it will\nbe sent on the next diagnostic request for the\nsame document." + }, + { + "name": "items", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "Diagnostic" + } + }, + "documentation": "The actual items." + } + ], + "documentation": "A diagnostic report with a full set of problems.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "UnchangedDocumentDiagnosticReport", + "properties": [ + { + "name": "kind", + "type": { + "kind": "stringLiteral", + "value": "unchanged" + }, + "documentation": "A document diagnostic report indicating\nno changes to the last result. A server can\nonly return `unchanged` if result ids are\nprovided." + }, + { + "name": "resultId", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A result id which will be sent on the next\ndiagnostic request for the same document." + } + ], + "documentation": "A diagnostic report indicating that the last returned\nreport is still accurate.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "DiagnosticOptions", + "properties": [ + { + "name": "identifier", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "An optional identifier under which the diagnostics are\nmanaged by the client." + }, + { + "name": "interFileDependencies", + "type": { + "kind": "base", + "name": "boolean" + }, + "documentation": "Whether the language has inter file dependencies meaning that\nediting code in one file can result in a different diagnostic\nset in another file. Inter file dependencies are common for\nmost programming languages and typically uncommon for linters." + }, + { + "name": "workspaceDiagnostics", + "type": { + "kind": "base", + "name": "boolean" + }, + "documentation": "The server provides support for workspace diagnostics as well." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "Diagnostic options.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "PreviousResultId", + "properties": [ + { + "name": "uri", + "type": { + "kind": "base", + "name": "DocumentUri" + }, + "documentation": "The URI for which the client knowns a\nresult id." + }, + { + "name": "value", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The value of the previous result id." + } + ], + "documentation": "A previous result id in a workspace pull request.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "NotebookDocument", + "properties": [ + { + "name": "uri", + "type": { + "kind": "base", + "name": "URI" + }, + "documentation": "The notebook document's uri." + }, + { + "name": "notebookType", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The type of the notebook." + }, + { + "name": "version", + "type": { + "kind": "base", + "name": "integer" + }, + "documentation": "The version number of this document (it will increase after each\nchange, including undo/redo)." + }, + { + "name": "metadata", + "type": { + "kind": "reference", + "name": "LSPObject" + }, + "optional": true, + "documentation": "Additional metadata stored with the notebook\ndocument.\n\nNote: should always be an object literal (e.g. LSPObject)" + }, + { + "name": "cells", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "NotebookCell" + } + }, + "documentation": "The cells of a notebook." + } + ], + "documentation": "A notebook document.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "TextDocumentItem", + "properties": [ + { + "name": "uri", + "type": { + "kind": "base", + "name": "DocumentUri" + }, + "documentation": "The text document's uri." + }, + { + "name": "languageId", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The text document's language identifier." + }, + { + "name": "version", + "type": { + "kind": "base", + "name": "integer" + }, + "documentation": "The version number of this document (it will increase after each\nchange, including undo/redo)." + }, + { + "name": "text", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The content of the opened text document." + } + ], + "documentation": "An item to transfer a text document from the client to the\nserver." + }, + { + "name": "VersionedNotebookDocumentIdentifier", + "properties": [ + { + "name": "version", + "type": { + "kind": "base", + "name": "integer" + }, + "documentation": "The version number of this notebook document." + }, + { + "name": "uri", + "type": { + "kind": "base", + "name": "URI" + }, + "documentation": "The notebook document's uri." + } + ], + "documentation": "A versioned notebook document identifier.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "NotebookDocumentChangeEvent", + "properties": [ + { + "name": "metadata", + "type": { + "kind": "reference", + "name": "LSPObject" + }, + "optional": true, + "documentation": "The changed meta data if any.\n\nNote: should always be an object literal (e.g. LSPObject)" + }, + { + "name": "cells", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "structure", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "array", + "type": { + "kind": "reference", + "name": "NotebookCellArrayChange" + }, + "documentation": "The change to the cell array." + }, + { + "name": "didOpen", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "TextDocumentItem" + } + }, + "optional": true, + "documentation": "Additional opened cell text documents." + }, + { + "name": "didClose", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "TextDocumentIdentifier" + } + }, + "optional": true, + "documentation": "Additional closed cell text documents." + } + ] + } + }, + "optional": true, + "documentation": "Changes to the cell structure to add or\nremove cells." + }, + { + "name": "data", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "NotebookCell" + } + }, + "optional": true, + "documentation": "Changes to notebook cells properties like its\nkind, execution summary or metadata." + }, + { + "name": "textContent", + "type": { + "kind": "array", + "element": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "document", + "type": { + "kind": "reference", + "name": "VersionedTextDocumentIdentifier" + } + }, + { + "name": "changes", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "TextDocumentContentChangeEvent" + } + } + } + ] + } + } + }, + "optional": true, + "documentation": "Changes to the text content of notebook cells." + } + ] + } + }, + "optional": true, + "documentation": "Changes to cells" + } + ], + "documentation": "A change event for a notebook document.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "NotebookDocumentIdentifier", + "properties": [ + { + "name": "uri", + "type": { + "kind": "base", + "name": "URI" + }, + "documentation": "The notebook document's uri." + } + ], + "documentation": "A literal to identify a notebook document in the client.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "InlineCompletionContext", + "properties": [ + { + "name": "triggerKind", + "type": { + "kind": "reference", + "name": "InlineCompletionTriggerKind" + }, + "documentation": "Describes how the inline completion was triggered." + }, + { + "name": "selectedCompletionInfo", + "type": { + "kind": "reference", + "name": "SelectedCompletionInfo" + }, + "optional": true, + "documentation": "Provides information about the currently selected item in the autocomplete widget if it is visible." + } + ], + "documentation": "Provides information about the context in which an inline completion was requested.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "StringValue", + "properties": [ + { + "name": "kind", + "type": { + "kind": "stringLiteral", + "value": "snippet" + }, + "documentation": "The kind of string value." + }, + { + "name": "value", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The snippet string." + } + ], + "documentation": "A string value used as a snippet is a template which allows to insert text\nand to control the editor cursor when insertion happens.\n\nA snippet can define tab stops and placeholders with `$1`, `$2`\nand `${3:foo}`. `$0` defines the final tab stop, it defaults to\nthe end of the snippet. Variables are defined with `$name` and\n`${name:default value}`.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "InlineCompletionOptions", + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "properties": [], + "documentation": "Inline completion options used during static registration.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "Registration", + "properties": [ + { + "name": "id", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The id used to register the request. The id can be used to deregister\nthe request again." + }, + { + "name": "method", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The method / capability to register for." + }, + { + "name": "registerOptions", + "type": { + "kind": "reference", + "name": "LSPAny" + }, + "optional": true, + "documentation": "Options necessary for the registration." + } + ], + "documentation": "General parameters to register for a notification or to register a provider." + }, + { + "name": "Unregistration", + "properties": [ + { + "name": "id", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The id used to unregister the request or notification. Usually an id\nprovided during the register request." + }, + { + "name": "method", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The method to unregister for." + } + ], + "documentation": "General parameters to unregister a request or notification." + }, + { + "name": "_InitializeParams", + "properties": [ + { + "name": "processId", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "integer" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "documentation": "The process Id of the parent process that started\nthe server.\n\nIs `null` if the process has not been started by another process.\nIf the parent process is not alive then the server should exit." + }, + { + "name": "clientInfo", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "name", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The name of the client as defined by the client." + }, + { + "name": "version", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The client's version as defined by the client." + } + ] + } + }, + "optional": true, + "documentation": "Information about the client\n\n@since 3.15.0", + "since": "3.15.0" + }, + { + "name": "locale", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The locale the client is currently showing the user interface\nin. This must not necessarily be the locale of the operating\nsystem.\n\nUses IETF language tags as the value's syntax\n(See https://en.wikipedia.org/wiki/IETF_language_tag)\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "rootPath", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "string" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "optional": true, + "documentation": "The rootPath of the workspace. Is null\nif no folder is open.\n\n@deprecated in favour of rootUri.", + "deprecated": "in favour of rootUri." + }, + { + "name": "rootUri", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "DocumentUri" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "documentation": "The rootUri of the workspace. Is null if no\nfolder is open. If both `rootPath` and `rootUri` are set\n`rootUri` wins.\n\n@deprecated in favour of workspaceFolders.", + "deprecated": "in favour of workspaceFolders." + }, + { + "name": "capabilities", + "type": { + "kind": "reference", + "name": "ClientCapabilities" + }, + "documentation": "The capabilities provided by the client (editor or tool)" + }, + { + "name": "initializationOptions", + "type": { + "kind": "reference", + "name": "LSPAny" + }, + "optional": true, + "documentation": "User provided initialization options." + }, + { + "name": "trace", + "type": { + "kind": "reference", + "name": "TraceValues" + }, + "optional": true, + "documentation": "The initial trace setting. If omitted trace is disabled ('off')." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + } + ], + "documentation": "The initialize parameters" + }, + { + "name": "WorkspaceFoldersInitializeParams", + "properties": [ + { + "name": "workspaceFolders", + "type": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "WorkspaceFolder" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "optional": true, + "documentation": "The workspace folders configured in the client when the server starts.\n\nThis property is only available if the client supports workspace folders.\nIt can be `null` if the client supports workspace folders but none are\nconfigured.\n\n@since 3.6.0", + "since": "3.6.0" + } + ] + }, + { + "name": "ServerCapabilities", + "properties": [ + { + "name": "positionEncoding", + "type": { + "kind": "reference", + "name": "PositionEncodingKind" + }, + "optional": true, + "documentation": "The position encoding the server picked from the encodings offered\nby the client via the client capability `general.positionEncodings`.\n\nIf the client didn't provide any position encodings the only valid\nvalue that a server can return is 'utf-16'.\n\nIf omitted it defaults to 'utf-16'.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "textDocumentSync", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "TextDocumentSyncOptions" + }, + { + "kind": "reference", + "name": "TextDocumentSyncKind" + } + ] + }, + "optional": true, + "documentation": "Defines how text documents are synced. Is either a detailed structure\ndefining each notification or for backwards compatibility the\nTextDocumentSyncKind number." + }, + { + "name": "notebookDocumentSync", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "NotebookDocumentSyncOptions" + }, + { + "kind": "reference", + "name": "NotebookDocumentSyncRegistrationOptions" + } + ] + }, + "optional": true, + "documentation": "Defines how notebook documents are synced.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "completionProvider", + "type": { + "kind": "reference", + "name": "CompletionOptions" + }, + "optional": true, + "documentation": "The server provides completion support." + }, + { + "name": "hoverProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "HoverOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides hover support." + }, + { + "name": "signatureHelpProvider", + "type": { + "kind": "reference", + "name": "SignatureHelpOptions" + }, + "optional": true, + "documentation": "The server provides signature help support." + }, + { + "name": "declarationProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "DeclarationOptions" + }, + { + "kind": "reference", + "name": "DeclarationRegistrationOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides Goto Declaration support." + }, + { + "name": "definitionProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "DefinitionOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides goto definition support." + }, + { + "name": "typeDefinitionProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "TypeDefinitionOptions" + }, + { + "kind": "reference", + "name": "TypeDefinitionRegistrationOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides Goto Type Definition support." + }, + { + "name": "implementationProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "ImplementationOptions" + }, + { + "kind": "reference", + "name": "ImplementationRegistrationOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides Goto Implementation support." + }, + { + "name": "referencesProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "ReferenceOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides find references support." + }, + { + "name": "documentHighlightProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "DocumentHighlightOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides document highlight support." + }, + { + "name": "documentSymbolProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "DocumentSymbolOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides document symbol support." + }, + { + "name": "codeActionProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "CodeActionOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides code actions. CodeActionOptions may only be\nspecified if the client states that it supports\n`codeActionLiteralSupport` in its initial `initialize` request." + }, + { + "name": "codeLensProvider", + "type": { + "kind": "reference", + "name": "CodeLensOptions" + }, + "optional": true, + "documentation": "The server provides code lens." + }, + { + "name": "documentLinkProvider", + "type": { + "kind": "reference", + "name": "DocumentLinkOptions" + }, + "optional": true, + "documentation": "The server provides document link support." + }, + { + "name": "colorProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "DocumentColorOptions" + }, + { + "kind": "reference", + "name": "DocumentColorRegistrationOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides color provider support." + }, + { + "name": "workspaceSymbolProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "WorkspaceSymbolOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides workspace symbol support." + }, + { + "name": "documentFormattingProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "DocumentFormattingOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides document formatting." + }, + { + "name": "documentRangeFormattingProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "DocumentRangeFormattingOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides document range formatting." + }, + { + "name": "documentOnTypeFormattingProvider", + "type": { + "kind": "reference", + "name": "DocumentOnTypeFormattingOptions" + }, + "optional": true, + "documentation": "The server provides document formatting on typing." + }, + { + "name": "renameProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "RenameOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides rename support. RenameOptions may only be\nspecified if the client states that it supports\n`prepareSupport` in its initial `initialize` request." + }, + { + "name": "foldingRangeProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "FoldingRangeOptions" + }, + { + "kind": "reference", + "name": "FoldingRangeRegistrationOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides folding provider support." + }, + { + "name": "selectionRangeProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "SelectionRangeOptions" + }, + { + "kind": "reference", + "name": "SelectionRangeRegistrationOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides selection range support." + }, + { + "name": "executeCommandProvider", + "type": { + "kind": "reference", + "name": "ExecuteCommandOptions" + }, + "optional": true, + "documentation": "The server provides execute command support." + }, + { + "name": "callHierarchyProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "CallHierarchyOptions" + }, + { + "kind": "reference", + "name": "CallHierarchyRegistrationOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides call hierarchy support.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "linkedEditingRangeProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "LinkedEditingRangeOptions" + }, + { + "kind": "reference", + "name": "LinkedEditingRangeRegistrationOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides linked editing range support.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "semanticTokensProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "SemanticTokensOptions" + }, + { + "kind": "reference", + "name": "SemanticTokensRegistrationOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides semantic tokens support.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "monikerProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "MonikerOptions" + }, + { + "kind": "reference", + "name": "MonikerRegistrationOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides moniker support.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "typeHierarchyProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "TypeHierarchyOptions" + }, + { + "kind": "reference", + "name": "TypeHierarchyRegistrationOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides type hierarchy support.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "inlineValueProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "InlineValueOptions" + }, + { + "kind": "reference", + "name": "InlineValueRegistrationOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides inline values.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "inlayHintProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "InlayHintOptions" + }, + { + "kind": "reference", + "name": "InlayHintRegistrationOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides inlay hints.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "diagnosticProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "DiagnosticOptions" + }, + { + "kind": "reference", + "name": "DiagnosticRegistrationOptions" + } + ] + }, + "optional": true, + "documentation": "The server has support for pull model diagnostics.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "inlineCompletionProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "InlineCompletionOptions" + } + ] + }, + "optional": true, + "documentation": "Inline completion options used during static registration.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "workspace", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "workspaceFolders", + "type": { + "kind": "reference", + "name": "WorkspaceFoldersServerCapabilities" + }, + "optional": true, + "documentation": "The server supports workspace folder.\n\n@since 3.6.0", + "since": "3.6.0" + }, + { + "name": "fileOperations", + "type": { + "kind": "reference", + "name": "FileOperationOptions" + }, + "optional": true, + "documentation": "The server is interested in notifications/requests for operations on files.\n\n@since 3.16.0", + "since": "3.16.0" + } + ] + } + }, + "optional": true, + "documentation": "Workspace specific server capabilities." + }, + { + "name": "experimental", + "type": { + "kind": "reference", + "name": "LSPAny" + }, + "optional": true, + "documentation": "Experimental server capabilities." + } + ], + "documentation": "Defines the capabilities provided by a language\nserver." + }, + { + "name": "VersionedTextDocumentIdentifier", + "properties": [ + { + "name": "version", + "type": { + "kind": "base", + "name": "integer" + }, + "documentation": "The version number of this document." + } + ], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentIdentifier" + } + ], + "documentation": "A text document identifier to denote a specific version of a text document." + }, + { + "name": "SaveOptions", + "properties": [ + { + "name": "includeText", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client is supposed to include the content on save." + } + ], + "documentation": "Save options." + }, + { + "name": "FileEvent", + "properties": [ + { + "name": "uri", + "type": { + "kind": "base", + "name": "DocumentUri" + }, + "documentation": "The file's uri." + }, + { + "name": "type", + "type": { + "kind": "reference", + "name": "FileChangeType" + }, + "documentation": "The change type." + } + ], + "documentation": "An event describing a file change." + }, + { + "name": "FileSystemWatcher", + "properties": [ + { + "name": "globPattern", + "type": { + "kind": "reference", + "name": "GlobPattern" + }, + "documentation": "The glob pattern to watch. See {@link GlobPattern glob pattern} for more detail.\n\n@since 3.17.0 support for relative patterns.", + "since": "3.17.0 support for relative patterns." + }, + { + "name": "kind", + "type": { + "kind": "reference", + "name": "WatchKind" + }, + "optional": true, + "documentation": "The kind of events of interest. If omitted it defaults\nto WatchKind.Create | WatchKind.Change | WatchKind.Delete\nwhich is 7." + } + ] + }, + { + "name": "Diagnostic", + "properties": [ + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range at which the message applies" + }, + { + "name": "severity", + "type": { + "kind": "reference", + "name": "DiagnosticSeverity" + }, + "optional": true, + "documentation": "The diagnostic's severity. Can be omitted. If omitted it is up to the\nclient to interpret diagnostics as error, warning, info or hint." + }, + { + "name": "code", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "integer" + }, + { + "kind": "base", + "name": "string" + } + ] + }, + "optional": true, + "documentation": "The diagnostic's code, which usually appear in the user interface." + }, + { + "name": "codeDescription", + "type": { + "kind": "reference", + "name": "CodeDescription" + }, + "optional": true, + "documentation": "An optional property to describe the error code.\nRequires the code field (above) to be present/not null.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "source", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A human-readable string describing the source of this\ndiagnostic, e.g. 'typescript' or 'super lint'. It usually\nappears in the user interface." + }, + { + "name": "message", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The diagnostic's message. It usually appears in the user interface" + }, + { + "name": "tags", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "DiagnosticTag" + } + }, + "optional": true, + "documentation": "Additional metadata about the diagnostic.\n\n@since 3.15.0", + "since": "3.15.0" + }, + { + "name": "relatedInformation", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "DiagnosticRelatedInformation" + } + }, + "optional": true, + "documentation": "An array of related diagnostic information, e.g. when symbol-names within\na scope collide all definitions can be marked via this property." + }, + { + "name": "data", + "type": { + "kind": "reference", + "name": "LSPAny" + }, + "optional": true, + "documentation": "A data entry field that is preserved between a `textDocument/publishDiagnostics`\nnotification and `textDocument/codeAction` request.\n\n@since 3.16.0", + "since": "3.16.0" + } + ], + "documentation": "Represents a diagnostic, such as a compiler error or warning. Diagnostic objects\nare only valid in the scope of a resource." + }, + { + "name": "CompletionContext", + "properties": [ + { + "name": "triggerKind", + "type": { + "kind": "reference", + "name": "CompletionTriggerKind" + }, + "documentation": "How the completion was triggered." + }, + { + "name": "triggerCharacter", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The trigger character (a single character) that has trigger code complete.\nIs undefined if `triggerKind !== CompletionTriggerKind.TriggerCharacter`" + } + ], + "documentation": "Contains additional information about the context in which a completion request is triggered." + }, + { + "name": "CompletionItemLabelDetails", + "properties": [ + { + "name": "detail", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "An optional string which is rendered less prominently directly after {@link CompletionItem.label label},\nwithout any spacing. Should be used for function signatures and type annotations." + }, + { + "name": "description", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "An optional string which is rendered less prominently after {@link CompletionItem.detail}. Should be used\nfor fully qualified names and file paths." + } + ], + "documentation": "Additional details for a completion item label.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "InsertReplaceEdit", + "properties": [ + { + "name": "newText", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The string to be inserted." + }, + { + "name": "insert", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range if the insert is requested" + }, + { + "name": "replace", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range if the replace is requested." + } + ], + "documentation": "A special text edit to provide an insert and a replace operation.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "CompletionOptions", + "properties": [ + { + "name": "triggerCharacters", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "optional": true, + "documentation": "Most tools trigger completion request automatically without explicitly requesting\nit using a keyboard shortcut (e.g. Ctrl+Space). Typically they do so when the user\nstarts to type an identifier. For example if the user types `c` in a JavaScript file\ncode complete will automatically pop up present `console` besides others as a\ncompletion item. Characters that make up identifiers don't need to be listed here.\n\nIf code complete should automatically be trigger on characters not being valid inside\nan identifier (for example `.` in JavaScript) list them in `triggerCharacters`." + }, + { + "name": "allCommitCharacters", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "optional": true, + "documentation": "The list of all possible characters that commit a completion. This field can be used\nif clients don't support individual commit characters per completion item. See\n`ClientCapabilities.textDocument.completion.completionItem.commitCharactersSupport`\n\nIf a server provides both `allCommitCharacters` and commit characters on an individual\ncompletion item the ones on the completion item win.\n\n@since 3.2.0", + "since": "3.2.0" + }, + { + "name": "resolveProvider", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The server provides support to resolve additional\ninformation for a completion item." + }, + { + "name": "completionItem", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "labelDetailsSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The server has support for completion item label\ndetails (see also `CompletionItemLabelDetails`) when\nreceiving a completion item in a resolve call.\n\n@since 3.17.0", + "since": "3.17.0" + } + ] + } + }, + "optional": true, + "documentation": "The server supports the following `CompletionItem` specific\ncapabilities.\n\n@since 3.17.0", + "since": "3.17.0" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "Completion options." + }, + { + "name": "HoverOptions", + "properties": [], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "Hover options." + }, + { + "name": "SignatureHelpContext", + "properties": [ + { + "name": "triggerKind", + "type": { + "kind": "reference", + "name": "SignatureHelpTriggerKind" + }, + "documentation": "Action that caused signature help to be triggered." + }, + { + "name": "triggerCharacter", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "Character that caused signature help to be triggered.\n\nThis is undefined when `triggerKind !== SignatureHelpTriggerKind.TriggerCharacter`" + }, + { + "name": "isRetrigger", + "type": { + "kind": "base", + "name": "boolean" + }, + "documentation": "`true` if signature help was already showing when it was triggered.\n\nRetriggers occurs when the signature help is already active and can be caused by actions such as\ntyping a trigger character, a cursor move, or document content changes." + }, + { + "name": "activeSignatureHelp", + "type": { + "kind": "reference", + "name": "SignatureHelp" + }, + "optional": true, + "documentation": "The currently active `SignatureHelp`.\n\nThe `activeSignatureHelp` has its `SignatureHelp.activeSignature` field updated based on\nthe user navigating through available signatures." + } + ], + "documentation": "Additional information about the context in which a signature help request was triggered.\n\n@since 3.15.0", + "since": "3.15.0" + }, + { + "name": "SignatureInformation", + "properties": [ + { + "name": "label", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The label of this signature. Will be shown in\nthe UI." + }, + { + "name": "documentation", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "string" + }, + { + "kind": "reference", + "name": "MarkupContent" + } + ] + }, + "optional": true, + "documentation": "The human-readable doc-comment of this signature. Will be shown\nin the UI but can be omitted." + }, + { + "name": "parameters", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "ParameterInformation" + } + }, + "optional": true, + "documentation": "The parameters of this signature." + }, + { + "name": "activeParameter", + "type": { + "kind": "base", + "name": "uinteger" + }, + "optional": true, + "documentation": "The index of the active parameter.\n\nIf provided, this is used in place of `SignatureHelp.activeParameter`.\n\n@since 3.16.0", + "since": "3.16.0" + } + ], + "documentation": "Represents the signature of something callable. A signature\ncan have a label, like a function-name, a doc-comment, and\na set of parameters." + }, + { + "name": "SignatureHelpOptions", + "properties": [ + { + "name": "triggerCharacters", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "optional": true, + "documentation": "List of characters that trigger signature help automatically." + }, + { + "name": "retriggerCharacters", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "optional": true, + "documentation": "List of characters that re-trigger signature help.\n\nThese trigger characters are only active when signature help is already showing. All trigger characters\nare also counted as re-trigger characters.\n\n@since 3.15.0", + "since": "3.15.0" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "Server Capabilities for a {@link SignatureHelpRequest}." + }, + { + "name": "DefinitionOptions", + "properties": [], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "Server Capabilities for a {@link DefinitionRequest}." + }, + { + "name": "ReferenceContext", + "properties": [ + { + "name": "includeDeclaration", + "type": { + "kind": "base", + "name": "boolean" + }, + "documentation": "Include the declaration of the current symbol." + } + ], + "documentation": "Value-object that contains additional information when\nrequesting references." + }, + { + "name": "ReferenceOptions", + "properties": [], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "Reference options." + }, + { + "name": "DocumentHighlightOptions", + "properties": [], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "Provider options for a {@link DocumentHighlightRequest}." + }, + { + "name": "BaseSymbolInformation", + "properties": [ + { + "name": "name", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The name of this symbol." + }, + { + "name": "kind", + "type": { + "kind": "reference", + "name": "SymbolKind" + }, + "documentation": "The kind of this symbol." + }, + { + "name": "tags", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "SymbolTag" + } + }, + "optional": true, + "documentation": "Tags for this symbol.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "containerName", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The name of the symbol containing this symbol. This information is for\nuser interface purposes (e.g. to render a qualifier in the user interface\nif necessary). It can't be used to re-infer a hierarchy for the document\nsymbols." + } + ], + "documentation": "A base for all symbol information." + }, + { + "name": "DocumentSymbolOptions", + "properties": [ + { + "name": "label", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A human-readable string that is shown when multiple outlines trees\nare shown for the same document.\n\n@since 3.16.0", + "since": "3.16.0" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "Provider options for a {@link DocumentSymbolRequest}." + }, + { + "name": "CodeActionContext", + "properties": [ + { + "name": "diagnostics", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "Diagnostic" + } + }, + "documentation": "An array of diagnostics known on the client side overlapping the range provided to the\n`textDocument/codeAction` request. They are provided so that the server knows which\nerrors are currently presented to the user for the given range. There is no guarantee\nthat these accurately reflect the error state of the resource. The primary parameter\nto compute code actions is the provided range." + }, + { + "name": "only", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "CodeActionKind" + } + }, + "optional": true, + "documentation": "Requested kind of actions to return.\n\nActions not of this kind are filtered out by the client before being shown. So servers\ncan omit computing them." + }, + { + "name": "triggerKind", + "type": { + "kind": "reference", + "name": "CodeActionTriggerKind" + }, + "optional": true, + "documentation": "The reason why code actions were requested.\n\n@since 3.17.0", + "since": "3.17.0" + } + ], + "documentation": "Contains additional diagnostic information about the context in which\na {@link CodeActionProvider.provideCodeActions code action} is run." + }, + { + "name": "CodeActionOptions", + "properties": [ + { + "name": "codeActionKinds", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "CodeActionKind" + } + }, + "optional": true, + "documentation": "CodeActionKinds that this server may return.\n\nThe list of kinds may be generic, such as `CodeActionKind.Refactor`, or the server\nmay list out every specific kind they provide." + }, + { + "name": "resolveProvider", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The server provides support to resolve additional\ninformation for a code action.\n\n@since 3.16.0", + "since": "3.16.0" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "Provider options for a {@link CodeActionRequest}." + }, + { + "name": "WorkspaceSymbolOptions", + "properties": [ + { + "name": "resolveProvider", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The server provides support to resolve additional\ninformation for a workspace symbol.\n\n@since 3.17.0", + "since": "3.17.0" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "Server capabilities for a {@link WorkspaceSymbolRequest}." + }, + { + "name": "CodeLensOptions", + "properties": [ + { + "name": "resolveProvider", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Code lens has a resolve provider as well." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "Code Lens provider options of a {@link CodeLensRequest}." + }, + { + "name": "DocumentLinkOptions", + "properties": [ + { + "name": "resolveProvider", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Document links have a resolve provider as well." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "Provider options for a {@link DocumentLinkRequest}." + }, + { + "name": "FormattingOptions", + "properties": [ + { + "name": "tabSize", + "type": { + "kind": "base", + "name": "uinteger" + }, + "documentation": "Size of a tab in spaces." + }, + { + "name": "insertSpaces", + "type": { + "kind": "base", + "name": "boolean" + }, + "documentation": "Prefer spaces over tabs." + }, + { + "name": "trimTrailingWhitespace", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Trim trailing whitespace on a line.\n\n@since 3.15.0", + "since": "3.15.0" + }, + { + "name": "insertFinalNewline", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Insert a newline character at the end of the file if one does not exist.\n\n@since 3.15.0", + "since": "3.15.0" + }, + { + "name": "trimFinalNewlines", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Trim all newlines after the final newline at the end of the file.\n\n@since 3.15.0", + "since": "3.15.0" + } + ], + "documentation": "Value-object describing what options formatting should use." + }, + { + "name": "DocumentFormattingOptions", + "properties": [], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "Provider options for a {@link DocumentFormattingRequest}." + }, + { + "name": "DocumentRangeFormattingOptions", + "properties": [ + { + "name": "rangesSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the server supports formatting multiple ranges at once.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "Provider options for a {@link DocumentRangeFormattingRequest}." + }, + { + "name": "DocumentOnTypeFormattingOptions", + "properties": [ + { + "name": "firstTriggerCharacter", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A character on which formatting should be triggered, like `{`." + }, + { + "name": "moreTriggerCharacter", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "optional": true, + "documentation": "More trigger characters." + } + ], + "documentation": "Provider options for a {@link DocumentOnTypeFormattingRequest}." + }, + { + "name": "RenameOptions", + "properties": [ + { + "name": "prepareProvider", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Renames should be checked and tested before being executed.\n\n@since version 3.12.0", + "since": "version 3.12.0" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "Provider options for a {@link RenameRequest}." + }, + { + "name": "ExecuteCommandOptions", + "properties": [ + { + "name": "commands", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "documentation": "The commands to be executed on the server" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "The server capabilities of a {@link ExecuteCommandRequest}." + }, + { + "name": "SemanticTokensLegend", + "properties": [ + { + "name": "tokenTypes", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "documentation": "The token types a server uses." + }, + { + "name": "tokenModifiers", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "documentation": "The token modifiers a server uses." + } + ], + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "OptionalVersionedTextDocumentIdentifier", + "properties": [ + { + "name": "version", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "integer" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "documentation": "The version number of this document. If a versioned text document identifier\nis sent from the server to the client and the file is not open in the editor\n(the server has not received an open notification before) the server can send\n`null` to indicate that the version is unknown and the content on disk is the\ntruth (as specified with document content ownership)." + } + ], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentIdentifier" + } + ], + "documentation": "A text document identifier to optionally denote a specific version of a text document." + }, + { + "name": "AnnotatedTextEdit", + "properties": [ + { + "name": "annotationId", + "type": { + "kind": "reference", + "name": "ChangeAnnotationIdentifier" + }, + "documentation": "The actual identifier of the change annotation" + } + ], + "extends": [ + { + "kind": "reference", + "name": "TextEdit" + } + ], + "documentation": "A special text edit with an additional change annotation.\n\n@since 3.16.0.", + "since": "3.16.0." + }, + { + "name": "ResourceOperation", + "properties": [ + { + "name": "kind", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The resource operation kind." + }, + { + "name": "annotationId", + "type": { + "kind": "reference", + "name": "ChangeAnnotationIdentifier" + }, + "optional": true, + "documentation": "An optional annotation identifier describing the operation.\n\n@since 3.16.0", + "since": "3.16.0" + } + ], + "documentation": "A generic resource operation." + }, + { + "name": "CreateFileOptions", + "properties": [ + { + "name": "overwrite", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Overwrite existing file. Overwrite wins over `ignoreIfExists`" + }, + { + "name": "ignoreIfExists", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Ignore if exists." + } + ], + "documentation": "Options to create a file." + }, + { + "name": "RenameFileOptions", + "properties": [ + { + "name": "overwrite", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Overwrite target if existing. Overwrite wins over `ignoreIfExists`" + }, + { + "name": "ignoreIfExists", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Ignores if target exists." + } + ], + "documentation": "Rename file options" + }, + { + "name": "DeleteFileOptions", + "properties": [ + { + "name": "recursive", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Delete the content recursively if a folder is denoted." + }, + { + "name": "ignoreIfNotExists", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Ignore the operation if the file doesn't exist." + } + ], + "documentation": "Delete file options" + }, + { + "name": "FileOperationPattern", + "properties": [ + { + "name": "glob", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The glob pattern to match. Glob patterns can have the following syntax:\n- `*` to match one or more characters in a path segment\n- `?` to match on one character in a path segment\n- `**` to match any number of path segments, including none\n- `{}` to group sub patterns into an OR expression. (e.g. `**​/*.{ts,js}` matches all TypeScript and JavaScript files)\n- `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)\n- `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)" + }, + { + "name": "matches", + "type": { + "kind": "reference", + "name": "FileOperationPatternKind" + }, + "optional": true, + "documentation": "Whether to match files or folders with this pattern.\n\nMatches both if undefined." + }, + { + "name": "options", + "type": { + "kind": "reference", + "name": "FileOperationPatternOptions" + }, + "optional": true, + "documentation": "Additional options used during matching." + } + ], + "documentation": "A pattern to describe in which file operation requests or notifications\nthe server is interested in receiving.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "WorkspaceFullDocumentDiagnosticReport", + "properties": [ + { + "name": "uri", + "type": { + "kind": "base", + "name": "DocumentUri" + }, + "documentation": "The URI for which diagnostic information is reported." + }, + { + "name": "version", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "integer" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "documentation": "The version number for which the diagnostics are reported.\nIf the document is not marked as open `null` can be provided." + } + ], + "extends": [ + { + "kind": "reference", + "name": "FullDocumentDiagnosticReport" + } + ], + "documentation": "A full document diagnostic report for a workspace diagnostic result.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "WorkspaceUnchangedDocumentDiagnosticReport", + "properties": [ + { + "name": "uri", + "type": { + "kind": "base", + "name": "DocumentUri" + }, + "documentation": "The URI for which diagnostic information is reported." + }, + { + "name": "version", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "integer" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "documentation": "The version number for which the diagnostics are reported.\nIf the document is not marked as open `null` can be provided." + } + ], + "extends": [ + { + "kind": "reference", + "name": "UnchangedDocumentDiagnosticReport" + } + ], + "documentation": "An unchanged document diagnostic report for a workspace diagnostic result.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "NotebookCell", + "properties": [ + { + "name": "kind", + "type": { + "kind": "reference", + "name": "NotebookCellKind" + }, + "documentation": "The cell's kind" + }, + { + "name": "document", + "type": { + "kind": "base", + "name": "DocumentUri" + }, + "documentation": "The URI of the cell's text document\ncontent." + }, + { + "name": "metadata", + "type": { + "kind": "reference", + "name": "LSPObject" + }, + "optional": true, + "documentation": "Additional metadata stored with the cell.\n\nNote: should always be an object literal (e.g. LSPObject)" + }, + { + "name": "executionSummary", + "type": { + "kind": "reference", + "name": "ExecutionSummary" + }, + "optional": true, + "documentation": "Additional execution summary information\nif supported by the client." + } + ], + "documentation": "A notebook cell.\n\nA cell's document URI must be unique across ALL notebook\ncells and can therefore be used to uniquely identify a\nnotebook cell or the cell's text document.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "NotebookCellArrayChange", + "properties": [ + { + "name": "start", + "type": { + "kind": "base", + "name": "uinteger" + }, + "documentation": "The start oftest of the cell that changed." + }, + { + "name": "deleteCount", + "type": { + "kind": "base", + "name": "uinteger" + }, + "documentation": "The deleted cells" + }, + { + "name": "cells", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "NotebookCell" + } + }, + "optional": true, + "documentation": "The new cells, if any" + } + ], + "documentation": "A change describing how to move a `NotebookCell`\narray from state S to S'.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "SelectedCompletionInfo", + "properties": [ + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range that will be replaced if this completion item is accepted." + }, + { + "name": "text", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The text the range will be replaced with if this completion is accepted." + } + ], + "documentation": "Describes the currently selected completion item.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "ClientCapabilities", + "properties": [ + { + "name": "workspace", + "type": { + "kind": "reference", + "name": "WorkspaceClientCapabilities" + }, + "optional": true, + "documentation": "Workspace specific client capabilities." + }, + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentClientCapabilities" + }, + "optional": true, + "documentation": "Text document specific client capabilities." + }, + { + "name": "notebookDocument", + "type": { + "kind": "reference", + "name": "NotebookDocumentClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the notebook document support.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "window", + "type": { + "kind": "reference", + "name": "WindowClientCapabilities" + }, + "optional": true, + "documentation": "Window specific client capabilities." + }, + { + "name": "general", + "type": { + "kind": "reference", + "name": "GeneralClientCapabilities" + }, + "optional": true, + "documentation": "General client capabilities.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "experimental", + "type": { + "kind": "reference", + "name": "LSPAny" + }, + "optional": true, + "documentation": "Experimental client capabilities." + } + ], + "documentation": "Defines the capabilities provided by the client." + }, + { + "name": "TextDocumentSyncOptions", + "properties": [ + { + "name": "openClose", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Open and close notifications are sent to the server. If omitted open close notification should not\nbe sent." + }, + { + "name": "change", + "type": { + "kind": "reference", + "name": "TextDocumentSyncKind" + }, + "optional": true, + "documentation": "Change notifications are sent to the server. See TextDocumentSyncKind.None, TextDocumentSyncKind.Full\nand TextDocumentSyncKind.Incremental. If omitted it defaults to TextDocumentSyncKind.None." + }, + { + "name": "willSave", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "If present will save notifications are sent to the server. If omitted the notification should not be\nsent." + }, + { + "name": "willSaveWaitUntil", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "If present will save wait until requests are sent to the server. If omitted the request should not be\nsent." + }, + { + "name": "save", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "SaveOptions" + } + ] + }, + "optional": true, + "documentation": "If present save notifications are sent to the server. If omitted the notification should not be\nsent." + } + ] + }, + { + "name": "NotebookDocumentSyncOptions", + "properties": [ + { + "name": "notebookSelector", + "type": { + "kind": "array", + "element": { + "kind": "or", + "items": [ + { + "kind": "literal", + "value": { + "properties": [ + { + "name": "notebook", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "string" + }, + { + "kind": "reference", + "name": "NotebookDocumentFilter" + } + ] + }, + "documentation": "The notebook to be synced If a string\nvalue is provided it matches against the\nnotebook type. '*' matches every notebook." + }, + { + "name": "cells", + "type": { + "kind": "array", + "element": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "language", + "type": { + "kind": "base", + "name": "string" + } + } + ] + } + } + }, + "optional": true, + "documentation": "The cells of the matching notebook to be synced." + } + ] + } + }, + { + "kind": "literal", + "value": { + "properties": [ + { + "name": "notebook", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "string" + }, + { + "kind": "reference", + "name": "NotebookDocumentFilter" + } + ] + }, + "optional": true, + "documentation": "The notebook to be synced If a string\nvalue is provided it matches against the\nnotebook type. '*' matches every notebook." + }, + { + "name": "cells", + "type": { + "kind": "array", + "element": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "language", + "type": { + "kind": "base", + "name": "string" + } + } + ] + } + } + }, + "documentation": "The cells of the matching notebook to be synced." + } + ] + } + } + ] + } + }, + "documentation": "The notebooks to be synced" + }, + { + "name": "save", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether save notification should be forwarded to\nthe server. Will only be honored if mode === `notebook`." + } + ], + "documentation": "Options specific to a notebook plus its cells\nto be synced to the server.\n\nIf a selector provides a notebook document\nfilter but no cell selector all cells of a\nmatching notebook document will be synced.\n\nIf a selector provides no notebook document\nfilter but only a cell selector all notebook\ndocument that contain at least one matching\ncell will be synced.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "NotebookDocumentSyncRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "NotebookDocumentSyncOptions" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "StaticRegistrationOptions" + } + ], + "documentation": "Registration options specific to a notebook.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "WorkspaceFoldersServerCapabilities", + "properties": [ + { + "name": "supported", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The server has support for workspace folders" + }, + { + "name": "changeNotifications", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "string" + }, + { + "kind": "base", + "name": "boolean" + } + ] + }, + "optional": true, + "documentation": "Whether the server wants to receive workspace folder\nchange notifications.\n\nIf a string is provided the string is treated as an ID\nunder which the notification is registered on the client\nside. The ID can be used to unregister for these events\nusing the `client/unregisterCapability` request." + } + ] + }, + { + "name": "FileOperationOptions", + "properties": [ + { + "name": "didCreate", + "type": { + "kind": "reference", + "name": "FileOperationRegistrationOptions" + }, + "optional": true, + "documentation": "The server is interested in receiving didCreateFiles notifications." + }, + { + "name": "willCreate", + "type": { + "kind": "reference", + "name": "FileOperationRegistrationOptions" + }, + "optional": true, + "documentation": "The server is interested in receiving willCreateFiles requests." + }, + { + "name": "didRename", + "type": { + "kind": "reference", + "name": "FileOperationRegistrationOptions" + }, + "optional": true, + "documentation": "The server is interested in receiving didRenameFiles notifications." + }, + { + "name": "willRename", + "type": { + "kind": "reference", + "name": "FileOperationRegistrationOptions" + }, + "optional": true, + "documentation": "The server is interested in receiving willRenameFiles requests." + }, + { + "name": "didDelete", + "type": { + "kind": "reference", + "name": "FileOperationRegistrationOptions" + }, + "optional": true, + "documentation": "The server is interested in receiving didDeleteFiles file notifications." + }, + { + "name": "willDelete", + "type": { + "kind": "reference", + "name": "FileOperationRegistrationOptions" + }, + "optional": true, + "documentation": "The server is interested in receiving willDeleteFiles file requests." + } + ], + "documentation": "Options for notifications/requests for user operations on files.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "CodeDescription", + "properties": [ + { + "name": "href", + "type": { + "kind": "base", + "name": "URI" + }, + "documentation": "An URI to open with more information about the diagnostic error." + } + ], + "documentation": "Structure to capture a description for an error code.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "DiagnosticRelatedInformation", + "properties": [ + { + "name": "location", + "type": { + "kind": "reference", + "name": "Location" + }, + "documentation": "The location of this related diagnostic information." + }, + { + "name": "message", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The message of this related diagnostic information." + } + ], + "documentation": "Represents a related message and source code location for a diagnostic. This should be\nused to point to code locations that cause or related to a diagnostics, e.g when duplicating\na symbol in a scope." + }, + { + "name": "ParameterInformation", + "properties": [ + { + "name": "label", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "string" + }, + { + "kind": "tuple", + "items": [ + { + "kind": "base", + "name": "uinteger" + }, + { + "kind": "base", + "name": "uinteger" + } + ] + } + ] + }, + "documentation": "The label of this parameter information.\n\nEither a string or an inclusive start and exclusive end offsets within its containing\nsignature label. (see SignatureInformation.label). The offsets are based on a UTF-16\nstring representation as `Position` and `Range` does.\n\n*Note*: a label of type string should be a substring of its containing signature label.\nIts intended use case is to highlight the parameter label part in the `SignatureInformation.label`." + }, + { + "name": "documentation", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "string" + }, + { + "kind": "reference", + "name": "MarkupContent" + } + ] + }, + "optional": true, + "documentation": "The human-readable doc-comment of this parameter. Will be shown\nin the UI but can be omitted." + } + ], + "documentation": "Represents a parameter of a callable-signature. A parameter can\nhave a label and a doc-comment." + }, + { + "name": "NotebookCellTextDocumentFilter", + "properties": [ + { + "name": "notebook", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "string" + }, + { + "kind": "reference", + "name": "NotebookDocumentFilter" + } + ] + }, + "documentation": "A filter that matches against the notebook\ncontaining the notebook cell. If a string\nvalue is provided it matches against the\nnotebook type. '*' matches every notebook." + }, + { + "name": "language", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A language id like `python`.\n\nWill be matched against the language id of the\nnotebook cell document. '*' matches every language." + } + ], + "documentation": "A notebook cell text document filter denotes a cell text\ndocument by different properties.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "FileOperationPatternOptions", + "properties": [ + { + "name": "ignoreCase", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The pattern should be matched ignoring casing." + } + ], + "documentation": "Matching options for the file operation pattern.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "ExecutionSummary", + "properties": [ + { + "name": "executionOrder", + "type": { + "kind": "base", + "name": "uinteger" + }, + "documentation": "A strict monotonically increasing value\nindicating the execution order of a cell\ninside a notebook." + }, + { + "name": "success", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the execution was successful or\nnot if known by the client." + } + ] + }, + { + "name": "WorkspaceClientCapabilities", + "properties": [ + { + "name": "applyEdit", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports applying batch edits\nto the workspace by supporting the request\n'workspace/applyEdit'" + }, + { + "name": "workspaceEdit", + "type": { + "kind": "reference", + "name": "WorkspaceEditClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to `WorkspaceEdit`s." + }, + { + "name": "didChangeConfiguration", + "type": { + "kind": "reference", + "name": "DidChangeConfigurationClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `workspace/didChangeConfiguration` notification." + }, + { + "name": "didChangeWatchedFiles", + "type": { + "kind": "reference", + "name": "DidChangeWatchedFilesClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `workspace/didChangeWatchedFiles` notification." + }, + { + "name": "symbol", + "type": { + "kind": "reference", + "name": "WorkspaceSymbolClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `workspace/symbol` request." + }, + { + "name": "executeCommand", + "type": { + "kind": "reference", + "name": "ExecuteCommandClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `workspace/executeCommand` request." + }, + { + "name": "workspaceFolders", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client has support for workspace folders.\n\n@since 3.6.0", + "since": "3.6.0" + }, + { + "name": "configuration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports `workspace/configuration` requests.\n\n@since 3.6.0", + "since": "3.6.0" + }, + { + "name": "semanticTokens", + "type": { + "kind": "reference", + "name": "SemanticTokensWorkspaceClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the semantic token requests scoped to the\nworkspace.\n\n@since 3.16.0.", + "since": "3.16.0." + }, + { + "name": "codeLens", + "type": { + "kind": "reference", + "name": "CodeLensWorkspaceClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the code lens requests scoped to the\nworkspace.\n\n@since 3.16.0.", + "since": "3.16.0." + }, + { + "name": "fileOperations", + "type": { + "kind": "reference", + "name": "FileOperationClientCapabilities" + }, + "optional": true, + "documentation": "The client has support for file notifications/requests for user operations on files.\n\nSince 3.16.0" + }, + { + "name": "inlineValue", + "type": { + "kind": "reference", + "name": "InlineValueWorkspaceClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the inline values requests scoped to the\nworkspace.\n\n@since 3.17.0.", + "since": "3.17.0." + }, + { + "name": "inlayHint", + "type": { + "kind": "reference", + "name": "InlayHintWorkspaceClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the inlay hint requests scoped to the\nworkspace.\n\n@since 3.17.0.", + "since": "3.17.0." + }, + { + "name": "diagnostics", + "type": { + "kind": "reference", + "name": "DiagnosticWorkspaceClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the diagnostic requests scoped to the\nworkspace.\n\n@since 3.17.0.", + "since": "3.17.0." + }, + { + "name": "foldingRange", + "type": { + "kind": "reference", + "name": "FoldingRangeWorkspaceClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the folding range requests scoped to the workspace.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + } + ], + "documentation": "Workspace specific client capabilities." + }, + { + "name": "TextDocumentClientCapabilities", + "properties": [ + { + "name": "synchronization", + "type": { + "kind": "reference", + "name": "TextDocumentSyncClientCapabilities" + }, + "optional": true, + "documentation": "Defines which synchronization capabilities the client supports." + }, + { + "name": "completion", + "type": { + "kind": "reference", + "name": "CompletionClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/completion` request." + }, + { + "name": "hover", + "type": { + "kind": "reference", + "name": "HoverClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/hover` request." + }, + { + "name": "signatureHelp", + "type": { + "kind": "reference", + "name": "SignatureHelpClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/signatureHelp` request." + }, + { + "name": "declaration", + "type": { + "kind": "reference", + "name": "DeclarationClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/declaration` request.\n\n@since 3.14.0", + "since": "3.14.0" + }, + { + "name": "definition", + "type": { + "kind": "reference", + "name": "DefinitionClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/definition` request." + }, + { + "name": "typeDefinition", + "type": { + "kind": "reference", + "name": "TypeDefinitionClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/typeDefinition` request.\n\n@since 3.6.0", + "since": "3.6.0" + }, + { + "name": "implementation", + "type": { + "kind": "reference", + "name": "ImplementationClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/implementation` request.\n\n@since 3.6.0", + "since": "3.6.0" + }, + { + "name": "references", + "type": { + "kind": "reference", + "name": "ReferenceClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/references` request." + }, + { + "name": "documentHighlight", + "type": { + "kind": "reference", + "name": "DocumentHighlightClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/documentHighlight` request." + }, + { + "name": "documentSymbol", + "type": { + "kind": "reference", + "name": "DocumentSymbolClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/documentSymbol` request." + }, + { + "name": "codeAction", + "type": { + "kind": "reference", + "name": "CodeActionClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/codeAction` request." + }, + { + "name": "codeLens", + "type": { + "kind": "reference", + "name": "CodeLensClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/codeLens` request." + }, + { + "name": "documentLink", + "type": { + "kind": "reference", + "name": "DocumentLinkClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/documentLink` request." + }, + { + "name": "colorProvider", + "type": { + "kind": "reference", + "name": "DocumentColorClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/documentColor` and the\n`textDocument/colorPresentation` request.\n\n@since 3.6.0", + "since": "3.6.0" + }, + { + "name": "formatting", + "type": { + "kind": "reference", + "name": "DocumentFormattingClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/formatting` request." + }, + { + "name": "rangeFormatting", + "type": { + "kind": "reference", + "name": "DocumentRangeFormattingClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/rangeFormatting` request." + }, + { + "name": "onTypeFormatting", + "type": { + "kind": "reference", + "name": "DocumentOnTypeFormattingClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/onTypeFormatting` request." + }, + { + "name": "rename", + "type": { + "kind": "reference", + "name": "RenameClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/rename` request." + }, + { + "name": "foldingRange", + "type": { + "kind": "reference", + "name": "FoldingRangeClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/foldingRange` request.\n\n@since 3.10.0", + "since": "3.10.0" + }, + { + "name": "selectionRange", + "type": { + "kind": "reference", + "name": "SelectionRangeClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/selectionRange` request.\n\n@since 3.15.0", + "since": "3.15.0" + }, + { + "name": "publishDiagnostics", + "type": { + "kind": "reference", + "name": "PublishDiagnosticsClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/publishDiagnostics` notification." + }, + { + "name": "callHierarchy", + "type": { + "kind": "reference", + "name": "CallHierarchyClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the various call hierarchy requests.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "semanticTokens", + "type": { + "kind": "reference", + "name": "SemanticTokensClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the various semantic token request.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "linkedEditingRange", + "type": { + "kind": "reference", + "name": "LinkedEditingRangeClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/linkedEditingRange` request.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "moniker", + "type": { + "kind": "reference", + "name": "MonikerClientCapabilities" + }, + "optional": true, + "documentation": "Client capabilities specific to the `textDocument/moniker` request.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "typeHierarchy", + "type": { + "kind": "reference", + "name": "TypeHierarchyClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the various type hierarchy requests.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "inlineValue", + "type": { + "kind": "reference", + "name": "InlineValueClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/inlineValue` request.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "inlayHint", + "type": { + "kind": "reference", + "name": "InlayHintClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/inlayHint` request.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "diagnostic", + "type": { + "kind": "reference", + "name": "DiagnosticClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the diagnostic pull model.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "inlineCompletion", + "type": { + "kind": "reference", + "name": "InlineCompletionClientCapabilities" + }, + "optional": true, + "documentation": "Client capabilities specific to inline completions.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + } + ], + "documentation": "Text document specific client capabilities." + }, + { + "name": "NotebookDocumentClientCapabilities", + "properties": [ + { + "name": "synchronization", + "type": { + "kind": "reference", + "name": "NotebookDocumentSyncClientCapabilities" + }, + "documentation": "Capabilities specific to notebook document synchronization\n\n@since 3.17.0", + "since": "3.17.0" + } + ], + "documentation": "Capabilities specific to the notebook document support.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "WindowClientCapabilities", + "properties": [ + { + "name": "workDoneProgress", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "It indicates whether the client supports server initiated\nprogress using the `window/workDoneProgress/create` request.\n\nThe capability also controls Whether client supports handling\nof progress notifications. If set servers are allowed to report a\n`workDoneProgress` property in the request specific server\ncapabilities.\n\n@since 3.15.0", + "since": "3.15.0" + }, + { + "name": "showMessage", + "type": { + "kind": "reference", + "name": "ShowMessageRequestClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the showMessage request.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "showDocument", + "type": { + "kind": "reference", + "name": "ShowDocumentClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the showDocument request.\n\n@since 3.16.0", + "since": "3.16.0" + } + ] + }, + { + "name": "GeneralClientCapabilities", + "properties": [ + { + "name": "staleRequestSupport", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "cancel", + "type": { + "kind": "base", + "name": "boolean" + }, + "documentation": "The client will actively cancel the request." + }, + { + "name": "retryOnContentModified", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "documentation": "The list of requests for which the client\nwill retry the request if it receives a\nresponse with error code `ContentModified`" + } + ] + } + }, + "optional": true, + "documentation": "Client capability that signals how the client\nhandles stale requests (e.g. a request\nfor which the client will not process the response\nanymore since the information is outdated).\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "regularExpressions", + "type": { + "kind": "reference", + "name": "RegularExpressionsClientCapabilities" + }, + "optional": true, + "documentation": "Client capabilities specific to regular expressions.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "markdown", + "type": { + "kind": "reference", + "name": "MarkdownClientCapabilities" + }, + "optional": true, + "documentation": "Client capabilities specific to the client's markdown parser.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "positionEncodings", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "PositionEncodingKind" + } + }, + "optional": true, + "documentation": "The position encodings supported by the client. Client and server\nhave to agree on the same position encoding to ensure that offsets\n(e.g. character position in a line) are interpreted the same on both\nsides.\n\nTo keep the protocol backwards compatible the following applies: if\nthe value 'utf-16' is missing from the array of position encodings\nservers can assume that the client supports UTF-16. UTF-16 is\ntherefore a mandatory encoding.\n\nIf omitted it defaults to ['utf-16'].\n\nImplementation considerations: since the conversion from one encoding\ninto another requires the content of the file / line the conversion\nis best done where the file is read which is usually on the server\nside.\n\n@since 3.17.0", + "since": "3.17.0" + } + ], + "documentation": "General client capabilities.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "RelativePattern", + "properties": [ + { + "name": "baseUri", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "WorkspaceFolder" + }, + { + "kind": "base", + "name": "URI" + } + ] + }, + "documentation": "A workspace folder or a base URI to which this pattern will be matched\nagainst relatively." + }, + { + "name": "pattern", + "type": { + "kind": "reference", + "name": "Pattern" + }, + "documentation": "The actual glob pattern;" + } + ], + "documentation": "A relative pattern is a helper to construct glob patterns that are matched\nrelatively to a base URI. The common value for a `baseUri` is a workspace\nfolder root, but it can be another absolute URI as well.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "WorkspaceEditClientCapabilities", + "properties": [ + { + "name": "documentChanges", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports versioned document changes in `WorkspaceEdit`s" + }, + { + "name": "resourceOperations", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "ResourceOperationKind" + } + }, + "optional": true, + "documentation": "The resource operations the client supports. Clients should at least\nsupport 'create', 'rename' and 'delete' files and folders.\n\n@since 3.13.0", + "since": "3.13.0" + }, + { + "name": "failureHandling", + "type": { + "kind": "reference", + "name": "FailureHandlingKind" + }, + "optional": true, + "documentation": "The failure handling strategy of a client if applying the workspace edit\nfails.\n\n@since 3.13.0", + "since": "3.13.0" + }, + { + "name": "normalizesLineEndings", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client normalizes line endings to the client specific\nsetting.\nIf set to `true` the client will normalize line ending characters\nin a workspace edit to the client-specified new line\ncharacter.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "changeAnnotationSupport", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "groupsOnLabel", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client groups edits with equal labels into tree nodes,\nfor instance all edits labelled with \"Changes in Strings\" would\nbe a tree node." + } + ] + } + }, + "optional": true, + "documentation": "Whether the client in general supports change annotations on text edits,\ncreate file, rename file and delete file changes.\n\n@since 3.16.0", + "since": "3.16.0" + } + ] + }, + { + "name": "DidChangeConfigurationClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Did change configuration notification supports dynamic registration." + } + ] + }, + { + "name": "DidChangeWatchedFilesClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Did change watched files notification supports dynamic registration. Please note\nthat the current protocol doesn't support static configuration for file changes\nfrom the server side." + }, + { + "name": "relativePatternSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client has support for {@link RelativePattern relative pattern}\nor not.\n\n@since 3.17.0", + "since": "3.17.0" + } + ] + }, + { + "name": "WorkspaceSymbolClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Symbol request supports dynamic registration." + }, + { + "name": "symbolKind", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "valueSet", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "SymbolKind" + } + }, + "optional": true, + "documentation": "The symbol kind values the client supports. When this\nproperty exists the client also guarantees that it will\nhandle values outside its set gracefully and falls back\nto a default value when unknown.\n\nIf this property is not present the client only supports\nthe symbol kinds from `File` to `Array` as defined in\nthe initial version of the protocol." + } + ] + } + }, + "optional": true, + "documentation": "Specific capabilities for the `SymbolKind` in the `workspace/symbol` request." + }, + { + "name": "tagSupport", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "valueSet", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "SymbolTag" + } + }, + "documentation": "The tags supported by the client." + } + ] + } + }, + "optional": true, + "documentation": "The client supports tags on `SymbolInformation`.\nClients supporting tags have to handle unknown tags gracefully.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "resolveSupport", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "properties", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "documentation": "The properties that a client can resolve lazily. Usually\n`location.range`" + } + ] + } + }, + "optional": true, + "documentation": "The client support partial workspace symbols. The client will send the\nrequest `workspaceSymbol/resolve` to the server to resolve additional\nproperties.\n\n@since 3.17.0", + "since": "3.17.0" + } + ], + "documentation": "Client capabilities for a {@link WorkspaceSymbolRequest}." + }, + { + "name": "ExecuteCommandClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Execute command supports dynamic registration." + } + ], + "documentation": "The client capabilities of a {@link ExecuteCommandRequest}." + }, + { + "name": "SemanticTokensWorkspaceClientCapabilities", + "properties": [ + { + "name": "refreshSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client implementation supports a refresh request sent from\nthe server to the client.\n\nNote that this event is global and will force the client to refresh all\nsemantic tokens currently shown. It should be used with absolute care\nand is useful for situation where a server for example detects a project\nwide change that requires such a calculation." + } + ], + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "CodeLensWorkspaceClientCapabilities", + "properties": [ + { + "name": "refreshSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client implementation supports a refresh request sent from the\nserver to the client.\n\nNote that this event is global and will force the client to refresh all\ncode lenses currently shown. It should be used with absolute care and is\nuseful for situation where a server for example detect a project wide\nchange that requires such a calculation." + } + ], + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "FileOperationClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client supports dynamic registration for file requests/notifications." + }, + { + "name": "didCreate", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client has support for sending didCreateFiles notifications." + }, + { + "name": "willCreate", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client has support for sending willCreateFiles requests." + }, + { + "name": "didRename", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client has support for sending didRenameFiles notifications." + }, + { + "name": "willRename", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client has support for sending willRenameFiles requests." + }, + { + "name": "didDelete", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client has support for sending didDeleteFiles notifications." + }, + { + "name": "willDelete", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client has support for sending willDeleteFiles requests." + } + ], + "documentation": "Capabilities relating to events from file operations by the user in the client.\n\nThese events do not come from the file system, they come from user operations\nlike renaming a file in the UI.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "InlineValueWorkspaceClientCapabilities", + "properties": [ + { + "name": "refreshSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client implementation supports a refresh request sent from the\nserver to the client.\n\nNote that this event is global and will force the client to refresh all\ninline values currently shown. It should be used with absolute care and is\nuseful for situation where a server for example detects a project wide\nchange that requires such a calculation." + } + ], + "documentation": "Client workspace capabilities specific to inline values.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "InlayHintWorkspaceClientCapabilities", + "properties": [ + { + "name": "refreshSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client implementation supports a refresh request sent from\nthe server to the client.\n\nNote that this event is global and will force the client to refresh all\ninlay hints currently shown. It should be used with absolute care and\nis useful for situation where a server for example detects a project wide\nchange that requires such a calculation." + } + ], + "documentation": "Client workspace capabilities specific to inlay hints.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "DiagnosticWorkspaceClientCapabilities", + "properties": [ + { + "name": "refreshSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client implementation supports a refresh request sent from\nthe server to the client.\n\nNote that this event is global and will force the client to refresh all\npulled diagnostics currently shown. It should be used with absolute care and\nis useful for situation where a server for example detects a project wide\nchange that requires such a calculation." + } + ], + "documentation": "Workspace client capabilities specific to diagnostic pull requests.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "FoldingRangeWorkspaceClientCapabilities", + "properties": [ + { + "name": "refreshSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client implementation supports a refresh request sent from the\nserver to the client.\n\nNote that this event is global and will force the client to refresh all\nfolding ranges currently shown. It should be used with absolute care and is\nuseful for situation where a server for example detects a project wide\nchange that requires such a calculation.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + } + ], + "documentation": "Client workspace capabilities specific to folding ranges\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "TextDocumentSyncClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether text document synchronization supports dynamic registration." + }, + { + "name": "willSave", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports sending will save notifications." + }, + { + "name": "willSaveWaitUntil", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports sending a will save request and\nwaits for a response providing text edits which will\nbe applied to the document before it is saved." + }, + { + "name": "didSave", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports did save notifications." + } + ] + }, + { + "name": "CompletionClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether completion supports dynamic registration." + }, + { + "name": "completionItem", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "snippetSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Client supports snippets as insert text.\n\nA snippet can define tab stops and placeholders with `$1`, `$2`\nand `${3:foo}`. `$0` defines the final tab stop, it defaults to\nthe end of the snippet. Placeholders with equal identifiers are linked,\nthat is typing in one will update others too." + }, + { + "name": "commitCharactersSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Client supports commit characters on a completion item." + }, + { + "name": "documentationFormat", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "MarkupKind" + } + }, + "optional": true, + "documentation": "Client supports the following content formats for the documentation\nproperty. The order describes the preferred format of the client." + }, + { + "name": "deprecatedSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Client supports the deprecated property on a completion item." + }, + { + "name": "preselectSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Client supports the preselect property on a completion item." + }, + { + "name": "tagSupport", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "valueSet", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "CompletionItemTag" + } + }, + "documentation": "The tags supported by the client." + } + ] + } + }, + "optional": true, + "documentation": "Client supports the tag property on a completion item. Clients supporting\ntags have to handle unknown tags gracefully. Clients especially need to\npreserve unknown tags when sending a completion item back to the server in\na resolve call.\n\n@since 3.15.0", + "since": "3.15.0" + }, + { + "name": "insertReplaceSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Client support insert replace edit to control different behavior if a\ncompletion item is inserted in the text or should replace text.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "resolveSupport", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "properties", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "documentation": "The properties that a client can resolve lazily." + } + ] + } + }, + "optional": true, + "documentation": "Indicates which properties a client can resolve lazily on a completion\nitem. Before version 3.16.0 only the predefined properties `documentation`\nand `details` could be resolved lazily.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "insertTextModeSupport", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "valueSet", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "InsertTextMode" + } + } + } + ] + } + }, + "optional": true, + "documentation": "The client supports the `insertTextMode` property on\na completion item to override the whitespace handling mode\nas defined by the client (see `insertTextMode`).\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "labelDetailsSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client has support for completion item label\ndetails (see also `CompletionItemLabelDetails`).\n\n@since 3.17.0", + "since": "3.17.0" + } + ] + } + }, + "optional": true, + "documentation": "The client supports the following `CompletionItem` specific\ncapabilities." + }, + { + "name": "completionItemKind", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "valueSet", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "CompletionItemKind" + } + }, + "optional": true, + "documentation": "The completion item kind values the client supports. When this\nproperty exists the client also guarantees that it will\nhandle values outside its set gracefully and falls back\nto a default value when unknown.\n\nIf this property is not present the client only supports\nthe completion items kinds from `Text` to `Reference` as defined in\nthe initial version of the protocol." + } + ] + } + }, + "optional": true + }, + { + "name": "insertTextMode", + "type": { + "kind": "reference", + "name": "InsertTextMode" + }, + "optional": true, + "documentation": "Defines how the client handles whitespace and indentation\nwhen accepting a completion item that uses multi line\ntext in either `insertText` or `textEdit`.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "contextSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports to send additional context information for a\n`textDocument/completion` request." + }, + { + "name": "completionList", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "itemDefaults", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "optional": true, + "documentation": "The client supports the following itemDefaults on\na completion list.\n\nThe value lists the supported property names of the\n`CompletionList.itemDefaults` object. If omitted\nno properties are supported.\n\n@since 3.17.0", + "since": "3.17.0" + } + ] + } + }, + "optional": true, + "documentation": "The client supports the following `CompletionList` specific\ncapabilities.\n\n@since 3.17.0", + "since": "3.17.0" + } + ], + "documentation": "Completion client capabilities" + }, + { + "name": "HoverClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether hover supports dynamic registration." + }, + { + "name": "contentFormat", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "MarkupKind" + } + }, + "optional": true, + "documentation": "Client supports the following content formats for the content\nproperty. The order describes the preferred format of the client." + } + ] + }, + { + "name": "SignatureHelpClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether signature help supports dynamic registration." + }, + { + "name": "signatureInformation", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "documentationFormat", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "MarkupKind" + } + }, + "optional": true, + "documentation": "Client supports the following content formats for the documentation\nproperty. The order describes the preferred format of the client." + }, + { + "name": "parameterInformation", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "labelOffsetSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports processing label offsets instead of a\nsimple label string.\n\n@since 3.14.0", + "since": "3.14.0" + } + ] + } + }, + "optional": true, + "documentation": "Client capabilities specific to parameter information." + }, + { + "name": "activeParameterSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports the `activeParameter` property on `SignatureInformation`\nliteral.\n\n@since 3.16.0", + "since": "3.16.0" + } + ] + } + }, + "optional": true, + "documentation": "The client supports the following `SignatureInformation`\nspecific properties." + }, + { + "name": "contextSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports to send additional context information for a\n`textDocument/signatureHelp` request. A client that opts into\ncontextSupport will also support the `retriggerCharacters` on\n`SignatureHelpOptions`.\n\n@since 3.15.0", + "since": "3.15.0" + } + ], + "documentation": "Client Capabilities for a {@link SignatureHelpRequest}." + }, + { + "name": "DeclarationClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether declaration supports dynamic registration. If this is set to `true`\nthe client supports the new `DeclarationRegistrationOptions` return value\nfor the corresponding server capability as well." + }, + { + "name": "linkSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports additional metadata in the form of declaration links." + } + ], + "documentation": "@since 3.14.0", + "since": "3.14.0" + }, + { + "name": "DefinitionClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether definition supports dynamic registration." + }, + { + "name": "linkSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports additional metadata in the form of definition links.\n\n@since 3.14.0", + "since": "3.14.0" + } + ], + "documentation": "Client Capabilities for a {@link DefinitionRequest}." + }, + { + "name": "TypeDefinitionClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `TypeDefinitionRegistrationOptions` return value\nfor the corresponding server capability as well." + }, + { + "name": "linkSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports additional metadata in the form of definition links.\n\nSince 3.14.0" + } + ], + "documentation": "Since 3.6.0" + }, + { + "name": "ImplementationClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `ImplementationRegistrationOptions` return value\nfor the corresponding server capability as well." + }, + { + "name": "linkSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports additional metadata in the form of definition links.\n\n@since 3.14.0", + "since": "3.14.0" + } + ], + "documentation": "@since 3.6.0", + "since": "3.6.0" + }, + { + "name": "ReferenceClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether references supports dynamic registration." + } + ], + "documentation": "Client Capabilities for a {@link ReferencesRequest}." + }, + { + "name": "DocumentHighlightClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether document highlight supports dynamic registration." + } + ], + "documentation": "Client Capabilities for a {@link DocumentHighlightRequest}." + }, + { + "name": "DocumentSymbolClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether document symbol supports dynamic registration." + }, + { + "name": "symbolKind", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "valueSet", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "SymbolKind" + } + }, + "optional": true, + "documentation": "The symbol kind values the client supports. When this\nproperty exists the client also guarantees that it will\nhandle values outside its set gracefully and falls back\nto a default value when unknown.\n\nIf this property is not present the client only supports\nthe symbol kinds from `File` to `Array` as defined in\nthe initial version of the protocol." + } + ] + } + }, + "optional": true, + "documentation": "Specific capabilities for the `SymbolKind` in the\n`textDocument/documentSymbol` request." + }, + { + "name": "hierarchicalDocumentSymbolSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports hierarchical document symbols." + }, + { + "name": "tagSupport", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "valueSet", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "SymbolTag" + } + }, + "documentation": "The tags supported by the client." + } + ] + } + }, + "optional": true, + "documentation": "The client supports tags on `SymbolInformation`. Tags are supported on\n`DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set to true.\nClients supporting tags have to handle unknown tags gracefully.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "labelSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports an additional label presented in the UI when\nregistering a document symbol provider.\n\n@since 3.16.0", + "since": "3.16.0" + } + ], + "documentation": "Client Capabilities for a {@link DocumentSymbolRequest}." + }, + { + "name": "CodeActionClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether code action supports dynamic registration." + }, + { + "name": "codeActionLiteralSupport", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "codeActionKind", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "valueSet", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "CodeActionKind" + } + }, + "documentation": "The code action kind values the client supports. When this\nproperty exists the client also guarantees that it will\nhandle values outside its set gracefully and falls back\nto a default value when unknown." + } + ] + } + }, + "documentation": "The code action kind is support with the following value\nset." + } + ] + } + }, + "optional": true, + "documentation": "The client support code action literals of type `CodeAction` as a valid\nresponse of the `textDocument/codeAction` request. If the property is not\nset the request can only return `Command` literals.\n\n@since 3.8.0", + "since": "3.8.0" + }, + { + "name": "isPreferredSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether code action supports the `isPreferred` property.\n\n@since 3.15.0", + "since": "3.15.0" + }, + { + "name": "disabledSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether code action supports the `disabled` property.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "dataSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether code action supports the `data` property which is\npreserved between a `textDocument/codeAction` and a\n`codeAction/resolve` request.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "resolveSupport", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "properties", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "documentation": "The properties that a client can resolve lazily." + } + ] + } + }, + "optional": true, + "documentation": "Whether the client supports resolving additional code action\nproperties via a separate `codeAction/resolve` request.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "honorsChangeAnnotations", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client honors the change annotations in\ntext edits and resource operations returned via the\n`CodeAction#edit` property by for example presenting\nthe workspace edit in the user interface and asking\nfor confirmation.\n\n@since 3.16.0", + "since": "3.16.0" + } + ], + "documentation": "The Client Capabilities of a {@link CodeActionRequest}." + }, + { + "name": "CodeLensClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether code lens supports dynamic registration." + } + ], + "documentation": "The client capabilities of a {@link CodeLensRequest}." + }, + { + "name": "DocumentLinkClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether document link supports dynamic registration." + }, + { + "name": "tooltipSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client supports the `tooltip` property on `DocumentLink`.\n\n@since 3.15.0", + "since": "3.15.0" + } + ], + "documentation": "The client capabilities of a {@link DocumentLinkRequest}." + }, + { + "name": "DocumentColorClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `DocumentColorRegistrationOptions` return value\nfor the corresponding server capability as well." + } + ] + }, + { + "name": "DocumentFormattingClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether formatting supports dynamic registration." + } + ], + "documentation": "Client capabilities of a {@link DocumentFormattingRequest}." + }, + { + "name": "DocumentRangeFormattingClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether range formatting supports dynamic registration." + }, + { + "name": "rangesSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client supports formatting multiple ranges at once.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + } + ], + "documentation": "Client capabilities of a {@link DocumentRangeFormattingRequest}." + }, + { + "name": "DocumentOnTypeFormattingClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether on type formatting supports dynamic registration." + } + ], + "documentation": "Client capabilities of a {@link DocumentOnTypeFormattingRequest}." + }, + { + "name": "RenameClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether rename supports dynamic registration." + }, + { + "name": "prepareSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Client supports testing for validity of rename operations\nbefore execution.\n\n@since 3.12.0", + "since": "3.12.0" + }, + { + "name": "prepareSupportDefaultBehavior", + "type": { + "kind": "reference", + "name": "PrepareSupportDefaultBehavior" + }, + "optional": true, + "documentation": "Client supports the default behavior result.\n\nThe value indicates the default behavior used by the\nclient.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "honorsChangeAnnotations", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client honors the change annotations in\ntext edits and resource operations returned via the\nrename request's workspace edit by for example presenting\nthe workspace edit in the user interface and asking\nfor confirmation.\n\n@since 3.16.0", + "since": "3.16.0" + } + ] + }, + { + "name": "FoldingRangeClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether implementation supports dynamic registration for folding range\nproviders. If this is set to `true` the client supports the new\n`FoldingRangeRegistrationOptions` return value for the corresponding\nserver capability as well." + }, + { + "name": "rangeLimit", + "type": { + "kind": "base", + "name": "uinteger" + }, + "optional": true, + "documentation": "The maximum number of folding ranges that the client prefers to receive\nper document. The value serves as a hint, servers are free to follow the\nlimit." + }, + { + "name": "lineFoldingOnly", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "If set, the client signals that it only supports folding complete lines.\nIf set, client will ignore specified `startCharacter` and `endCharacter`\nproperties in a FoldingRange." + }, + { + "name": "foldingRangeKind", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "valueSet", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "FoldingRangeKind" + } + }, + "optional": true, + "documentation": "The folding range kind values the client supports. When this\nproperty exists the client also guarantees that it will\nhandle values outside its set gracefully and falls back\nto a default value when unknown." + } + ] + } + }, + "optional": true, + "documentation": "Specific options for the folding range kind.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "foldingRange", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "collapsedText", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "If set, the client signals that it supports setting collapsedText on\nfolding ranges to display custom labels instead of the default text.\n\n@since 3.17.0", + "since": "3.17.0" + } + ] + } + }, + "optional": true, + "documentation": "Specific options for the folding range.\n\n@since 3.17.0", + "since": "3.17.0" + } + ] + }, + { + "name": "SelectionRangeClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether implementation supports dynamic registration for selection range providers. If this is set to `true`\nthe client supports the new `SelectionRangeRegistrationOptions` return value for the corresponding server\ncapability as well." + } + ] + }, + { + "name": "PublishDiagnosticsClientCapabilities", + "properties": [ + { + "name": "relatedInformation", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the clients accepts diagnostics with related information." + }, + { + "name": "tagSupport", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "valueSet", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "DiagnosticTag" + } + }, + "documentation": "The tags supported by the client." + } + ] + } + }, + "optional": true, + "documentation": "Client supports the tag property to provide meta data about a diagnostic.\nClients supporting tags have to handle unknown tags gracefully.\n\n@since 3.15.0", + "since": "3.15.0" + }, + { + "name": "versionSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client interprets the version property of the\n`textDocument/publishDiagnostics` notification's parameter.\n\n@since 3.15.0", + "since": "3.15.0" + }, + { + "name": "codeDescriptionSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Client supports a codeDescription property\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "dataSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether code action supports the `data` property which is\npreserved between a `textDocument/publishDiagnostics` and\n`textDocument/codeAction` request.\n\n@since 3.16.0", + "since": "3.16.0" + } + ], + "documentation": "The publish diagnostic client capabilities." + }, + { + "name": "CallHierarchyClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`\nreturn value for the corresponding server capability as well." + } + ], + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "SemanticTokensClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`\nreturn value for the corresponding server capability as well." + }, + { + "name": "requests", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "range", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "literal", + "value": { + "properties": [] + } + } + ] + }, + "optional": true, + "documentation": "The client will send the `textDocument/semanticTokens/range` request if\nthe server provides a corresponding handler." + }, + { + "name": "full", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "literal", + "value": { + "properties": [ + { + "name": "delta", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client will send the `textDocument/semanticTokens/full/delta` request if\nthe server provides a corresponding handler." + } + ] + } + } + ] + }, + "optional": true, + "documentation": "The client will send the `textDocument/semanticTokens/full` request if\nthe server provides a corresponding handler." + } + ] + } + }, + "documentation": "Which requests the client supports and might send to the server\ndepending on the server's capability. Please note that clients might not\nshow semantic tokens or degrade some of the user experience if a range\nor full request is advertised by the client but not provided by the\nserver. If for example the client capability `requests.full` and\n`request.range` are both set to true but the server only provides a\nrange provider the client might not render a minimap correctly or might\neven decide to not show any semantic tokens at all." + }, + { + "name": "tokenTypes", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "documentation": "The token types that the client supports." + }, + { + "name": "tokenModifiers", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "documentation": "The token modifiers that the client supports." + }, + { + "name": "formats", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "TokenFormat" + } + }, + "documentation": "The token formats the clients supports." + }, + { + "name": "overlappingTokenSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client supports tokens that can overlap each other." + }, + { + "name": "multilineTokenSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client supports tokens that can span multiple lines." + }, + { + "name": "serverCancelSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client allows the server to actively cancel a\nsemantic token request, e.g. supports returning\nLSPErrorCodes.ServerCancelled. If a server does the client\nneeds to retrigger the request.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "augmentsSyntaxTokens", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client uses semantic tokens to augment existing\nsyntax tokens. If set to `true` client side created syntax\ntokens and semantic tokens are both used for colorization. If\nset to `false` the client only uses the returned semantic tokens\nfor colorization.\n\nIf the value is `undefined` then the client behavior is not\nspecified.\n\n@since 3.17.0", + "since": "3.17.0" + } + ], + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "LinkedEditingRangeClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`\nreturn value for the corresponding server capability as well." + } + ], + "documentation": "Client capabilities for the linked editing range request.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "MonikerClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether moniker supports dynamic registration. If this is set to `true`\nthe client supports the new `MonikerRegistrationOptions` return value\nfor the corresponding server capability as well." + } + ], + "documentation": "Client capabilities specific to the moniker request.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "TypeHierarchyClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`\nreturn value for the corresponding server capability as well." + } + ], + "documentation": "@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "InlineValueClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether implementation supports dynamic registration for inline value providers." + } + ], + "documentation": "Client capabilities specific to inline values.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "InlayHintClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether inlay hints support dynamic registration." + }, + { + "name": "resolveSupport", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "properties", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "documentation": "The properties that a client can resolve lazily." + } + ] + } + }, + "optional": true, + "documentation": "Indicates which properties a client can resolve lazily on an inlay\nhint." + } + ], + "documentation": "Inlay hint client capabilities.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "DiagnosticClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`\nreturn value for the corresponding server capability as well." + }, + { + "name": "relatedDocumentSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the clients supports related documents for document diagnostic pulls." + } + ], + "documentation": "Client capabilities specific to diagnostic pull requests.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "InlineCompletionClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether implementation supports dynamic registration for inline completion providers." + } + ], + "documentation": "Client capabilities specific to inline completions.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "NotebookDocumentSyncClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether implementation supports dynamic registration. If this is\nset to `true` the client supports the new\n`(TextDocumentRegistrationOptions & StaticRegistrationOptions)`\nreturn value for the corresponding server capability as well." + }, + { + "name": "executionSummarySupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports sending execution summary data per cell." + } + ], + "documentation": "Notebook specific client capabilities.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "ShowMessageRequestClientCapabilities", + "properties": [ + { + "name": "messageActionItem", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "additionalPropertiesSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client supports additional attributes which\nare preserved and send back to the server in the\nrequest's response." + } + ] + } + }, + "optional": true, + "documentation": "Capabilities specific to the `MessageActionItem` type." + } + ], + "documentation": "Show message request client capabilities" + }, + { + "name": "ShowDocumentClientCapabilities", + "properties": [ + { + "name": "support", + "type": { + "kind": "base", + "name": "boolean" + }, + "documentation": "The client has support for the showDocument\nrequest." + } + ], + "documentation": "Client capabilities for the showDocument request.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "RegularExpressionsClientCapabilities", + "properties": [ + { + "name": "engine", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The engine's name." + }, + { + "name": "version", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The engine's version." + } + ], + "documentation": "Client capabilities specific to regular expressions.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "MarkdownClientCapabilities", + "properties": [ + { + "name": "parser", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The name of the parser." + }, + { + "name": "version", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The version of the parser." + }, + { + "name": "allowedTags", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "optional": true, + "documentation": "A list of HTML tags that the client allows / supports in\nMarkdown.\n\n@since 3.17.0", + "since": "3.17.0" + } + ], + "documentation": "Client capabilities specific to the used markdown parser.\n\n@since 3.16.0", + "since": "3.16.0" + } + ], + "enumerations": [ + { + "name": "SemanticTokenTypes", + "type": { + "kind": "base", + "name": "string" + }, + "values": [ + { + "name": "namespace", + "value": "namespace" + }, + { + "name": "type", + "value": "type", + "documentation": "Represents a generic type. Acts as a fallback for types which can't be mapped to\na specific type like class or enum." + }, + { + "name": "class", + "value": "class" + }, + { + "name": "enum", + "value": "enum" + }, + { + "name": "interface", + "value": "interface" + }, + { + "name": "struct", + "value": "struct" + }, + { + "name": "typeParameter", + "value": "typeParameter" + }, + { + "name": "parameter", + "value": "parameter" + }, + { + "name": "variable", + "value": "variable" + }, + { + "name": "property", + "value": "property" + }, + { + "name": "enumMember", + "value": "enumMember" + }, + { + "name": "event", + "value": "event" + }, + { + "name": "function", + "value": "function" + }, + { + "name": "method", + "value": "method" + }, + { + "name": "macro", + "value": "macro" + }, + { + "name": "keyword", + "value": "keyword" + }, + { + "name": "modifier", + "value": "modifier" + }, + { + "name": "comment", + "value": "comment" + }, + { + "name": "string", + "value": "string" + }, + { + "name": "number", + "value": "number" + }, + { + "name": "regexp", + "value": "regexp" + }, + { + "name": "operator", + "value": "operator" + }, + { + "name": "decorator", + "value": "decorator", + "documentation": "@since 3.17.0", + "since": "3.17.0" + } + ], + "supportsCustomValues": true, + "documentation": "A set of predefined token types. This set is not fixed\nan clients can specify additional token types via the\ncorresponding client capabilities.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "SemanticTokenModifiers", + "type": { + "kind": "base", + "name": "string" + }, + "values": [ + { + "name": "declaration", + "value": "declaration" + }, + { + "name": "definition", + "value": "definition" + }, + { + "name": "readonly", + "value": "readonly" + }, + { + "name": "static", + "value": "static" + }, + { + "name": "deprecated", + "value": "deprecated" + }, + { + "name": "abstract", + "value": "abstract" + }, + { + "name": "async", + "value": "async" + }, + { + "name": "modification", + "value": "modification" + }, + { + "name": "documentation", + "value": "documentation" + }, + { + "name": "defaultLibrary", + "value": "defaultLibrary" + } + ], + "supportsCustomValues": true, + "documentation": "A set of predefined token modifiers. This set is not fixed\nan clients can specify additional token types via the\ncorresponding client capabilities.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "DocumentDiagnosticReportKind", + "type": { + "kind": "base", + "name": "string" + }, + "values": [ + { + "name": "Full", + "value": "full", + "documentation": "A diagnostic report with a full\nset of problems." + }, + { + "name": "Unchanged", + "value": "unchanged", + "documentation": "A report indicating that the last\nreturned report is still accurate." + } + ], + "documentation": "The document diagnostic report kinds.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "ErrorCodes", + "type": { + "kind": "base", + "name": "integer" + }, + "values": [ + { + "name": "ParseError", + "value": -32700 + }, + { + "name": "InvalidRequest", + "value": -32600 + }, + { + "name": "MethodNotFound", + "value": -32601 + }, + { + "name": "InvalidParams", + "value": -32602 + }, + { + "name": "InternalError", + "value": -32603 + }, + { + "name": "ServerNotInitialized", + "value": -32002, + "documentation": "Error code indicating that a server received a notification or\nrequest before the server has received the `initialize` request." + }, + { + "name": "UnknownErrorCode", + "value": -32001 + } + ], + "supportsCustomValues": true, + "documentation": "Predefined error codes." + }, + { + "name": "LSPErrorCodes", + "type": { + "kind": "base", + "name": "integer" + }, + "values": [ + { + "name": "RequestFailed", + "value": -32803, + "documentation": "A request failed but it was syntactically correct, e.g the\nmethod name was known and the parameters were valid. The error\nmessage should contain human readable information about why\nthe request failed.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "ServerCancelled", + "value": -32802, + "documentation": "The server cancelled the request. This error code should\nonly be used for requests that explicitly support being\nserver cancellable.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "ContentModified", + "value": -32801, + "documentation": "The server detected that the content of a document got\nmodified outside normal conditions. A server should\nNOT send this error code if it detects a content change\nin it unprocessed messages. The result even computed\non an older state might still be useful for the client.\n\nIf a client decides that a result is not of any use anymore\nthe client should cancel the request." + }, + { + "name": "RequestCancelled", + "value": -32800, + "documentation": "The client has canceled a request and a server has detected\nthe cancel." + } + ], + "supportsCustomValues": true + }, + { + "name": "FoldingRangeKind", + "type": { + "kind": "base", + "name": "string" + }, + "values": [ + { + "name": "Comment", + "value": "comment", + "documentation": "Folding range for a comment" + }, + { + "name": "Imports", + "value": "imports", + "documentation": "Folding range for an import or include" + }, + { + "name": "Region", + "value": "region", + "documentation": "Folding range for a region (e.g. `#region`)" + } + ], + "supportsCustomValues": true, + "documentation": "A set of predefined range kinds." + }, + { + "name": "SymbolKind", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "File", + "value": 1 + }, + { + "name": "Module", + "value": 2 + }, + { + "name": "Namespace", + "value": 3 + }, + { + "name": "Package", + "value": 4 + }, + { + "name": "Class", + "value": 5 + }, + { + "name": "Method", + "value": 6 + }, + { + "name": "Property", + "value": 7 + }, + { + "name": "Field", + "value": 8 + }, + { + "name": "Constructor", + "value": 9 + }, + { + "name": "Enum", + "value": 10 + }, + { + "name": "Interface", + "value": 11 + }, + { + "name": "Function", + "value": 12 + }, + { + "name": "Variable", + "value": 13 + }, + { + "name": "Constant", + "value": 14 + }, + { + "name": "String", + "value": 15 + }, + { + "name": "Number", + "value": 16 + }, + { + "name": "Boolean", + "value": 17 + }, + { + "name": "Array", + "value": 18 + }, + { + "name": "Object", + "value": 19 + }, + { + "name": "Key", + "value": 20 + }, + { + "name": "Null", + "value": 21 + }, + { + "name": "EnumMember", + "value": 22 + }, + { + "name": "Struct", + "value": 23 + }, + { + "name": "Event", + "value": 24 + }, + { + "name": "Operator", + "value": 25 + }, + { + "name": "TypeParameter", + "value": 26 + } + ], + "documentation": "A symbol kind." + }, + { + "name": "SymbolTag", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "Deprecated", + "value": 1, + "documentation": "Render a symbol as obsolete, usually using a strike-out." + } + ], + "documentation": "Symbol tags are extra annotations that tweak the rendering of a symbol.\n\n@since 3.16", + "since": "3.16" + }, + { + "name": "UniquenessLevel", + "type": { + "kind": "base", + "name": "string" + }, + "values": [ + { + "name": "document", + "value": "document", + "documentation": "The moniker is only unique inside a document" + }, + { + "name": "project", + "value": "project", + "documentation": "The moniker is unique inside a project for which a dump got created" + }, + { + "name": "group", + "value": "group", + "documentation": "The moniker is unique inside the group to which a project belongs" + }, + { + "name": "scheme", + "value": "scheme", + "documentation": "The moniker is unique inside the moniker scheme." + }, + { + "name": "global", + "value": "global", + "documentation": "The moniker is globally unique" + } + ], + "documentation": "Moniker uniqueness level to define scope of the moniker.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "MonikerKind", + "type": { + "kind": "base", + "name": "string" + }, + "values": [ + { + "name": "import", + "value": "import", + "documentation": "The moniker represent a symbol that is imported into a project" + }, + { + "name": "export", + "value": "export", + "documentation": "The moniker represents a symbol that is exported from a project" + }, + { + "name": "local", + "value": "local", + "documentation": "The moniker represents a symbol that is local to a project (e.g. a local\nvariable of a function, a class not visible outside the project, ...)" + } + ], + "documentation": "The moniker kind.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "InlayHintKind", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "Type", + "value": 1, + "documentation": "An inlay hint that for a type annotation." + }, + { + "name": "Parameter", + "value": 2, + "documentation": "An inlay hint that is for a parameter." + } + ], + "documentation": "Inlay hint kinds.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "MessageType", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "Error", + "value": 1, + "documentation": "An error message." + }, + { + "name": "Warning", + "value": 2, + "documentation": "A warning message." + }, + { + "name": "Info", + "value": 3, + "documentation": "An information message." + }, + { + "name": "Log", + "value": 4, + "documentation": "A log message." + }, + { + "name": "Debug", + "value": 5, + "documentation": "A debug message.\n\n@since 3.18.0", + "since": "3.18.0" + } + ], + "documentation": "The message type" + }, + { + "name": "TextDocumentSyncKind", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "None", + "value": 0, + "documentation": "Documents should not be synced at all." + }, + { + "name": "Full", + "value": 1, + "documentation": "Documents are synced by always sending the full content\nof the document." + }, + { + "name": "Incremental", + "value": 2, + "documentation": "Documents are synced by sending the full content on open.\nAfter that only incremental updates to the document are\nsend." + } + ], + "documentation": "Defines how the host (editor) should sync\ndocument changes to the language server." + }, + { + "name": "TextDocumentSaveReason", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "Manual", + "value": 1, + "documentation": "Manually triggered, e.g. by the user pressing save, by starting debugging,\nor by an API call." + }, + { + "name": "AfterDelay", + "value": 2, + "documentation": "Automatic after a delay." + }, + { + "name": "FocusOut", + "value": 3, + "documentation": "When the editor lost focus." + } + ], + "documentation": "Represents reasons why a text document is saved." + }, + { + "name": "CompletionItemKind", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "Text", + "value": 1 + }, + { + "name": "Method", + "value": 2 + }, + { + "name": "Function", + "value": 3 + }, + { + "name": "Constructor", + "value": 4 + }, + { + "name": "Field", + "value": 5 + }, + { + "name": "Variable", + "value": 6 + }, + { + "name": "Class", + "value": 7 + }, + { + "name": "Interface", + "value": 8 + }, + { + "name": "Module", + "value": 9 + }, + { + "name": "Property", + "value": 10 + }, + { + "name": "Unit", + "value": 11 + }, + { + "name": "Value", + "value": 12 + }, + { + "name": "Enum", + "value": 13 + }, + { + "name": "Keyword", + "value": 14 + }, + { + "name": "Snippet", + "value": 15 + }, + { + "name": "Color", + "value": 16 + }, + { + "name": "File", + "value": 17 + }, + { + "name": "Reference", + "value": 18 + }, + { + "name": "Folder", + "value": 19 + }, + { + "name": "EnumMember", + "value": 20 + }, + { + "name": "Constant", + "value": 21 + }, + { + "name": "Struct", + "value": 22 + }, + { + "name": "Event", + "value": 23 + }, + { + "name": "Operator", + "value": 24 + }, + { + "name": "TypeParameter", + "value": 25 + } + ], + "documentation": "The kind of a completion entry." + }, + { + "name": "CompletionItemTag", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "Deprecated", + "value": 1, + "documentation": "Render a completion as obsolete, usually using a strike-out." + } + ], + "documentation": "Completion item tags are extra annotations that tweak the rendering of a completion\nitem.\n\n@since 3.15.0", + "since": "3.15.0" + }, + { + "name": "InsertTextFormat", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "PlainText", + "value": 1, + "documentation": "The primary text to be inserted is treated as a plain string." + }, + { + "name": "Snippet", + "value": 2, + "documentation": "The primary text to be inserted is treated as a snippet.\n\nA snippet can define tab stops and placeholders with `$1`, `$2`\nand `${3:foo}`. `$0` defines the final tab stop, it defaults to\nthe end of the snippet. Placeholders with equal identifiers are linked,\nthat is typing in one will update others too.\n\nSee also: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#snippet_syntax" + } + ], + "documentation": "Defines whether the insert text in a completion item should be interpreted as\nplain text or a snippet." + }, + { + "name": "InsertTextMode", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "asIs", + "value": 1, + "documentation": "The insertion or replace strings is taken as it is. If the\nvalue is multi line the lines below the cursor will be\ninserted using the indentation defined in the string value.\nThe client will not apply any kind of adjustments to the\nstring." + }, + { + "name": "adjustIndentation", + "value": 2, + "documentation": "The editor adjusts leading whitespace of new lines so that\nthey match the indentation up to the cursor of the line for\nwhich the item is accepted.\n\nConsider a line like this: <2tabs><3tabs>foo. Accepting a\nmulti line completion item is indented using 2 tabs and all\nfollowing lines inserted will be indented using 2 tabs as well." + } + ], + "documentation": "How whitespace and indentation is handled during completion\nitem insertion.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "DocumentHighlightKind", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "Text", + "value": 1, + "documentation": "A textual occurrence." + }, + { + "name": "Read", + "value": 2, + "documentation": "Read-access of a symbol, like reading a variable." + }, + { + "name": "Write", + "value": 3, + "documentation": "Write-access of a symbol, like writing to a variable." + } + ], + "documentation": "A document highlight kind." + }, + { + "name": "CodeActionKind", + "type": { + "kind": "base", + "name": "string" + }, + "values": [ + { + "name": "Empty", + "value": "", + "documentation": "Empty kind." + }, + { + "name": "QuickFix", + "value": "quickfix", + "documentation": "Base kind for quickfix actions: 'quickfix'" + }, + { + "name": "Refactor", + "value": "refactor", + "documentation": "Base kind for refactoring actions: 'refactor'" + }, + { + "name": "RefactorExtract", + "value": "refactor.extract", + "documentation": "Base kind for refactoring extraction actions: 'refactor.extract'\n\nExample extract actions:\n\n- Extract method\n- Extract function\n- Extract variable\n- Extract interface from class\n- ..." + }, + { + "name": "RefactorInline", + "value": "refactor.inline", + "documentation": "Base kind for refactoring inline actions: 'refactor.inline'\n\nExample inline actions:\n\n- Inline function\n- Inline variable\n- Inline constant\n- ..." + }, + { + "name": "RefactorRewrite", + "value": "refactor.rewrite", + "documentation": "Base kind for refactoring rewrite actions: 'refactor.rewrite'\n\nExample rewrite actions:\n\n- Convert JavaScript function to class\n- Add or remove parameter\n- Encapsulate field\n- Make method static\n- Move method to base class\n- ..." + }, + { + "name": "Source", + "value": "source", + "documentation": "Base kind for source actions: `source`\n\nSource code actions apply to the entire file." + }, + { + "name": "SourceOrganizeImports", + "value": "source.organizeImports", + "documentation": "Base kind for an organize imports source action: `source.organizeImports`" + }, + { + "name": "SourceFixAll", + "value": "source.fixAll", + "documentation": "Base kind for auto-fix source actions: `source.fixAll`.\n\nFix all actions automatically fix errors that have a clear fix that do not require user input.\nThey should not suppress errors or perform unsafe fixes such as generating new types or classes.\n\n@since 3.15.0", + "since": "3.15.0" + } + ], + "supportsCustomValues": true, + "documentation": "A set of predefined code action kinds" + }, + { + "name": "TraceValues", + "type": { + "kind": "base", + "name": "string" + }, + "values": [ + { + "name": "Off", + "value": "off", + "documentation": "Turn tracing off." + }, + { + "name": "Messages", + "value": "messages", + "documentation": "Trace messages only." + }, + { + "name": "Verbose", + "value": "verbose", + "documentation": "Verbose message tracing." + } + ] + }, + { + "name": "MarkupKind", + "type": { + "kind": "base", + "name": "string" + }, + "values": [ + { + "name": "PlainText", + "value": "plaintext", + "documentation": "Plain text is supported as a content format" + }, + { + "name": "Markdown", + "value": "markdown", + "documentation": "Markdown is supported as a content format" + } + ], + "documentation": "Describes the content type that a client supports in various\nresult literals like `Hover`, `ParameterInfo` or `CompletionItem`.\n\nPlease note that `MarkupKinds` must not start with a `$`. This kinds\nare reserved for internal usage." + }, + { + "name": "InlineCompletionTriggerKind", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "Invoked", + "value": 0, + "documentation": "Completion was triggered explicitly by a user gesture." + }, + { + "name": "Automatic", + "value": 1, + "documentation": "Completion was triggered automatically while editing." + } + ], + "documentation": "Describes how an {@link InlineCompletionItemProvider inline completion provider} was triggered.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "PositionEncodingKind", + "type": { + "kind": "base", + "name": "string" + }, + "values": [ + { + "name": "UTF8", + "value": "utf-8", + "documentation": "Character offsets count UTF-8 code units (e.g. bytes)." + }, + { + "name": "UTF16", + "value": "utf-16", + "documentation": "Character offsets count UTF-16 code units.\n\nThis is the default and must always be supported\nby servers" + }, + { + "name": "UTF32", + "value": "utf-32", + "documentation": "Character offsets count UTF-32 code units.\n\nImplementation note: these are the same as Unicode codepoints,\nso this `PositionEncodingKind` may also be used for an\nencoding-agnostic representation of character offsets." + } + ], + "supportsCustomValues": true, + "documentation": "A set of predefined position encoding kinds.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "FileChangeType", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "Created", + "value": 1, + "documentation": "The file got created." + }, + { + "name": "Changed", + "value": 2, + "documentation": "The file got changed." + }, + { + "name": "Deleted", + "value": 3, + "documentation": "The file got deleted." + } + ], + "documentation": "The file event type" + }, + { + "name": "WatchKind", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "Create", + "value": 1, + "documentation": "Interested in create events." + }, + { + "name": "Change", + "value": 2, + "documentation": "Interested in change events" + }, + { + "name": "Delete", + "value": 4, + "documentation": "Interested in delete events" + } + ], + "supportsCustomValues": true + }, + { + "name": "DiagnosticSeverity", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "Error", + "value": 1, + "documentation": "Reports an error." + }, + { + "name": "Warning", + "value": 2, + "documentation": "Reports a warning." + }, + { + "name": "Information", + "value": 3, + "documentation": "Reports an information." + }, + { + "name": "Hint", + "value": 4, + "documentation": "Reports a hint." + } + ], + "documentation": "The diagnostic's severity." + }, + { + "name": "DiagnosticTag", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "Unnecessary", + "value": 1, + "documentation": "Unused or unnecessary code.\n\nClients are allowed to render diagnostics with this tag faded out instead of having\nan error squiggle." + }, + { + "name": "Deprecated", + "value": 2, + "documentation": "Deprecated or obsolete code.\n\nClients are allowed to rendered diagnostics with this tag strike through." + } + ], + "documentation": "The diagnostic tags.\n\n@since 3.15.0", + "since": "3.15.0" + }, + { + "name": "CompletionTriggerKind", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "Invoked", + "value": 1, + "documentation": "Completion was triggered by typing an identifier (24x7 code\ncomplete), manual invocation (e.g Ctrl+Space) or via API." + }, + { + "name": "TriggerCharacter", + "value": 2, + "documentation": "Completion was triggered by a trigger character specified by\nthe `triggerCharacters` properties of the `CompletionRegistrationOptions`." + }, + { + "name": "TriggerForIncompleteCompletions", + "value": 3, + "documentation": "Completion was re-triggered as current completion list is incomplete" + } + ], + "documentation": "How a completion was triggered" + }, + { + "name": "SignatureHelpTriggerKind", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "Invoked", + "value": 1, + "documentation": "Signature help was invoked manually by the user or by a command." + }, + { + "name": "TriggerCharacter", + "value": 2, + "documentation": "Signature help was triggered by a trigger character." + }, + { + "name": "ContentChange", + "value": 3, + "documentation": "Signature help was triggered by the cursor moving or by the document content changing." + } + ], + "documentation": "How a signature help was triggered.\n\n@since 3.15.0", + "since": "3.15.0" + }, + { + "name": "CodeActionTriggerKind", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "Invoked", + "value": 1, + "documentation": "Code actions were explicitly requested by the user or by an extension." + }, + { + "name": "Automatic", + "value": 2, + "documentation": "Code actions were requested automatically.\n\nThis typically happens when current selection in a file changes, but can\nalso be triggered when file content changes." + } + ], + "documentation": "The reason why code actions were requested.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "FileOperationPatternKind", + "type": { + "kind": "base", + "name": "string" + }, + "values": [ + { + "name": "file", + "value": "file", + "documentation": "The pattern matches a file only." + }, + { + "name": "folder", + "value": "folder", + "documentation": "The pattern matches a folder only." + } + ], + "documentation": "A pattern kind describing if a glob pattern matches a file a folder or\nboth.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "NotebookCellKind", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "Markup", + "value": 1, + "documentation": "A markup-cell is formatted source that is used for display." + }, + { + "name": "Code", + "value": 2, + "documentation": "A code-cell is source code." + } + ], + "documentation": "A notebook cell kind.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "ResourceOperationKind", + "type": { + "kind": "base", + "name": "string" + }, + "values": [ + { + "name": "Create", + "value": "create", + "documentation": "Supports creating new files and folders." + }, + { + "name": "Rename", + "value": "rename", + "documentation": "Supports renaming existing files and folders." + }, + { + "name": "Delete", + "value": "delete", + "documentation": "Supports deleting existing files and folders." + } + ] + }, + { + "name": "FailureHandlingKind", + "type": { + "kind": "base", + "name": "string" + }, + "values": [ + { + "name": "Abort", + "value": "abort", + "documentation": "Applying the workspace change is simply aborted if one of the changes provided\nfails. All operations executed before the failing operation stay executed." + }, + { + "name": "Transactional", + "value": "transactional", + "documentation": "All operations are executed transactional. That means they either all\nsucceed or no changes at all are applied to the workspace." + }, + { + "name": "TextOnlyTransactional", + "value": "textOnlyTransactional", + "documentation": "If the workspace edit contains only textual file changes they are executed transactional.\nIf resource changes (create, rename or delete file) are part of the change the failure\nhandling strategy is abort." + }, + { + "name": "Undo", + "value": "undo", + "documentation": "The client tries to undo the operations already executed. But there is no\nguarantee that this is succeeding." + } + ] + }, + { + "name": "PrepareSupportDefaultBehavior", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "Identifier", + "value": 1, + "documentation": "The client's default behavior is to select the identifier\naccording the to language's syntax rule." + } + ] + }, + { + "name": "TokenFormat", + "type": { + "kind": "base", + "name": "string" + }, + "values": [ + { + "name": "Relative", + "value": "relative" + } + ] + } + ], + "typeAliases": [ + { + "name": "Definition", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "Location" + }, + { + "kind": "array", + "element": { + "kind": "reference", + "name": "Location" + } + } + ] + }, + "documentation": "The definition of a symbol represented as one or many {@link Location locations}.\nFor most programming languages there is only one location at which a symbol is\ndefined.\n\nServers should prefer returning `DefinitionLink` over `Definition` if supported\nby the client." + }, + { + "name": "DefinitionLink", + "type": { + "kind": "reference", + "name": "LocationLink" + }, + "documentation": "Information about where a symbol is defined.\n\nProvides additional metadata over normal {@link Location location} definitions, including the range of\nthe defining symbol" + }, + { + "name": "LSPArray", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "LSPAny" + } + }, + "documentation": "LSP arrays.\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "LSPAny", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "LSPObject" + }, + { + "kind": "reference", + "name": "LSPArray" + }, + { + "kind": "base", + "name": "string" + }, + { + "kind": "base", + "name": "integer" + }, + { + "kind": "base", + "name": "uinteger" + }, + { + "kind": "base", + "name": "decimal" + }, + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "documentation": "The LSP any type.\nPlease note that strictly speaking a property with the value `undefined`\ncan't be converted into JSON preserving the property name. However for\nconvenience it is allowed and assumed that all these properties are\noptional as well.\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "Declaration", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "Location" + }, + { + "kind": "array", + "element": { + "kind": "reference", + "name": "Location" + } + } + ] + }, + "documentation": "The declaration of a symbol representation as one or many {@link Location locations}." + }, + { + "name": "DeclarationLink", + "type": { + "kind": "reference", + "name": "LocationLink" + }, + "documentation": "Information about where a symbol is declared.\n\nProvides additional metadata over normal {@link Location location} declarations, including the range of\nthe declaring symbol.\n\nServers should prefer returning `DeclarationLink` over `Declaration` if supported\nby the client." + }, + { + "name": "InlineValue", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "InlineValueText" + }, + { + "kind": "reference", + "name": "InlineValueVariableLookup" + }, + { + "kind": "reference", + "name": "InlineValueEvaluatableExpression" + } + ] + }, + "documentation": "Inline value information can be provided by different means:\n- directly as a text value (class InlineValueText).\n- as a name to use for a variable lookup (class InlineValueVariableLookup)\n- as an evaluatable expression (class InlineValueEvaluatableExpression)\nThe InlineValue types combines all inline value types into one type.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "DocumentDiagnosticReport", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "RelatedFullDocumentDiagnosticReport" + }, + { + "kind": "reference", + "name": "RelatedUnchangedDocumentDiagnosticReport" + } + ] + }, + "documentation": "The result of a document diagnostic pull request. A report can\neither be a full report containing all diagnostics for the\nrequested document or an unchanged report indicating that nothing\nhas changed in terms of diagnostics in comparison to the last\npull request.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "PrepareRenameResult", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "Range" + }, + { + "kind": "literal", + "value": { + "properties": [ + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + } + }, + { + "name": "placeholder", + "type": { + "kind": "base", + "name": "string" + } + } + ] + } + }, + { + "kind": "literal", + "value": { + "properties": [ + { + "name": "defaultBehavior", + "type": { + "kind": "base", + "name": "boolean" + } + } + ] + } + } + ] + } + }, + { + "name": "DocumentSelector", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "DocumentFilter" + } + }, + "documentation": "A document selector is the combination of one or many document filters.\n\n@sample `let sel:DocumentSelector = [{ language: 'typescript' }, { language: 'json', pattern: '**∕tsconfig.json' }]`;\n\nThe use of a string as a document filter is deprecated @since 3.16.0.", + "since": "3.16.0." + }, + { + "name": "ProgressToken", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "integer" + }, + { + "kind": "base", + "name": "string" + } + ] + } + }, + { + "name": "ChangeAnnotationIdentifier", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "An identifier to refer to a change annotation stored with a workspace edit." + }, + { + "name": "WorkspaceDocumentDiagnosticReport", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "WorkspaceFullDocumentDiagnosticReport" + }, + { + "kind": "reference", + "name": "WorkspaceUnchangedDocumentDiagnosticReport" + } + ] + }, + "documentation": "A workspace diagnostic document report.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "TextDocumentContentChangeEvent", + "type": { + "kind": "or", + "items": [ + { + "kind": "literal", + "value": { + "properties": [ + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range of the document that changed." + }, + { + "name": "rangeLength", + "type": { + "kind": "base", + "name": "uinteger" + }, + "optional": true, + "documentation": "The optional length of the range that got replaced.\n\n@deprecated use range instead." + }, + { + "name": "text", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The new text for the provided range." + } + ] + } + }, + { + "kind": "literal", + "value": { + "properties": [ + { + "name": "text", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The new text of the whole document." + } + ] + } + } + ] + }, + "documentation": "An event describing a change to a text document. If only a text is provided\nit is considered to be the full content of the document." + }, + { + "name": "MarkedString", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "string" + }, + { + "kind": "literal", + "value": { + "properties": [ + { + "name": "language", + "type": { + "kind": "base", + "name": "string" + } + }, + { + "name": "value", + "type": { + "kind": "base", + "name": "string" + } + } + ] + } + } + ] + }, + "documentation": "MarkedString can be used to render human readable text. It is either a markdown string\nor a code-block that provides a language and a code snippet. The language identifier\nis semantically equal to the optional language identifier in fenced code blocks in GitHub\nissues. See https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting\n\nThe pair of a language and a value is an equivalent to markdown:\n```${language}\n${value}\n```\n\nNote that markdown strings will be sanitized - that means html will be escaped.\n@deprecated use MarkupContent instead.", + "deprecated": "use MarkupContent instead." + }, + { + "name": "DocumentFilter", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "TextDocumentFilter" + }, + { + "kind": "reference", + "name": "NotebookCellTextDocumentFilter" + } + ] + }, + "documentation": "A document filter describes a top level text document or\na notebook cell document.\n\n@since 3.17.0 - proposed support for NotebookCellTextDocumentFilter.", + "since": "3.17.0 - proposed support for NotebookCellTextDocumentFilter." + }, + { + "name": "LSPObject", + "type": { + "kind": "map", + "key": { + "kind": "base", + "name": "string" + }, + "value": { + "kind": "reference", + "name": "LSPAny" + } + }, + "documentation": "LSP object definition.\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "GlobPattern", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "Pattern" + }, + { + "kind": "reference", + "name": "RelativePattern" + } + ] + }, + "documentation": "The glob pattern. Either a string pattern or a relative pattern.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "TextDocumentFilter", + "type": { + "kind": "or", + "items": [ + { + "kind": "literal", + "value": { + "properties": [ + { + "name": "language", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A language id, like `typescript`." + }, + { + "name": "scheme", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A Uri {@link Uri.scheme scheme}, like `file` or `untitled`." + }, + { + "name": "pattern", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A glob pattern, like **​/*.{ts,js}. See TextDocumentFilter for examples." + } + ] + } + }, + { + "kind": "literal", + "value": { + "properties": [ + { + "name": "language", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A language id, like `typescript`." + }, + { + "name": "scheme", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A Uri {@link Uri.scheme scheme}, like `file` or `untitled`." + }, + { + "name": "pattern", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A glob pattern, like **​/*.{ts,js}. See TextDocumentFilter for examples." + } + ] + } + }, + { + "kind": "literal", + "value": { + "properties": [ + { + "name": "language", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A language id, like `typescript`." + }, + { + "name": "scheme", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A Uri {@link Uri.scheme scheme}, like `file` or `untitled`." + }, + { + "name": "pattern", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A glob pattern, like **​/*.{ts,js}. See TextDocumentFilter for examples." + } + ] + } + } + ] + }, + "documentation": "A document filter denotes a document by different properties like\nthe {@link TextDocument.languageId language}, the {@link Uri.scheme scheme} of\nits resource, or a glob-pattern that is applied to the {@link TextDocument.fileName path}.\n\nGlob patterns can have the following syntax:\n- `*` to match one or more characters in a path segment\n- `?` to match on one character in a path segment\n- `**` to match any number of path segments, including none\n- `{}` to group sub patterns into an OR expression. (e.g. `**​/*.{ts,js}` matches all TypeScript and JavaScript files)\n- `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)\n- `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)\n\n@sample A language filter that applies to typescript files on disk: `{ language: 'typescript', scheme: 'file' }`\n@sample A language filter that applies to all package.json paths: `{ language: 'json', pattern: '**package.json' }`\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "NotebookDocumentFilter", + "type": { + "kind": "or", + "items": [ + { + "kind": "literal", + "value": { + "properties": [ + { + "name": "notebookType", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The type of the enclosing notebook." + }, + { + "name": "scheme", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A Uri {@link Uri.scheme scheme}, like `file` or `untitled`." + }, + { + "name": "pattern", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A glob pattern." + } + ] + } + }, + { + "kind": "literal", + "value": { + "properties": [ + { + "name": "notebookType", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The type of the enclosing notebook." + }, + { + "name": "scheme", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A Uri {@link Uri.scheme scheme}, like `file` or `untitled`." + }, + { + "name": "pattern", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A glob pattern." + } + ] + } + }, + { + "kind": "literal", + "value": { + "properties": [ + { + "name": "notebookType", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The type of the enclosing notebook." + }, + { + "name": "scheme", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A Uri {@link Uri.scheme scheme}, like `file` or `untitled`." + }, + { + "name": "pattern", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A glob pattern." + } + ] + } + } + ] + }, + "documentation": "A notebook document filter denotes a notebook document by\ndifferent properties. The properties will be match\nagainst the notebook's URI (same as with documents)\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "Pattern", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The glob pattern to watch relative to the base path. Glob patterns can have the following syntax:\n- `*` to match one or more characters in a path segment\n- `?` to match on one character in a path segment\n- `**` to match any number of path segments, including none\n- `{}` to group conditions (e.g. `**​/*.{ts,js}` matches all TypeScript and JavaScript files)\n- `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)\n- `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)\n\n@since 3.17.0", + "since": "3.17.0" + } + ] +} \ No newline at end of file diff --git a/data/3.17.0/metaModel.schema.json b/data/3.17.0/metaModel.schema.json new file mode 100644 index 0000000..dbdd804 --- /dev/null +++ b/data/3.17.0/metaModel.schema.json @@ -0,0 +1,783 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "AndType": { + "additionalProperties": false, + "description": "Represents an `and`type (e.g. TextDocumentParams & WorkDoneProgressParams`).", + "properties": { + "items": { + "items": { + "$ref": "#/definitions/Type" + }, + "type": "array" + }, + "kind": { + "const": "and", + "type": "string" + } + }, + "required": [ + "kind", + "items" + ], + "type": "object" + }, + "ArrayType": { + "additionalProperties": false, + "description": "Represents an array type (e.g. `TextDocument[]`).", + "properties": { + "element": { + "$ref": "#/definitions/Type" + }, + "kind": { + "const": "array", + "type": "string" + } + }, + "required": [ + "kind", + "element" + ], + "type": "object" + }, + "BaseType": { + "additionalProperties": false, + "description": "Represents a base type like `string` or `DocumentUri`.", + "properties": { + "kind": { + "const": "base", + "type": "string" + }, + "name": { + "$ref": "#/definitions/BaseTypes" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "BaseTypes": { + "enum": [ + "URI", + "DocumentUri", + "integer", + "uinteger", + "decimal", + "RegExp", + "string", + "boolean", + "null" + ], + "type": "string" + }, + "BooleanLiteralType": { + "additionalProperties": false, + "description": "Represents a boolean literal type (e.g. `kind: true`).", + "properties": { + "kind": { + "const": "booleanLiteral", + "type": "string" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "kind", + "value" + ], + "type": "object" + }, + "Enumeration": { + "additionalProperties": false, + "description": "Defines an enumeration.", + "properties": { + "deprecated": { + "description": "Whether the enumeration is deprecated or not. If deprecated the property contains the deprecation message.", + "type": "string" + }, + "documentation": { + "description": "An optional documentation.", + "type": "string" + }, + "name": { + "description": "The name of the enumeration.", + "type": "string" + }, + "proposed": { + "description": "Whether this is a proposed enumeration. If omitted, the enumeration is final.", + "type": "boolean" + }, + "since": { + "description": "Since when (release number) this enumeration is available. Is undefined if not known.", + "type": "string" + }, + "supportsCustomValues": { + "description": "Whether the enumeration supports custom values (e.g. values which are not part of the set defined in `values`). If omitted no custom values are supported.", + "type": "boolean" + }, + "type": { + "$ref": "#/definitions/EnumerationType", + "description": "The type of the elements." + }, + "values": { + "description": "The enum values.", + "items": { + "$ref": "#/definitions/EnumerationEntry" + }, + "type": "array" + } + }, + "required": [ + "name", + "type", + "values" + ], + "type": "object" + }, + "EnumerationEntry": { + "additionalProperties": false, + "description": "Defines an enumeration entry.", + "properties": { + "deprecated": { + "description": "Whether the enum entry is deprecated or not. If deprecated the property contains the deprecation message.", + "type": "string" + }, + "documentation": { + "description": "An optional documentation.", + "type": "string" + }, + "name": { + "description": "The name of the enum item.", + "type": "string" + }, + "proposed": { + "description": "Whether this is a proposed enumeration entry. If omitted, the enumeration entry is final.", + "type": "boolean" + }, + "since": { + "description": "Since when (release number) this enumeration entry is available. Is undefined if not known.", + "type": "string" + }, + "value": { + "description": "The value.", + "type": [ + "string", + "number" + ] + } + }, + "required": [ + "name", + "value" + ], + "type": "object" + }, + "EnumerationType": { + "additionalProperties": false, + "properties": { + "kind": { + "const": "base", + "type": "string" + }, + "name": { + "enum": [ + "string", + "integer", + "uinteger" + ], + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "IntegerLiteralType": { + "additionalProperties": false, + "properties": { + "kind": { + "const": "integerLiteral", + "description": "Represents an integer literal type (e.g. `kind: 1`).", + "type": "string" + }, + "value": { + "type": "number" + } + }, + "required": [ + "kind", + "value" + ], + "type": "object" + }, + "MapKeyType": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "kind": { + "const": "base", + "type": "string" + }, + "name": { + "enum": [ + "URI", + "DocumentUri", + "string", + "integer" + ], + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + { + "$ref": "#/definitions/ReferenceType" + } + ], + "description": "Represents a type that can be used as a key in a map type. If a reference type is used then the type must either resolve to a `string` or `integer` type. (e.g. `type ChangeAnnotationIdentifier === string`)." + }, + "MapType": { + "additionalProperties": false, + "description": "Represents a JSON object map (e.g. `interface Map { [key: K] => V; }`).", + "properties": { + "key": { + "$ref": "#/definitions/MapKeyType" + }, + "kind": { + "const": "map", + "type": "string" + }, + "value": { + "$ref": "#/definitions/Type" + } + }, + "required": [ + "kind", + "key", + "value" + ], + "type": "object" + }, + "MessageDirection": { + "description": "Indicates in which direction a message is sent in the protocol.", + "enum": [ + "clientToServer", + "serverToClient", + "both" + ], + "type": "string" + }, + "MetaData": { + "additionalProperties": false, + "properties": { + "version": { + "description": "The protocol version.", + "type": "string" + } + }, + "required": [ + "version" + ], + "type": "object" + }, + "MetaModel": { + "additionalProperties": false, + "description": "The actual meta model.", + "properties": { + "enumerations": { + "description": "The enumerations.", + "items": { + "$ref": "#/definitions/Enumeration" + }, + "type": "array" + }, + "metaData": { + "$ref": "#/definitions/MetaData", + "description": "Additional meta data." + }, + "notifications": { + "description": "The notifications.", + "items": { + "$ref": "#/definitions/Notification" + }, + "type": "array" + }, + "requests": { + "description": "The requests.", + "items": { + "$ref": "#/definitions/Request" + }, + "type": "array" + }, + "structures": { + "description": "The structures.", + "items": { + "$ref": "#/definitions/Structure" + }, + "type": "array" + }, + "typeAliases": { + "description": "The type aliases.", + "items": { + "$ref": "#/definitions/TypeAlias" + }, + "type": "array" + } + }, + "required": [ + "metaData", + "requests", + "notifications", + "structures", + "enumerations", + "typeAliases" + ], + "type": "object" + }, + "Notification": { + "additionalProperties": false, + "description": "Represents a LSP notification", + "properties": { + "deprecated": { + "description": "Whether the notification is deprecated or not. If deprecated the property contains the deprecation message.", + "type": "string" + }, + "documentation": { + "description": "An optional documentation;", + "type": "string" + }, + "messageDirection": { + "$ref": "#/definitions/MessageDirection", + "description": "The direction in which this notification is sent in the protocol." + }, + "method": { + "description": "The request's method name.", + "type": "string" + }, + "params": { + "anyOf": [ + { + "$ref": "#/definitions/Type" + }, + { + "items": { + "$ref": "#/definitions/Type" + }, + "type": "array" + } + ], + "description": "The parameter type(s) if any." + }, + "proposed": { + "description": "Whether this is a proposed notification. If omitted the notification is final.", + "type": "boolean" + }, + "registrationMethod": { + "description": "Optional a dynamic registration method if it different from the request's method.", + "type": "string" + }, + "registrationOptions": { + "$ref": "#/definitions/Type", + "description": "Optional registration options if the notification supports dynamic registration." + }, + "since": { + "description": "Since when (release number) this notification is available. Is undefined if not known.", + "type": "string" + } + }, + "required": [ + "method", + "messageDirection" + ], + "type": "object" + }, + "OrType": { + "additionalProperties": false, + "description": "Represents an `or` type (e.g. `Location | LocationLink`).", + "properties": { + "items": { + "items": { + "$ref": "#/definitions/Type" + }, + "type": "array" + }, + "kind": { + "const": "or", + "type": "string" + } + }, + "required": [ + "kind", + "items" + ], + "type": "object" + }, + "Property": { + "additionalProperties": false, + "description": "Represents an object property.", + "properties": { + "deprecated": { + "description": "Whether the property is deprecated or not. If deprecated the property contains the deprecation message.", + "type": "string" + }, + "documentation": { + "description": "An optional documentation.", + "type": "string" + }, + "name": { + "description": "The property name;", + "type": "string" + }, + "optional": { + "description": "Whether the property is optional. If omitted, the property is mandatory.", + "type": "boolean" + }, + "proposed": { + "description": "Whether this is a proposed property. If omitted, the structure is final.", + "type": "boolean" + }, + "since": { + "description": "Since when (release number) this property is available. Is undefined if not known.", + "type": "string" + }, + "type": { + "$ref": "#/definitions/Type", + "description": "The type of the property" + } + }, + "required": [ + "name", + "type" + ], + "type": "object" + }, + "ReferenceType": { + "additionalProperties": false, + "description": "Represents a reference to another type (e.g. `TextDocument`). This is either a `Structure`, a `Enumeration` or a `TypeAlias` in the same meta model.", + "properties": { + "kind": { + "const": "reference", + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "Request": { + "additionalProperties": false, + "description": "Represents a LSP request", + "properties": { + "deprecated": { + "description": "Whether the request is deprecated or not. If deprecated the property contains the deprecation message.", + "type": "string" + }, + "documentation": { + "description": "An optional documentation;", + "type": "string" + }, + "errorData": { + "$ref": "#/definitions/Type", + "description": "An optional error data type." + }, + "messageDirection": { + "$ref": "#/definitions/MessageDirection", + "description": "The direction in which this request is sent in the protocol." + }, + "method": { + "description": "The request's method name.", + "type": "string" + }, + "params": { + "anyOf": [ + { + "$ref": "#/definitions/Type" + }, + { + "items": { + "$ref": "#/definitions/Type" + }, + "type": "array" + } + ], + "description": "The parameter type(s) if any." + }, + "partialResult": { + "$ref": "#/definitions/Type", + "description": "Optional partial result type if the request supports partial result reporting." + }, + "proposed": { + "description": "Whether this is a proposed feature. If omitted the feature is final.", + "type": "boolean" + }, + "registrationMethod": { + "description": "Optional a dynamic registration method if it different from the request's method.", + "type": "string" + }, + "registrationOptions": { + "$ref": "#/definitions/Type", + "description": "Optional registration options if the request supports dynamic registration." + }, + "result": { + "$ref": "#/definitions/Type", + "description": "The result type." + }, + "since": { + "description": "Since when (release number) this request is available. Is undefined if not known.", + "type": "string" + } + }, + "required": [ + "method", + "result", + "messageDirection" + ], + "type": "object" + }, + "StringLiteralType": { + "additionalProperties": false, + "description": "Represents a string literal type (e.g. `kind: 'rename'`).", + "properties": { + "kind": { + "const": "stringLiteral", + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "kind", + "value" + ], + "type": "object" + }, + "Structure": { + "additionalProperties": false, + "description": "Defines the structure of an object literal.", + "properties": { + "deprecated": { + "description": "Whether the structure is deprecated or not. If deprecated the property contains the deprecation message.", + "type": "string" + }, + "documentation": { + "description": "An optional documentation;", + "type": "string" + }, + "extends": { + "description": "Structures extended from. This structures form a polymorphic type hierarchy.", + "items": { + "$ref": "#/definitions/Type" + }, + "type": "array" + }, + "mixins": { + "description": "Structures to mix in. The properties of these structures are `copied` into this structure. Mixins don't form a polymorphic type hierarchy in LSP.", + "items": { + "$ref": "#/definitions/Type" + }, + "type": "array" + }, + "name": { + "description": "The name of the structure.", + "type": "string" + }, + "properties": { + "description": "The properties.", + "items": { + "$ref": "#/definitions/Property" + }, + "type": "array" + }, + "proposed": { + "description": "Whether this is a proposed structure. If omitted, the structure is final.", + "type": "boolean" + }, + "since": { + "description": "Since when (release number) this structure is available. Is undefined if not known.", + "type": "string" + } + }, + "required": [ + "name", + "properties" + ], + "type": "object" + }, + "StructureLiteral": { + "additionalProperties": false, + "description": "Defines an unnamed structure of an object literal.", + "properties": { + "deprecated": { + "description": "Whether the literal is deprecated or not. If deprecated the property contains the deprecation message.", + "type": "string" + }, + "documentation": { + "description": "An optional documentation.", + "type": "string" + }, + "properties": { + "description": "The properties.", + "items": { + "$ref": "#/definitions/Property" + }, + "type": "array" + }, + "proposed": { + "description": "Whether this is a proposed structure. If omitted, the structure is final.", + "type": "boolean" + }, + "since": { + "description": "Since when (release number) this structure is available. Is undefined if not known.", + "type": "string" + } + }, + "required": [ + "properties" + ], + "type": "object" + }, + "StructureLiteralType": { + "additionalProperties": false, + "description": "Represents a literal structure (e.g. `property: { start: uinteger; end: uinteger; }`).", + "properties": { + "kind": { + "const": "literal", + "type": "string" + }, + "value": { + "$ref": "#/definitions/StructureLiteral" + } + }, + "required": [ + "kind", + "value" + ], + "type": "object" + }, + "TupleType": { + "additionalProperties": false, + "description": "Represents a `tuple` type (e.g. `[integer, integer]`).", + "properties": { + "items": { + "items": { + "$ref": "#/definitions/Type" + }, + "type": "array" + }, + "kind": { + "const": "tuple", + "type": "string" + } + }, + "required": [ + "kind", + "items" + ], + "type": "object" + }, + "Type": { + "anyOf": [ + { + "$ref": "#/definitions/BaseType" + }, + { + "$ref": "#/definitions/ReferenceType" + }, + { + "$ref": "#/definitions/ArrayType" + }, + { + "$ref": "#/definitions/MapType" + }, + { + "$ref": "#/definitions/AndType" + }, + { + "$ref": "#/definitions/OrType" + }, + { + "$ref": "#/definitions/TupleType" + }, + { + "$ref": "#/definitions/StructureLiteralType" + }, + { + "$ref": "#/definitions/StringLiteralType" + }, + { + "$ref": "#/definitions/IntegerLiteralType" + }, + { + "$ref": "#/definitions/BooleanLiteralType" + } + ] + }, + "TypeAlias": { + "additionalProperties": false, + "description": "Defines a type alias. (e.g. `type Definition = Location | LocationLink`)", + "properties": { + "deprecated": { + "description": "Whether the type alias is deprecated or not. If deprecated the property contains the deprecation message.", + "type": "string" + }, + "documentation": { + "description": "An optional documentation.", + "type": "string" + }, + "name": { + "description": "The name of the type alias.", + "type": "string" + }, + "proposed": { + "description": "Whether this is a proposed type alias. If omitted, the type alias is final.", + "type": "boolean" + }, + "since": { + "description": "Since when (release number) this structure is available. Is undefined if not known.", + "type": "string" + }, + "type": { + "$ref": "#/definitions/Type", + "description": "The aliased type." + } + }, + "required": [ + "name", + "type" + ], + "type": "object" + }, + "TypeKind": { + "enum": [ + "base", + "reference", + "array", + "map", + "and", + "or", + "tuple", + "literal", + "stringLiteral", + "integerLiteral", + "booleanLiteral" + ], + "type": "string" + } + } +} \ No newline at end of file diff --git a/src/Client.fs b/src/Client.fs index 62eb000..c6e88d3 100644 --- a/src/Client.fs +++ b/src/Client.fs @@ -68,7 +68,7 @@ type ILspClient = abstract member WorkspaceConfiguration: ConfigurationParams -> AsyncLspResult - abstract member WorkspaceApplyEdit: ApplyWorkspaceEditParams -> AsyncLspResult + abstract member WorkspaceApplyEdit: ApplyWorkspaceEditParams -> AsyncLspResult /// The workspace/semanticTokens/refresh request is sent from the server to the client. /// Servers can use it to ask clients to refresh the editors for which this server provides semantic tokens. @@ -209,7 +209,7 @@ type LspClient() = default __.WorkspaceConfiguration(_) = notImplemented - abstract member WorkspaceApplyEdit: ApplyWorkspaceEditParams -> AsyncLspResult + abstract member WorkspaceApplyEdit: ApplyWorkspaceEditParams -> AsyncLspResult default __.WorkspaceApplyEdit(_) = notImplemented /// The workspace/semanticTokens/refresh request is sent from the server to the client. diff --git a/src/Ionide.LanguageServerProtocol.fsproj b/src/Ionide.LanguageServerProtocol.fsproj index 699d0ae..d615540 100644 --- a/src/Ionide.LanguageServerProtocol.fsproj +++ b/src/Ionide.LanguageServerProtocol.fsproj @@ -10,18 +10,23 @@ MIT README.md https://github.com/ionide/LanguageServerProtocol + 3.17.0 + + + @@ -34,4 +39,36 @@ + + + <_MetaModelInputs Include="$(MSBuildThisFileDirectory)../data/$(LSPVersion)/metaModel.json" /> + <_MetaModelOutputs Include="$(MSBuildThisFileDirectory)Types.cg.fs" /> + + + + + + + + + <_GeneratorProject Include="../tools/MetaModelGenerator/MetaModelGenerator.fsproj" /> + + + + + + + <_GenerateCommand Include="dotnet;@(_GeneratorApp)" /> + <_GenerateCommand Include="types" /> + <_GenerateCommand Include="--metamodelpath" /> + <_GenerateCommand Include="%(_MetaModelInputs.FullPath)" /> + <_GenerateCommand Include="--outputfilepath" /> + <_GenerateCommand Include="%(_MetaModelOutputs.FullPath)" /> + + + + \ No newline at end of file diff --git a/src/JsonUtils.fs b/src/JsonUtils.fs index 2ec30de..315c62f 100644 --- a/src/JsonUtils.fs +++ b/src/JsonUtils.fs @@ -1,4 +1,4 @@ -module Ionide.LanguageServerProtocol.JsonUtils +namespace Ionide.LanguageServerProtocol.JsonUtils open Microsoft.FSharp.Reflection open Newtonsoft.Json @@ -8,30 +8,8 @@ open Ionide.LanguageServerProtocol.Types open Newtonsoft.Json.Linq open Newtonsoft.Json.Serialization open System.Reflection +open Converters -module Type = - let numerics = - [| typeof - typeof - typeof - typeof - //ENHANCEMENT: other number types - |] - - let numericHashes = numerics |> Array.map (fun t -> t.GetHashCode()) - let stringHash = typeof.GetHashCode() - let boolHash = typeof.GetHashCode() - - let inline isOption (t: Type) = - t.IsGenericType - && t.GetGenericTypeDefinition() = typedefof<_ option> - - let inline isString (t: Type) = t.GetHashCode() = stringHash - let inline isBool (t: Type) = t.GetHashCode() = boolHash - - let inline isNumeric (t: Type) = - let hash = t.GetHashCode() - numericHashes |> Array.contains hash /// Handles fields of type `Option`: /// * Allows missing json properties when `Option` -> Optional @@ -85,52 +63,7 @@ type OptionAndCamelCasePropertyNamesContractResolver() as this = prop -let inline private memorise (f: 'a -> 'b) : 'a -> 'b = - let d = ConcurrentDictionary<'a, 'b>() - fun key -> d.GetOrAdd(key, f) - -let inline private memoriseByHash (f: 'a -> 'b) : 'a -> 'b = - let d = ConcurrentDictionary() - - fun key -> - let hash = key.GetHashCode() - - match d.TryGetValue(hash) with - | (true, value) -> value - | _ -> - let value = f key - d.TryAdd(hash, value) |> ignore - value - -type private CaseInfo = - { Info: UnionCaseInfo - Fields: PropertyInfo[] - GetFieldValues: obj -> obj[] - Create: obj[] -> obj } -type private UnionInfo = - { Cases: CaseInfo[] - GetTag: obj -> int } - - member u.GetCaseOf(value: obj) = - let tag = u.GetTag value - u.Cases |> Array.find (fun case -> case.Info.Tag = tag) - -module private UnionInfo = - let private create (ty: Type) = - assert (ty |> FSharpType.IsUnion) - - let cases = - FSharpType.GetUnionCases ty - |> Array.map (fun case -> - { Info = case - Fields = case.GetFields() - GetFieldValues = FSharpValue.PreComputeUnionReader case - Create = FSharpValue.PreComputeUnionConstructor case }) - - { Cases = cases; GetTag = FSharpValue.PreComputeUnionTagReader ty } - - let get: Type -> _ = memoriseByHash (create) /// Newtonsoft.Json parses parses a number inside quotations as number too: /// `"42"` -> can be parsed to `42: int` @@ -214,7 +147,7 @@ type ErasedUnionConverter() = | values -> failwith $"Expected exactly one field for case `{value.GetType().Name}`, but were {values.Length}" override __.ReadJson(reader: JsonReader, t, _existingValue, serializer) = - let tryReadValue (json: JToken) (targetType: Type) = + let tryReadPrimitive (json: JToken) (targetType: Type) = if Type.isString targetType then if json.Type = JTokenType.String then reader.Value |> Some @@ -231,15 +164,38 @@ type ErasedUnionConverter() = | JTokenType.Float -> json.ToObject(targetType, serializer) |> Some | _ -> None else + None + let tryReadUnionKind (json: JToken) (targetType: Type) = + try + let fields = + json.Children() + let props = + targetType.GetProperties() + + match fields |> Seq.tryFind(fun f -> f.Name.ToLowerInvariant() = "kind"), + props |> Seq.tryFind (fun p -> p.Name.ToLowerInvariant() = "kind") with + | Some f, Some p -> + match p.GetCustomAttribute(typeof) |> Option.ofObj with + | Some (:? UnionKindAttribute as k) when k.Value = string f.Value -> + json.ToObject(targetType, serializer) |> Some + | _ -> None + | _ -> None + with _ -> None + let tryReadAllMatchingFields (json: JToken) (targetType: Type) = try - json.ToObject(targetType, serializer) |> Some + let fields = json.Children() |> Seq.map (fun f -> f.Name.ToLowerInvariant()) + let props = targetType.GetProperties() |> Seq.map(fun p -> p.Name.ToLowerInvariant()) + if fields |> Seq.forall (fun f -> props |> Seq.contains f) then + json.ToObject(targetType, serializer) |> Some + else + None with _ -> None let union = UnionInfo.get t let json = JToken.ReadFrom reader - let tryMakeUnionCase (json: JToken) (case: CaseInfo) = + let tryMakeUnionCase tryReadValue (json: JToken) (case: CaseInfo) = match case.Fields with | [| field |] -> let ty = field.PropertyType @@ -251,7 +207,14 @@ type ErasedUnionConverter() = failwith $"Expected union {case.Info.DeclaringType.Name} to have exactly one field in each case, but case {case.Info.Name} has {fields.Length} fields" - let c = union.Cases |> Array.tryPick (tryMakeUnionCase json) + let c = + union.Cases |> Array.tryPick (tryMakeUnionCase tryReadPrimitive json) + |> Option.orElseWith (fun () -> + union.Cases |> Array.tryPick (tryMakeUnionCase tryReadUnionKind json) + ) + |> Option.orElseWith (fun () -> + union.Cases |> Array.tryPick (tryMakeUnionCase tryReadAllMatchingFields json) + ) match c with | None -> failwith $"Could not create an instance of the type '%s{t.Name}'" @@ -287,45 +250,3 @@ type SingleCaseUnionConverter() = match case with | Some case -> case.Create [||] | None -> failwith $"Could not create an instance of the type '%s{t.Name}' with the name '%s{caseName}'" - -[] -type OptionConverter() = - inherit JsonConverter() - - let getInnerType = - memoriseByHash (fun (t: Type) -> - let innerType = t.GetGenericArguments()[0] - - if innerType.IsValueType then - typedefof>.MakeGenericType([| innerType |]) - else - innerType) - - let canConvert = memoriseByHash (Type.isOption) - - override __.CanConvert(t) = canConvert t - - override __.WriteJson(writer, value, serializer) = - let value = - if isNull value then - null - else - let union = UnionInfo.get (value.GetType()) - let case = union.GetCaseOf value - case.GetFieldValues value |> Array.head - - serializer.Serialize(writer, value) - - override __.ReadJson(reader, t, _existingValue, serializer) = - match reader.TokenType with - | JsonToken.Null -> null // = None - | _ -> - let innerType = getInnerType t - - let value = serializer.Deserialize(reader, innerType) - - if isNull value then - null - else - let union = UnionInfo.get t - union.Cases[1].Create [| value |] \ No newline at end of file diff --git a/src/LanguageServerProtocol.fs b/src/LanguageServerProtocol.fs index 3bfecf9..505a8fe 100644 --- a/src/LanguageServerProtocol.fs +++ b/src/LanguageServerProtocol.fs @@ -53,7 +53,11 @@ module Server = | Error error -> let rpcException = LocalRpcException(error.Message) rpcException.ErrorCode <- error.Code - rpcException.ErrorData <- error.Data |> Option.defaultValue null + + rpcException.ErrorData <- + error.Data + |> Option.defaultValue null + raise rpcException } @@ -111,7 +115,8 @@ module Server = | Flatten(:? JsonSerializationException as ex) -> let data: obj = if isSerializable then ex else CommonErrorData(ex) JsonRpcError.ErrorDetail(Code = JsonRpcErrorCode.ParseError, Message = ex.Message, Data = data) - | _ -> ``base``.CreateErrorDetails(request, ex) } + | _ -> ``base``.CreateErrorDetails(request, ex) + } let startWithSetupCore<'client when 'client :> Ionide.LanguageServerProtocol.ILspClient> (setupRequestHandlings: 'client -> Map) @@ -131,7 +136,9 @@ module Server = jsonRpc.NotifyWithParameterObjectAsync(rpcMethod, notificationObj) |> Async.AwaitTask - return () |> LspResult.success + return + () + |> LspResult.success } /// When the server wants to send a request to the client @@ -141,14 +148,17 @@ module Server = jsonRpc.InvokeWithParameterObjectAsync<'response>(rpcMethod, requestObj) |> Async.AwaitTask - return response |> LspResult.success + return + response + |> LspResult.success } let lspClient = clientCreator ( sendServerNotification, { new ClientRequestSender with - member __.Send x t = sendServerRequest x t } + member __.Send x t = sendServerRequest x t + } ) // Note on server shutdown. @@ -175,7 +185,9 @@ module Server = let onExit () = logger.trace (Log.setMessage "Exit received") quitReceived <- true - quitSemaphore.Release() |> ignore + + quitSemaphore.Release() + |> ignore jsonRpc.AddLocalRpcMethod("exit", Action(onExit)) @@ -225,8 +237,9 @@ module Server = use jsonRpcHandler = new WebSocketMessageHandler(socket, defaultJsonRpcFormatter ()) startWithSetupCore setupRequestHandlings jsonRpcHandler clientCreator customizeRpc - type ServerRequestHandling<'server when 'server :> Ionide.LanguageServerProtocol.ILspServer> = - { Run: 'server -> Delegate } + type ServerRequestHandling<'server when 'server :> Ionide.LanguageServerProtocol.ILspServer> = { + Run: 'server -> Delegate + } let serverRequestHandling<'server, 'param, 'result when 'server :> Ionide.LanguageServerProtocol.ILspServer> (run: 'server -> 'param -> AsyncLspResult<'result>) @@ -236,11 +249,24 @@ module Server = let defaultRequestHandlings () : Map> = let requestHandling = serverRequestHandling - [ "initialize", requestHandling (fun s p -> s.Initialize(p)) - "initialized", requestHandling (fun s p -> s.Initialized(p) |> notificationSuccess) + [ + "initialize", requestHandling (fun s p -> s.Initialize(p)) + "initialized", + requestHandling (fun s () -> + s.Initialized() + |> notificationSuccess + ) "textDocument/hover", requestHandling (fun s p -> s.TextDocumentHover(p)) - "textDocument/didOpen", requestHandling (fun s p -> s.TextDocumentDidOpen(p) |> notificationSuccess) - "textDocument/didChange", requestHandling (fun s p -> s.TextDocumentDidChange(p) |> notificationSuccess) + "textDocument/didOpen", + requestHandling (fun s p -> + s.TextDocumentDidOpen(p) + |> notificationSuccess + ) + "textDocument/didChange", + requestHandling (fun s p -> + s.TextDocumentDidChange(p) + |> notificationSuccess + ) "textDocument/completion", requestHandling (fun s p -> s.TextDocumentCompletion(p)) "completionItem/resolve", requestHandling (fun s p -> s.CompletionItemResolve(p)) "textDocument/rename", requestHandling (fun s p -> s.TextDocumentRename(p)) @@ -263,10 +289,22 @@ module Server = "textDocument/formatting", requestHandling (fun s p -> s.TextDocumentFormatting(p)) "textDocument/rangeFormatting", requestHandling (fun s p -> s.TextDocumentRangeFormatting(p)) "textDocument/onTypeFormatting", requestHandling (fun s p -> s.TextDocumentOnTypeFormatting(p)) - "textDocument/willSave", requestHandling (fun s p -> s.TextDocumentWillSave(p) |> notificationSuccess) + "textDocument/willSave", + requestHandling (fun s p -> + s.TextDocumentWillSave(p) + |> notificationSuccess + ) "textDocument/willSaveWaitUntil", requestHandling (fun s p -> s.TextDocumentWillSaveWaitUntil(p)) - "textDocument/didSave", requestHandling (fun s p -> s.TextDocumentDidSave(p) |> notificationSuccess) - "textDocument/didClose", requestHandling (fun s p -> s.TextDocumentDidClose(p) |> notificationSuccess) + "textDocument/didSave", + requestHandling (fun s p -> + s.TextDocumentDidSave(p) + |> notificationSuccess + ) + "textDocument/didClose", + requestHandling (fun s p -> + s.TextDocumentDidClose(p) + |> notificationSuccess + ) "textDocument/documentSymbol", requestHandling (fun s p -> s.TextDocumentDocumentSymbol(p)) "textDocument/moniker", requestHandling (fun s p -> s.TextDocumentMoniker(p)) "textDocument/linkedEditingRange", requestHandling (fun s p -> s.TextDocumentLinkedEditingRange(p)) @@ -286,26 +324,58 @@ module Server = "textDocument/inlineValue", requestHandling (fun s p -> s.TextDocumentInlineValue(p)) "textDocument/diagnostic", requestHandling (fun s p -> s.TextDocumentDiagnostic(p)) "workspace/didChangeWatchedFiles", - requestHandling (fun s p -> s.WorkspaceDidChangeWatchedFiles(p) |> notificationSuccess) + requestHandling (fun s p -> + s.WorkspaceDidChangeWatchedFiles(p) + |> notificationSuccess + ) "workspace/didChangeWorkspaceFolders", requestHandling (fun s p -> s.WorkspaceDidChangeWorkspaceFolders(p) - |> notificationSuccess) + |> notificationSuccess + ) "workspace/didChangeConfiguration", - requestHandling (fun s p -> s.WorkspaceDidChangeConfiguration(p) |> notificationSuccess) + requestHandling (fun s p -> + s.WorkspaceDidChangeConfiguration(p) + |> notificationSuccess + ) "workspace/willCreateFiles", requestHandling (fun s p -> s.WorkspaceWillCreateFiles(p)) - "workspace/didCreateFiles", requestHandling (fun s p -> s.WorkspaceDidCreateFiles(p) |> notificationSuccess) + "workspace/didCreateFiles", + requestHandling (fun s p -> + s.WorkspaceDidCreateFiles(p) + |> notificationSuccess + ) "workspace/willRenameFiles", requestHandling (fun s p -> s.WorkspaceWillRenameFiles(p)) - "workspace/didRenameFiles", requestHandling (fun s p -> s.WorkspaceDidRenameFiles(p) |> notificationSuccess) + "workspace/didRenameFiles", + requestHandling (fun s p -> + s.WorkspaceDidRenameFiles(p) + |> notificationSuccess + ) "workspace/willDeleteFiles", requestHandling (fun s p -> s.WorkspaceWillDeleteFiles(p)) - "workspace/didDeleteFiles", requestHandling (fun s p -> s.WorkspaceDidDeleteFiles(p) |> notificationSuccess) + "workspace/didDeleteFiles", + requestHandling (fun s p -> + s.WorkspaceDidDeleteFiles(p) + |> notificationSuccess + ) "workspace/symbol", requestHandling (fun s p -> s.WorkspaceSymbol(p)) "workspaceSymbol/resolve", requestHandling (fun s p -> s.WorkspaceSymbolResolve(p)) "workspace/executeCommand", requestHandling (fun s p -> s.WorkspaceExecuteCommand(p)) - "window/workDoneProgress/cancel", requestHandling (fun s p -> s.WorkDoneProgressCancel(p) |> notificationSuccess) + "window/workDoneProgress/cancel", + requestHandling (fun s p -> + s.WorkDoneProgressCancel(p) + |> notificationSuccess + ) "workspace/diagnostic", requestHandling (fun s p -> s.WorkspaceDiagnostic(p)) - "shutdown", requestHandling (fun s () -> s.Shutdown() |> notificationSuccess) - "exit", requestHandling (fun s () -> s.Exit() |> notificationSuccess) ] + "shutdown", + requestHandling (fun s () -> + s.Shutdown() + |> notificationSuccess + ) + "exit", + requestHandling (fun s () -> + s.Exit() + |> notificationSuccess + ) + ] |> Map.ofList let private requestHandlingSetupFunc<'client, 'server @@ -408,12 +478,20 @@ module Client = else // TODO: Check that we don't over-fill headerBufferSize while count < headerBufferSize - && (buffer.[count - 2] <> cr && buffer.[count - 1] <> lf) do + && (buffer.[count - 2] + <> cr + && buffer.[count - 1] + <> lf) do let additionalBytesRead = stream.Read(buffer, count, 1) // TODO: exit when additionalBytesRead = 0, end of stream - count <- count + additionalBytesRead - - if count >= headerBufferSize then + count <- + count + + additionalBytesRead + + if + count + >= headerBufferSize + then None else Some(headerEncoding.GetString(buffer, 0, count - 2)) @@ -430,9 +508,17 @@ module Client = raise (Exception(sprintf "Separator not found in header '%s'" line)) else let name = line.Substring(0, separatorPos) - let value = line.Substring(separatorPos + 2) + + let value = + line.Substring( + separatorPos + + 2 + ) + let otherHeaders = readHeaders stream - (name, value) :: otherHeaders + + (name, value) + :: otherHeaders | None -> raise (EndOfStreamException()) let read (stream: Stream) = @@ -445,7 +531,8 @@ module Client = |> Option.bind (fun s -> match Int32.TryParse(s) with | true, x -> Some x - | _ -> None) + | _ -> None + ) if contentLength = None then failwithf "Content-Length header not found" @@ -454,9 +541,15 @@ module Client = let mutable readCount = 0 while readCount < contentLength.Value do - let toRead = contentLength.Value - readCount + let toRead = + contentLength.Value + - readCount + let readInCurrentBatch = stream.Read(result, readCount, toRead) - readCount <- readCount + readInCurrentBatch + + readCount <- + readCount + + readInCurrentBatch let str = Encoding.UTF8.GetString(result, 0, readCount) headers, str @@ -468,7 +561,13 @@ module Client = sprintf "Content-Type: application/vscode-jsonrpc; charset=utf-8\r\nContent-Length: %d\r\n\r\n" bytes.Length let headerBytes = Encoding.ASCII.GetBytes header - use ms = new MemoryStream(headerBytes.Length + bytes.Length) + + use ms = + new MemoryStream( + headerBytes.Length + + bytes.Length + ) + ms.Write(headerBytes, 0, headerBytes.Length) ms.Write(bytes, 0, bytes.Length) stream.Write(ms.ToArray(), 0, int ms.Position) @@ -488,18 +587,23 @@ module Client = |> Option.iter (fun input -> // fprintfn stderr "[CLIENT] Writing: %s" str LowLevel.write input.BaseStream str - input.BaseStream.Flush()) + input.BaseStream.Flush() + ) // do! Async.Sleep 1000 return! loop () } - loop ()) + loop () + ) let handleRequest (request: JsonRpc.Request) = async { let mutable methodCallResult = None - match notificationHandlings |> Map.tryFind request.Method with + match + notificationHandlings + |> Map.tryFind request.Method + with | Some handling -> try match request.Params with @@ -518,7 +622,10 @@ module Client = let handleNotification (notification: JsonRpc.Notification) = async { - match notificationHandlings |> Map.tryFind notification.Method with + match + notificationHandlings + |> Map.tryFind notification.Method + with | Some handling -> try match notification.Params with diff --git a/src/OptionConverter.fs b/src/OptionConverter.fs new file mode 100644 index 0000000..796b30c --- /dev/null +++ b/src/OptionConverter.fs @@ -0,0 +1,126 @@ +namespace Ionide.LanguageServerProtocol.JsonUtils +open Newtonsoft.Json +open Microsoft.FSharp.Reflection +open System +open System.Collections.Concurrent +open System.Reflection + + + +module internal Converters = + open System.Collections.Concurrent + let inline memorise (f: 'a -> 'b) : 'a -> 'b = + let d = ConcurrentDictionary<'a, 'b>() + fun key -> d.GetOrAdd(key, f) + + let inline memoriseByHash (f: 'a -> 'b) : 'a -> 'b = + let d = ConcurrentDictionary() + + fun key -> + let hash = key.GetHashCode() + + match d.TryGetValue(hash) with + | (true, value) -> value + | _ -> + let value = f key + d.TryAdd(hash, value) |> ignore + value +open Converters + + +type private CaseInfo = + { Info: UnionCaseInfo + Fields: PropertyInfo[] + GetFieldValues: obj -> obj[] + Create: obj[] -> obj } + +type private UnionInfo = + { Cases: CaseInfo[] + GetTag: obj -> int } + + member u.GetCaseOf(value: obj) = + let tag = u.GetTag value + u.Cases |> Array.find (fun case -> case.Info.Tag = tag) + +module private UnionInfo = + + let private create (ty: Type) = + assert (ty |> FSharpType.IsUnion) + + let cases = + FSharpType.GetUnionCases ty + |> Array.map (fun case -> + { Info = case + Fields = case.GetFields() + GetFieldValues = FSharpValue.PreComputeUnionReader case + Create = FSharpValue.PreComputeUnionConstructor case }) + + { Cases = cases; GetTag = FSharpValue.PreComputeUnionTagReader ty } + + let get: Type -> _ = memoriseByHash (create) + +module Type = + let numerics = + [| typeof + typeof + typeof + typeof + //ENHANCEMENT: other number types + |] + + let numericHashes = numerics |> Array.map (fun t -> t.GetHashCode()) + let stringHash = typeof.GetHashCode() + let boolHash = typeof.GetHashCode() + + let inline isOption (t: Type) = + t.IsGenericType + && t.GetGenericTypeDefinition() = typedefof<_ option> + + let inline isString (t: Type) = t.GetHashCode() = stringHash + let inline isBool (t: Type) = t.GetHashCode() = boolHash + + let inline isNumeric (t: Type) = + let hash = t.GetHashCode() + numericHashes |> Array.contains hash + +[] +type OptionConverter() = + inherit JsonConverter() + + let getInnerType = + memoriseByHash (fun (t: Type) -> + let innerType = t.GetGenericArguments()[0] + + if innerType.IsValueType then + typedefof>.MakeGenericType([| innerType |]) + else + innerType) + + let canConvert = memoriseByHash (Type.isOption) + + override __.CanConvert(t) = canConvert t + + override __.WriteJson(writer, value, serializer) = + let value = + if isNull value then + null + else + let union = UnionInfo.get (value.GetType()) + let case = union.GetCaseOf value + case.GetFieldValues value |> Array.head + + serializer.Serialize(writer, value) + + override __.ReadJson(reader, t, _existingValue, serializer) = + match reader.TokenType with + | JsonToken.Null -> null // = None + | _ -> + let innerType = getInnerType t + + let value = serializer.Deserialize(reader, innerType) + + if isNull value then + null + else + let union = UnionInfo.get t + union.Cases[1].Create [| value |] \ No newline at end of file diff --git a/src/Server.fs b/src/Server.fs index a4bf97c..3ba64aa 100644 --- a/src/Server.fs +++ b/src/Server.fs @@ -84,11 +84,11 @@ type ILspServer = /// The go to declaration request is sent from the client to the server to resolve the declaration location /// of a symbol at a given text document position - abstract member TextDocumentDeclaration: TextDocumentPositionParams -> AsyncLspResult + abstract member TextDocumentDeclaration: TextDocumentPositionParams -> AsyncLspResult /// The goto definition request is sent from the client to the server to resolve the definition location of /// a symbol at a given text document position. - abstract member TextDocumentDefinition: TextDocumentPositionParams -> AsyncLspResult + abstract member TextDocumentDefinition: TextDocumentPositionParams -> AsyncLspResult /// The references request is sent from the client to the server to resolve project-wide references for @@ -114,12 +114,12 @@ type ILspServer = /// The goto type definition request is sent from the client to the server to resolve the type definition /// location of a symbol at a given text document position. - abstract member TextDocumentTypeDefinition: TextDocumentPositionParams -> AsyncLspResult + abstract member TextDocumentTypeDefinition: TextDocumentPositionParams -> AsyncLspResult /// The goto implementation request is sent from the client to the server to resolve the implementation /// location of a symbol at a given text document position. - abstract member TextDocumentImplementation: TextDocumentPositionParams -> AsyncLspResult + abstract member TextDocumentImplementation: TextDocumentPositionParams -> AsyncLspResult /// The code action request is sent from the client to the server to compute commands for a given text @@ -402,7 +402,7 @@ type LspServer() = /// The initialized notification may only be sent once. abstract member Initialized: InitializedParams -> Async - default __.Initialized(_) = ignoreNotification + default __.Initialized() = ignoreNotification /// The shutdown request is sent from the client to the server. It asks the server to shut down, but to not /// exit (otherwise the response might not be delivered correctly to the client). There is a separate exit @@ -468,18 +468,17 @@ type LspServer() = /// If None is returned then it is deemed that a ‘textDocument/rename’ request is not valid at the given position. abstract member TextDocumentPrepareRename: PrepareRenameParams -> AsyncLspResult - default __.TextDocumentPrepareRename(_) = - AsyncLspResult.success (Some(PrepareRenameResult.Default { DefaultBehavior = true })) + default __.TextDocumentPrepareRename(_) = AsyncLspResult.success (Some(U3.C3 { DefaultBehavior = true })) /// The go to declaration request is sent from the client to the server to resolve the declaration location /// of a symbol at a given text document position. - abstract member TextDocumentDeclaration: TextDocumentPositionParams -> AsyncLspResult + abstract member TextDocumentDeclaration: TextDocumentPositionParams -> AsyncLspResult default __.TextDocumentDeclaration(_) = notImplemented /// The goto definition request is sent from the client to the server to resolve the definition location of /// a symbol at a given text document position. - abstract member TextDocumentDefinition: TextDocumentPositionParams -> AsyncLspResult + abstract member TextDocumentDefinition: TextDocumentPositionParams -> AsyncLspResult default __.TextDocumentDefinition(_) = notImplemented @@ -509,13 +508,13 @@ type LspServer() = /// The goto type definition request is sent from the client to the server to resolve the type definition /// location of a symbol at a given text document position. - abstract member TextDocumentTypeDefinition: TextDocumentPositionParams -> AsyncLspResult + abstract member TextDocumentTypeDefinition: TextDocumentPositionParams -> AsyncLspResult default __.TextDocumentTypeDefinition(_) = notImplemented /// The goto implementation request is sent from the client to the server to resolve the implementation /// location of a symbol at a given text document position. - abstract member TextDocumentImplementation: TextDocumentPositionParams -> AsyncLspResult + abstract member TextDocumentImplementation: TextDocumentPositionParams -> AsyncLspResult default __.TextDocumentImplementation(_) = notImplemented @@ -848,7 +847,7 @@ type LspServer() = interface ILspServer with member this.Dispose() = this.Dispose() member this.Initialize(p: InitializeParams) = this.Initialize(p) - member this.Initialized(p: InitializedParams) = this.Initialized(p) + member this.Initialized() = this.Initialized() member this.Shutdown() = this.Shutdown() member this.Exit() = this.Exit() member this.TextDocumentHover(p: TextDocumentPositionParams) = this.TextDocumentHover(p) diff --git a/src/TypeDefaults.fs b/src/TypeDefaults.fs new file mode 100644 index 0000000..c3d8050 --- /dev/null +++ b/src/TypeDefaults.fs @@ -0,0 +1,213 @@ +namespace Ionide.LanguageServerProtocol.Types +[] +module Extensions = + + type SymbolKindCapabilities = + + static member DefaultValueSet = [| + SymbolKind.File + SymbolKind.Module + SymbolKind.Namespace + SymbolKind.Package + SymbolKind.Class + SymbolKind.Method + SymbolKind.Property + SymbolKind.Field + SymbolKind.Constructor + SymbolKind.Enum + SymbolKind.Interface + SymbolKind.Function + SymbolKind.Variable + SymbolKind.Constant + SymbolKind.String + SymbolKind.Number + SymbolKind.Boolean + SymbolKind.Array + |] + + type CompletionItemKindCapabilities = + static member DefaultValueSet = [| + CompletionItemKind.Text + CompletionItemKind.Method + CompletionItemKind.Function + CompletionItemKind.Constructor + CompletionItemKind.Field + CompletionItemKind.Variable + CompletionItemKind.Class + CompletionItemKind.Interface + CompletionItemKind.Module + CompletionItemKind.Property + CompletionItemKind.Unit + CompletionItemKind.Value + CompletionItemKind.Enum + CompletionItemKind.Keyword + CompletionItemKind.Snippet + CompletionItemKind.Color + CompletionItemKind.File + CompletionItemKind.Reference + |] + + type TextDocumentSyncOptions with + static member Default = { + OpenClose = None + Change = None + WillSave = None + WillSaveWaitUntil = None + Save = None + } + + type WorkspaceFoldersServerCapabilities with + static member Default = { Supported = None; ChangeNotifications = None } + + type FileOperationPatternOptions with + static member Default = { IgnoreCase = None } + + type FileOperationOptions with + static member Default = { + DidCreate = None + WillCreate = None + DidRename = None + WillRename = None + DidDelete = None + WillDelete = None + } + + + type WorkspaceServerCapabilities = + static member Default = {| WorkspaceFolders = None; FileOperations = None |} + + + type ServerCapabilities with + static member Default = { + TextDocumentSync = None + HoverProvider = None + CompletionProvider = None + SignatureHelpProvider = None + DefinitionProvider = None + TypeDefinitionProvider = None + ImplementationProvider = None + ReferencesProvider = None + DocumentHighlightProvider = None + DocumentSymbolProvider = None + WorkspaceSymbolProvider = None + CodeActionProvider = None + CodeLensProvider = None + DocumentFormattingProvider = None + DocumentRangeFormattingProvider = None + DocumentOnTypeFormattingProvider = None + RenameProvider = None + DocumentLinkProvider = None + ExecuteCommandProvider = None + Workspace = None + Experimental = None + PositionEncoding = None + NotebookDocumentSync = None + DeclarationProvider = None + ColorProvider = None + FoldingRangeProvider = None + SelectionRangeProvider = None + CallHierarchyProvider = None + LinkedEditingRangeProvider = None + SemanticTokensProvider = None + MonikerProvider = None + TypeHierarchyProvider = None + InlineValueProvider = None + InlayHintProvider = None + DiagnosticProvider = None + } + + + type InitializeResult with + static member Default = { Capabilities = ServerCapabilities.Default; ServerInfo = None } + + type CompletionItem with + static member Create(label: string) = { + Label = label + LabelDetails = None + Kind = None + Tags = None + Detail = None + Documentation = None + Deprecated = None + Preselect = None + SortText = None + FilterText = None + InsertText = None + InsertTextFormat = None + InsertTextMode = None + TextEdit = None + TextEditText = None + AdditionalTextEdits = None + CommitCharacters = None + Command = None + Data = None + } + + type WorkDoneProgressKind = + | Begin + | Report + | End + + override x.ToString() = + match x with + | Begin -> "begin" + | Report -> "report" + | End -> "end" + + type WorkDoneProgressEnd with + static member Create(?message) = { Kind = WorkDoneProgressKind.End.ToString(); Message = message } + + type WorkDoneProgressBegin with + static member Create(title, ?cancellable, ?message, ?percentage) = { + Kind = WorkDoneProgressKind.Begin.ToString() + Title = title + Cancellable = cancellable + Message = message + Percentage = percentage + } + + type WorkDoneProgressReport with + static member Create(?cancellable, ?message, ?percentage) = { + Kind = WorkDoneProgressKind.Report.ToString() + Cancellable = cancellable + Message = message + Percentage = percentage + } + + + type WorkspaceEdit with + static member DocumentChangesToChanges(edits: TextDocumentEdit[]) = + edits + |> Array.map (fun edit -> + let edits = + edit.Edits + |> Array.choose ( + function + | U2.C1 x -> Some x + | _ -> None + ) + + edit.TextDocument.Uri.ToString(), edits + ) + |> Map.ofArray + + static member CanUseDocumentChanges(capabilities: ClientCapabilities) = + (capabilities.Workspace + |> Option.bind (fun x -> x.WorkspaceEdit) + |> Option.bind (fun x -> x.DocumentChanges)) = Some true + + static member Create(edits: TextDocumentEdit[], capabilities: ClientCapabilities) = + if WorkspaceEdit.CanUseDocumentChanges(capabilities) then + let edits = + edits + |> Array.map U4.C1 + + { Changes = None; DocumentChanges = Some edits; ChangeAnnotations = None } + else + { + Changes = Some(WorkspaceEdit.DocumentChangesToChanges edits) + DocumentChanges = None + ChangeAnnotations = None + } + + type TextDocumentCodeActionResult = U2[] \ No newline at end of file diff --git a/src/Types.cg.fs b/src/Types.cg.fs new file mode 100644 index 0000000..303e8cb --- /dev/null +++ b/src/Types.cg.fs @@ -0,0 +1,7517 @@ +namespace rec Ionide.LanguageServerProtocol.Types + +open System +open System.Runtime.Serialization +open System.Diagnostics +open Newtonsoft.Json +open Newtonsoft.Json.Linq +/// URI's are transferred as strings. The URI's format is defined in https://tools.ietf.org/html/rfc3986 +/// +/// See: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#uri +type URI = string +/// URI's are transferred as strings. The URI's format is defined in https://tools.ietf.org/html/rfc3986 +/// +/// See: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#uri +type DocumentUri = string +/// Regular expressions are transferred as strings. +/// +/// See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#regExp +type RegExp = string + +type IWorkDoneProgressOptions = + abstract member WorkDoneProgress: bool option + +type IWorkDoneProgressParams = + /// An optional token that a server can use to report work done progress. + abstract member WorkDoneToken: ProgressToken option + +type IPartialResultParams = + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + abstract member PartialResultToken: ProgressToken option + +/// A parameter literal used in requests to pass a text document and a position inside that +/// document. +type ITextDocumentPositionParams = + /// The text document. + abstract member TextDocument: TextDocumentIdentifier + /// The position inside the text document. + abstract member Position: Position + +/// General text document registration options. +type ITextDocumentRegistrationOptions = + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + abstract member DocumentSelector: DocumentSelector option + +type IImplementationOptions = + inherit IWorkDoneProgressOptions + +type ITypeDefinitionOptions = + inherit IWorkDoneProgressOptions + +type IDocumentColorOptions = + inherit IWorkDoneProgressOptions + +type IFoldingRangeOptions = + inherit IWorkDoneProgressOptions + +type IDeclarationOptions = + inherit IWorkDoneProgressOptions + +type ISelectionRangeOptions = + inherit IWorkDoneProgressOptions + +/// Call hierarchy options used during static registration. +/// +/// @since 3.16.0 +type ICallHierarchyOptions = + inherit IWorkDoneProgressOptions + +/// @since 3.16.0 +type ISemanticTokensOptions = + /// The legend used by the server + abstract member Legend: SemanticTokensLegend + /// Server supports providing semantic tokens for a specific range + /// of a document. + abstract member Range: U2 option + /// Server supports providing semantic tokens for a full document. + abstract member Full: U2 option + inherit IWorkDoneProgressOptions + +type ILinkedEditingRangeOptions = + inherit IWorkDoneProgressOptions + +type IMonikerOptions = + inherit IWorkDoneProgressOptions + +/// Type hierarchy options used during static registration. +/// +/// @since 3.17.0 +type ITypeHierarchyOptions = + inherit IWorkDoneProgressOptions + +/// Inline value options used during static registration. +/// +/// @since 3.17.0 +type IInlineValueOptions = + inherit IWorkDoneProgressOptions + +/// Inlay hint options used during static registration. +/// +/// @since 3.17.0 +type IInlayHintOptions = + /// The server provides support to resolve additional + /// information for an inlay hint item. + abstract member ResolveProvider: bool option + inherit IWorkDoneProgressOptions + +/// Diagnostic options. +/// +/// @since 3.17.0 +type IDiagnosticOptions = + /// An optional identifier under which the diagnostics are + /// managed by the client. + abstract member Identifier: string option + /// Whether the language has inter file dependencies meaning that + /// editing code in one file can result in a different diagnostic + /// set in another file. Inter file dependencies are common for + /// most programming languages and typically uncommon for linters. + abstract member InterFileDependencies: bool + /// The server provides support for workspace diagnostics as well. + abstract member WorkspaceDiagnostics: bool + inherit IWorkDoneProgressOptions + +/// The initialize parameters +type I_InitializeParams = + /// The process Id of the parent process that started + /// the server. + /// + /// Is `null` if the process has not been started by another process. + /// If the parent process is not alive then the server should exit. + abstract member ProcessId: int32 option + /// Information about the client + /// + /// @since 3.15.0 + abstract member ClientInfo: _InitializeParamsClientInfo option + /// The locale the client is currently showing the user interface + /// in. This must not necessarily be the locale of the operating + /// system. + /// + /// Uses IETF language tags as the value's syntax + /// (See https://en.wikipedia.org/wiki/IETF_language_tag) + /// + /// @since 3.16.0 + abstract member Locale: string option + /// The rootPath of the workspace. Is null + /// if no folder is open. + /// + /// @deprecated in favour of rootUri. + abstract member RootPath: string option + /// The rootUri of the workspace. Is null if no + /// folder is open. If both `rootPath` and `rootUri` are set + /// `rootUri` wins. + /// + /// @deprecated in favour of workspaceFolders. + abstract member RootUri: DocumentUri option + /// The capabilities provided by the client (editor or tool) + abstract member Capabilities: ClientCapabilities + /// User provided initialization options. + abstract member InitializationOptions: LSPAny option + /// The initial trace setting. If omitted trace is disabled ('off'). + abstract member Trace: TraceValues option + inherit IWorkDoneProgressParams + +type IWorkspaceFoldersInitializeParams = + /// The workspace folders configured in the client when the server starts. + /// + /// This property is only available if the client supports workspace folders. + /// It can be `null` if the client supports workspace folders but none are + /// configured. + /// + /// @since 3.6.0 + abstract member WorkspaceFolders: WorkspaceFolder[] option + +/// Save options. +type ISaveOptions = + /// The client is supposed to include the content on save. + abstract member IncludeText: bool option + +/// Completion options. +type ICompletionOptions = + /// Most tools trigger completion request automatically without explicitly requesting + /// it using a keyboard shortcut (e.g. Ctrl+Space). Typically they do so when the user + /// starts to type an identifier. For example if the user types `c` in a JavaScript file + /// code complete will automatically pop up present `console` besides others as a + /// completion item. Characters that make up identifiers don't need to be listed here. + /// + /// If code complete should automatically be trigger on characters not being valid inside + /// an identifier (for example `.` in JavaScript) list them in `triggerCharacters`. + abstract member TriggerCharacters: string[] option + /// The list of all possible characters that commit a completion. This field can be used + /// if clients don't support individual commit characters per completion item. See + /// `ClientCapabilities.textDocument.completion.completionItem.commitCharactersSupport` + /// + /// If a server provides both `allCommitCharacters` and commit characters on an individual + /// completion item the ones on the completion item win. + /// + /// @since 3.2.0 + abstract member AllCommitCharacters: string[] option + /// The server provides support to resolve additional + /// information for a completion item. + abstract member ResolveProvider: bool option + /// The server supports the following `CompletionItem` specific + /// capabilities. + /// + /// @since 3.17.0 + abstract member CompletionItem: CompletionOptionsCompletionItem option + inherit IWorkDoneProgressOptions + +/// Hover options. +type IHoverOptions = + inherit IWorkDoneProgressOptions + +/// Server Capabilities for a {@link SignatureHelpRequest}. +type ISignatureHelpOptions = + /// List of characters that trigger signature help automatically. + abstract member TriggerCharacters: string[] option + /// List of characters that re-trigger signature help. + /// + /// These trigger characters are only active when signature help is already showing. All trigger characters + /// are also counted as re-trigger characters. + /// + /// @since 3.15.0 + abstract member RetriggerCharacters: string[] option + inherit IWorkDoneProgressOptions + +/// Server Capabilities for a {@link DefinitionRequest}. +type IDefinitionOptions = + inherit IWorkDoneProgressOptions + +/// Reference options. +type IReferenceOptions = + inherit IWorkDoneProgressOptions + +/// Provider options for a {@link DocumentHighlightRequest}. +type IDocumentHighlightOptions = + inherit IWorkDoneProgressOptions + +/// A base for all symbol information. +type IBaseSymbolInformation = + /// The name of this symbol. + abstract member Name: string + /// The kind of this symbol. + abstract member Kind: SymbolKind + /// Tags for this symbol. + /// + /// @since 3.16.0 + abstract member Tags: SymbolTag[] option + /// The name of the symbol containing this symbol. This information is for + /// user interface purposes (e.g. to render a qualifier in the user interface + /// if necessary). It can't be used to re-infer a hierarchy for the document + /// symbols. + abstract member ContainerName: string option + +/// Provider options for a {@link DocumentSymbolRequest}. +type IDocumentSymbolOptions = + /// A human-readable string that is shown when multiple outlines trees + /// are shown for the same document. + /// + /// @since 3.16.0 + abstract member Label: string option + inherit IWorkDoneProgressOptions + +/// Provider options for a {@link CodeActionRequest}. +type ICodeActionOptions = + /// CodeActionKinds that this server may return. + /// + /// The list of kinds may be generic, such as `CodeActionKind.Refactor`, or the server + /// may list out every specific kind they provide. + abstract member CodeActionKinds: CodeActionKind[] option + /// The server provides support to resolve additional + /// information for a code action. + /// + /// @since 3.16.0 + abstract member ResolveProvider: bool option + inherit IWorkDoneProgressOptions + +/// Server capabilities for a {@link WorkspaceSymbolRequest}. +type IWorkspaceSymbolOptions = + /// The server provides support to resolve additional + /// information for a workspace symbol. + /// + /// @since 3.17.0 + abstract member ResolveProvider: bool option + inherit IWorkDoneProgressOptions + +/// Code Lens provider options of a {@link CodeLensRequest}. +type ICodeLensOptions = + /// Code lens has a resolve provider as well. + abstract member ResolveProvider: bool option + inherit IWorkDoneProgressOptions + +/// Provider options for a {@link DocumentLinkRequest}. +type IDocumentLinkOptions = + /// Document links have a resolve provider as well. + abstract member ResolveProvider: bool option + inherit IWorkDoneProgressOptions + +/// Provider options for a {@link DocumentFormattingRequest}. +type IDocumentFormattingOptions = + inherit IWorkDoneProgressOptions + +/// Provider options for a {@link DocumentRangeFormattingRequest}. +type IDocumentRangeFormattingOptions = + inherit IWorkDoneProgressOptions + +/// Provider options for a {@link DocumentOnTypeFormattingRequest}. +type IDocumentOnTypeFormattingOptions = + /// A character on which formatting should be triggered, like `{`. + abstract member FirstTriggerCharacter: string + /// More trigger characters. + abstract member MoreTriggerCharacter: string[] option + +/// Provider options for a {@link RenameRequest}. +type IRenameOptions = + /// Renames should be checked and tested before being executed. + /// + /// @since version 3.12.0 + abstract member PrepareProvider: bool option + inherit IWorkDoneProgressOptions + +/// The server capabilities of a {@link ExecuteCommandRequest}. +type IExecuteCommandOptions = + /// The commands to be executed on the server + abstract member Commands: string[] + inherit IWorkDoneProgressOptions + +/// A generic resource operation. +type IResourceOperation = + /// The resource operation kind. + abstract member Kind: string + /// An optional annotation identifier describing the operation. + /// + /// @since 3.16.0 + abstract member AnnotationId: ChangeAnnotationIdentifier option + +/// A diagnostic report with a full set of problems. +/// +/// @since 3.17.0 +type IFullDocumentDiagnosticReport = + /// A full document diagnostic report. + abstract member Kind: string + /// An optional result id. If provided it will + /// be sent on the next diagnostic request for the + /// same document. + abstract member ResultId: string option + /// The actual items. + abstract member Items: Diagnostic[] + +/// A diagnostic report indicating that the last returned +/// report is still accurate. +/// +/// @since 3.17.0 +type IUnchangedDocumentDiagnosticReport = + /// A document diagnostic report indicating + /// no changes to the last result. A server can + /// only return `unchanged` if result ids are + /// provided. + abstract member Kind: string + /// A result id which will be sent on the next + /// diagnostic request for the same document. + abstract member ResultId: string + +/// A literal to identify a text document in the client. +type ITextDocumentIdentifier = + /// The text document's uri. + abstract member Uri: DocumentUri + +/// A text edit applicable to a text document. +type ITextEdit = + /// The range of the text document to be manipulated. To insert + /// text into a document create a range where start === end. + abstract member Range: Range + /// The string to be inserted. For delete operations use an + /// empty string. + abstract member NewText: string + +/// Options specific to a notebook plus its cells +/// to be synced to the server. +/// +/// If a selector provides a notebook document +/// filter but no cell selector all cells of a +/// matching notebook document will be synced. +/// +/// If a selector provides no notebook document +/// filter but only a cell selector all notebook +/// document that contain at least one matching +/// cell will be synced. +/// +/// @since 3.17.0 +type INotebookDocumentSyncOptions = + /// The notebooks to be synced + abstract member NotebookSelector: NotebookDocumentSyncOptionsNotebookSelector[] + /// Whether save notification should be forwarded to + /// the server. Will only be honored if mode === `notebook`. + abstract member Save: bool option + +type InitializedParams = unit + +type ImplementationParams = + { + /// The text document. + TextDocument: TextDocumentIdentifier + /// The position inside the text document. + Position: Position + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + PartialResultToken: ProgressToken option + } + + interface ITextDocumentPositionParams with + /// The text document. + member x.TextDocument = x.TextDocument + /// The position inside the text document. + member x.Position = x.Position + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + + interface IPartialResultParams with + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + member x.PartialResultToken = x.PartialResultToken + +/// Represents a location inside a resource, such as a line +/// inside a text file. +type Location = { Uri: DocumentUri; Range: Range } + +type ImplementationRegistrationOptions = + { + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + [] + DocumentSelector: DocumentSelector option + WorkDoneProgress: bool option + /// The id used to register the request. The id can be used to deregister + /// the request again. See also Registration#id. + Id: string option + } + + interface ITextDocumentRegistrationOptions with + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + member x.DocumentSelector = x.DocumentSelector + + interface IImplementationOptions + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +type TypeDefinitionParams = + { + /// The text document. + TextDocument: TextDocumentIdentifier + /// The position inside the text document. + Position: Position + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + PartialResultToken: ProgressToken option + } + + interface ITextDocumentPositionParams with + /// The text document. + member x.TextDocument = x.TextDocument + /// The position inside the text document. + member x.Position = x.Position + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + + interface IPartialResultParams with + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + member x.PartialResultToken = x.PartialResultToken + +type TypeDefinitionRegistrationOptions = + { + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + [] + DocumentSelector: DocumentSelector option + WorkDoneProgress: bool option + /// The id used to register the request. The id can be used to deregister + /// the request again. See also Registration#id. + Id: string option + } + + interface ITextDocumentRegistrationOptions with + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + member x.DocumentSelector = x.DocumentSelector + + interface ITypeDefinitionOptions + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// A workspace folder inside a client. +type WorkspaceFolder = + { + /// The associated URI for this workspace folder. + Uri: URI + /// The name of the workspace folder. Used to refer to this + /// workspace folder in the user interface. + Name: string + } + +/// The parameters of a `workspace/didChangeWorkspaceFolders` notification. +type DidChangeWorkspaceFoldersParams = + { + /// The actual workspace folder change event. + Event: WorkspaceFoldersChangeEvent + } + +/// The parameters of a configuration request. +type ConfigurationParams = { Items: ConfigurationItem[] } + +/// Parameters for a {@link DocumentColorRequest}. +type DocumentColorParams = + { + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + PartialResultToken: ProgressToken option + /// The text document. + TextDocument: TextDocumentIdentifier + } + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + + interface IPartialResultParams with + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + member x.PartialResultToken = x.PartialResultToken + +/// Represents a color range from a document. +type ColorInformation = + { + /// The range in the document where this color appears. + Range: Range + /// The actual color value for this color range. + Color: Color + } + +type DocumentColorRegistrationOptions = + { + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + [] + DocumentSelector: DocumentSelector option + WorkDoneProgress: bool option + /// The id used to register the request. The id can be used to deregister + /// the request again. See also Registration#id. + Id: string option + } + + interface ITextDocumentRegistrationOptions with + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + member x.DocumentSelector = x.DocumentSelector + + interface IDocumentColorOptions + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// Parameters for a {@link ColorPresentationRequest}. +type ColorPresentationParams = + { + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + PartialResultToken: ProgressToken option + /// The text document. + TextDocument: TextDocumentIdentifier + /// The color to request presentations for. + Color: Color + /// The range where the color would be inserted. Serves as a context. + Range: Range + } + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + + interface IPartialResultParams with + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + member x.PartialResultToken = x.PartialResultToken + +type ColorPresentation = + { + /// The label of this color presentation. It will be shown on the color + /// picker header. By default this is also the text that is inserted when selecting + /// this color presentation. + Label: string + /// An {@link TextEdit edit} which is applied to a document when selecting + /// this presentation for the color. When `falsy` the {@link ColorPresentation.label label} + /// is used. + TextEdit: TextEdit option + /// An optional array of additional {@link TextEdit text edits} that are applied when + /// selecting this color presentation. Edits must not overlap with the main {@link ColorPresentation.textEdit edit} nor with themselves. + AdditionalTextEdits: TextEdit[] option + } + +type WorkDoneProgressOptions = + { WorkDoneProgress: bool option } + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// General text document registration options. +type TextDocumentRegistrationOptions = + { + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + [] + DocumentSelector: DocumentSelector option + } + + interface ITextDocumentRegistrationOptions with + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + member x.DocumentSelector = x.DocumentSelector + +/// Parameters for a {@link FoldingRangeRequest}. +type FoldingRangeParams = + { + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + PartialResultToken: ProgressToken option + /// The text document. + TextDocument: TextDocumentIdentifier + } + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + + interface IPartialResultParams with + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + member x.PartialResultToken = x.PartialResultToken + +/// Represents a folding range. To be valid, start and end line must be bigger than zero and smaller +/// than the number of lines in the document. Clients are free to ignore invalid ranges. +type FoldingRange = + { + /// The zero-based start line of the range to fold. The folded area starts after the line's last character. + /// To be valid, the end must be zero or larger and smaller than the number of lines in the document. + StartLine: uint32 + /// The zero-based character offset from where the folded range starts. If not defined, defaults to the length of the start line. + StartCharacter: uint32 option + /// The zero-based end line of the range to fold. The folded area ends with the line's last character. + /// To be valid, the end must be zero or larger and smaller than the number of lines in the document. + EndLine: uint32 + /// The zero-based character offset before the folded range ends. If not defined, defaults to the length of the end line. + EndCharacter: uint32 option + /// Describes the kind of the folding range such as `comment' or 'region'. The kind + /// is used to categorize folding ranges and used by commands like 'Fold all comments'. + /// See {@link FoldingRangeKind} for an enumeration of standardized kinds. + Kind: FoldingRangeKind option + /// The text that the client should show when the specified range is + /// collapsed. If not defined or not supported by the client, a default + /// will be chosen by the client. + /// + /// @since 3.17.0 + CollapsedText: string option + } + +type FoldingRangeRegistrationOptions = + { + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + [] + DocumentSelector: DocumentSelector option + WorkDoneProgress: bool option + /// The id used to register the request. The id can be used to deregister + /// the request again. See also Registration#id. + Id: string option + } + + interface ITextDocumentRegistrationOptions with + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + member x.DocumentSelector = x.DocumentSelector + + interface IFoldingRangeOptions + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +type DeclarationParams = + { + /// The text document. + TextDocument: TextDocumentIdentifier + /// The position inside the text document. + Position: Position + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + PartialResultToken: ProgressToken option + } + + interface ITextDocumentPositionParams with + /// The text document. + member x.TextDocument = x.TextDocument + /// The position inside the text document. + member x.Position = x.Position + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + + interface IPartialResultParams with + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + member x.PartialResultToken = x.PartialResultToken + +type DeclarationRegistrationOptions = + { + WorkDoneProgress: bool option + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + [] + DocumentSelector: DocumentSelector option + /// The id used to register the request. The id can be used to deregister + /// the request again. See also Registration#id. + Id: string option + } + + interface IDeclarationOptions + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + + interface ITextDocumentRegistrationOptions with + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + member x.DocumentSelector = x.DocumentSelector + +/// A parameter literal used in selection range requests. +type SelectionRangeParams = + { + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + PartialResultToken: ProgressToken option + /// The text document. + TextDocument: TextDocumentIdentifier + /// The positions inside the text document. + Positions: Position[] + } + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + + interface IPartialResultParams with + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + member x.PartialResultToken = x.PartialResultToken + +/// A selection range represents a part of a selection hierarchy. A selection range +/// may have a parent selection range that contains it. +type SelectionRange = + { + /// The {@link Range range} of this selection range. + Range: Range + /// The parent selection range containing this range. Therefore `parent.range` must contain `this.range`. + Parent: SelectionRange option + } + +type SelectionRangeRegistrationOptions = + { + WorkDoneProgress: bool option + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + [] + DocumentSelector: DocumentSelector option + /// The id used to register the request. The id can be used to deregister + /// the request again. See also Registration#id. + Id: string option + } + + interface ISelectionRangeOptions + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + + interface ITextDocumentRegistrationOptions with + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + member x.DocumentSelector = x.DocumentSelector + +type WorkDoneProgressCreateParams = + { + /// The token to be used to report progress. + Token: ProgressToken + } + +type WorkDoneProgressCancelParams = + { + /// The token to be used to report progress. + Token: ProgressToken + } + +/// The parameter of a `textDocument/prepareCallHierarchy` request. +/// +/// @since 3.16.0 +type CallHierarchyPrepareParams = + { + /// The text document. + TextDocument: TextDocumentIdentifier + /// The position inside the text document. + Position: Position + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + } + + interface ITextDocumentPositionParams with + /// The text document. + member x.TextDocument = x.TextDocument + /// The position inside the text document. + member x.Position = x.Position + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + +/// Represents programming constructs like functions or constructors in the context +/// of call hierarchy. +/// +/// @since 3.16.0 +type CallHierarchyItem = + { + /// The name of this item. + Name: string + /// The kind of this item. + Kind: SymbolKind + /// Tags for this item. + Tags: SymbolTag[] option + /// More detail for this item, e.g. the signature of a function. + Detail: string option + /// The resource identifier of this item. + Uri: DocumentUri + /// The range enclosing this symbol not including leading/trailing whitespace but everything else, e.g. comments and code. + Range: Range + /// The range that should be selected and revealed when this symbol is being picked, e.g. the name of a function. + /// Must be contained by the {@link CallHierarchyItem.range `range`}. + SelectionRange: Range + /// A data entry field that is preserved between a call hierarchy prepare and + /// incoming calls or outgoing calls requests. + Data: LSPAny option + } + +/// Call hierarchy options used during static or dynamic registration. +/// +/// @since 3.16.0 +type CallHierarchyRegistrationOptions = + { + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + [] + DocumentSelector: DocumentSelector option + WorkDoneProgress: bool option + /// The id used to register the request. The id can be used to deregister + /// the request again. See also Registration#id. + Id: string option + } + + interface ITextDocumentRegistrationOptions with + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + member x.DocumentSelector = x.DocumentSelector + + interface ICallHierarchyOptions + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// The parameter of a `callHierarchy/incomingCalls` request. +/// +/// @since 3.16.0 +type CallHierarchyIncomingCallsParams = + { + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + PartialResultToken: ProgressToken option + Item: CallHierarchyItem + } + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + + interface IPartialResultParams with + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + member x.PartialResultToken = x.PartialResultToken + +/// Represents an incoming call, e.g. a caller of a method or constructor. +/// +/// @since 3.16.0 +type CallHierarchyIncomingCall = + { + /// The item that makes the call. + From: CallHierarchyItem + /// The ranges at which the calls appear. This is relative to the caller + /// denoted by {@link CallHierarchyIncomingCall.from `this.from`}. + FromRanges: Range[] + } + +/// The parameter of a `callHierarchy/outgoingCalls` request. +/// +/// @since 3.16.0 +type CallHierarchyOutgoingCallsParams = + { + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + PartialResultToken: ProgressToken option + Item: CallHierarchyItem + } + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + + interface IPartialResultParams with + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + member x.PartialResultToken = x.PartialResultToken + +/// Represents an outgoing call, e.g. calling a getter from a method or a method from a constructor etc. +/// +/// @since 3.16.0 +type CallHierarchyOutgoingCall = + { + /// The item that is called. + To: CallHierarchyItem + /// The range at which this item is called. This is the range relative to the caller, e.g the item + /// passed to {@link CallHierarchyItemProvider.provideCallHierarchyOutgoingCalls `provideCallHierarchyOutgoingCalls`} + /// and not {@link CallHierarchyOutgoingCall.to `this.to`}. + FromRanges: Range[] + } + +/// @since 3.16.0 +type SemanticTokensParams = + { + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + PartialResultToken: ProgressToken option + /// The text document. + TextDocument: TextDocumentIdentifier + } + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + + interface IPartialResultParams with + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + member x.PartialResultToken = x.PartialResultToken + +/// @since 3.16.0 +type SemanticTokens = + { + /// An optional result id. If provided and clients support delta updating + /// the client will include the result id in the next semantic token request. + /// A server can then instead of computing all semantic tokens again simply + /// send a delta. + ResultId: string option + /// The actual tokens. + Data: uint32[] + } + +/// @since 3.16.0 +type SemanticTokensPartialResult = { Data: uint32[] } + +type SemanticTokensOptionsFullC2 = + { + /// The server supports deltas for full documents. + Delta: bool option + } + +/// @since 3.16.0 +type SemanticTokensRegistrationOptions = + { + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + [] + DocumentSelector: DocumentSelector option + WorkDoneProgress: bool option + /// The legend used by the server + Legend: SemanticTokensLegend + /// Server supports providing semantic tokens for a specific range + /// of a document. + Range: U2 option + /// Server supports providing semantic tokens for a full document. + Full: U2 option + /// The id used to register the request. The id can be used to deregister + /// the request again. See also Registration#id. + Id: string option + } + + interface ITextDocumentRegistrationOptions with + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + member x.DocumentSelector = x.DocumentSelector + + interface ISemanticTokensOptions with + /// The legend used by the server + member x.Legend = x.Legend + /// Server supports providing semantic tokens for a specific range + /// of a document. + member x.Range = x.Range + /// Server supports providing semantic tokens for a full document. + member x.Full = x.Full + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// @since 3.16.0 +type SemanticTokensDeltaParams = + { + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + PartialResultToken: ProgressToken option + /// The text document. + TextDocument: TextDocumentIdentifier + /// The result id of a previous response. The result Id can either point to a full response + /// or a delta response depending on what was received last. + PreviousResultId: string + } + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + + interface IPartialResultParams with + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + member x.PartialResultToken = x.PartialResultToken + +/// @since 3.16.0 +type SemanticTokensDelta = + { + ResultId: string option + /// The semantic token edits to transform a previous result into a new result. + Edits: SemanticTokensEdit[] + } + +/// @since 3.16.0 +type SemanticTokensDeltaPartialResult = { Edits: SemanticTokensEdit[] } + +/// @since 3.16.0 +type SemanticTokensRangeParams = + { + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + PartialResultToken: ProgressToken option + /// The text document. + TextDocument: TextDocumentIdentifier + /// The range the semantic tokens are requested for. + Range: Range + } + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + + interface IPartialResultParams with + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + member x.PartialResultToken = x.PartialResultToken + +/// Params to show a resource in the UI. +/// +/// @since 3.16.0 +type ShowDocumentParams = + { + /// The uri to show. + Uri: URI + /// Indicates to show the resource in an external program. + /// To show, for example, `https://code.visualstudio.com/` + /// in the default WEB browser set `external` to `true`. + External: bool option + /// An optional property to indicate whether the editor + /// showing the document should take focus or not. + /// Clients might ignore this property if an external + /// program is started. + TakeFocus: bool option + /// An optional selection range if the document is a text + /// document. Clients might ignore the property if an + /// external program is started or the file is not a text + /// file. + Selection: Range option + } + +/// The result of a showDocument request. +/// +/// @since 3.16.0 +type ShowDocumentResult = + { + /// A boolean indicating if the show was successful. + Success: bool + } + +type LinkedEditingRangeParams = + { + /// The text document. + TextDocument: TextDocumentIdentifier + /// The position inside the text document. + Position: Position + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + } + + interface ITextDocumentPositionParams with + /// The text document. + member x.TextDocument = x.TextDocument + /// The position inside the text document. + member x.Position = x.Position + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + +/// The result of a linked editing range request. +/// +/// @since 3.16.0 +type LinkedEditingRanges = + { + /// A list of ranges that can be edited together. The ranges must have + /// identical length and contain identical text content. The ranges cannot overlap. + Ranges: Range[] + /// An optional word pattern (regular expression) that describes valid contents for + /// the given ranges. If no pattern is provided, the client configuration's word + /// pattern will be used. + WordPattern: string option + } + +type LinkedEditingRangeRegistrationOptions = + { + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + [] + DocumentSelector: DocumentSelector option + WorkDoneProgress: bool option + /// The id used to register the request. The id can be used to deregister + /// the request again. See also Registration#id. + Id: string option + } + + interface ITextDocumentRegistrationOptions with + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + member x.DocumentSelector = x.DocumentSelector + + interface ILinkedEditingRangeOptions + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// The parameters sent in notifications/requests for user-initiated creation of +/// files. +/// +/// @since 3.16.0 +type CreateFilesParams = + { + /// An array of all files/folders created in this operation. + Files: FileCreate[] + } + +/// A workspace edit represents changes to many resources managed in the workspace. The edit +/// should either provide `changes` or `documentChanges`. If documentChanges are present +/// they are preferred over `changes` if the client can handle versioned document edits. +/// +/// Since version 3.13.0 a workspace edit can contain resource operations as well. If resource +/// operations are present clients need to execute the operations in the order in which they +/// are provided. So a workspace edit for example can consist of the following two changes: +/// (1) a create file a.txt and (2) a text document edit which insert text into file a.txt. +/// +/// An invalid sequence (e.g. (1) delete file a.txt and (2) insert text into file a.txt) will +/// cause failure of the operation. How the client recovers from the failure is described by +/// the client capability: `workspace.workspaceEdit.failureHandling` +type WorkspaceEdit = + { + /// Holds changes to existing resources. + Changes: Map option + /// Depending on the client capability `workspace.workspaceEdit.resourceOperations` document changes + /// are either an array of `TextDocumentEdit`s to express changes to n different text documents + /// where each text document edit addresses a specific version of a text document. Or it can contain + /// above `TextDocumentEdit`s mixed with create, rename and delete file / folder operations. + /// + /// Whether a client supports versioned document edits is expressed via + /// `workspace.workspaceEdit.documentChanges` client capability. + /// + /// If a client neither supports `documentChanges` nor `workspace.workspaceEdit.resourceOperations` then + /// only plain `TextEdit`s using the `changes` property are supported. + DocumentChanges: U4[] option + /// A map of change annotations that can be referenced in `AnnotatedTextEdit`s or create, rename and + /// delete file / folder operations. + /// + /// Whether clients honor this property depends on the client capability `workspace.changeAnnotationSupport`. + /// + /// @since 3.16.0 + ChangeAnnotations: Map option + } + +/// The options to register for file operations. +/// +/// @since 3.16.0 +type FileOperationRegistrationOptions = + { + /// The actual filters. + Filters: FileOperationFilter[] + } + +/// The parameters sent in notifications/requests for user-initiated renames of +/// files. +/// +/// @since 3.16.0 +type RenameFilesParams = + { + /// An array of all files/folders renamed in this operation. When a folder is renamed, only + /// the folder will be included, and not its children. + Files: FileRename[] + } + +/// The parameters sent in notifications/requests for user-initiated deletes of +/// files. +/// +/// @since 3.16.0 +type DeleteFilesParams = + { + /// An array of all files/folders deleted in this operation. + Files: FileDelete[] + } + +type MonikerParams = + { + /// The text document. + TextDocument: TextDocumentIdentifier + /// The position inside the text document. + Position: Position + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + PartialResultToken: ProgressToken option + } + + interface ITextDocumentPositionParams with + /// The text document. + member x.TextDocument = x.TextDocument + /// The position inside the text document. + member x.Position = x.Position + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + + interface IPartialResultParams with + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + member x.PartialResultToken = x.PartialResultToken + +/// Moniker definition to match LSIF 0.5 moniker definition. +/// +/// @since 3.16.0 +type Moniker = + { + /// The scheme of the moniker. For example tsc or .Net + Scheme: string + /// The identifier of the moniker. The value is opaque in LSIF however + /// schema owners are allowed to define the structure if they want. + Identifier: string + /// The scope in which the moniker is unique + Unique: UniquenessLevel + /// The moniker kind if known. + Kind: MonikerKind option + } + +type MonikerRegistrationOptions = + { + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + [] + DocumentSelector: DocumentSelector option + WorkDoneProgress: bool option + } + + interface ITextDocumentRegistrationOptions with + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + member x.DocumentSelector = x.DocumentSelector + + interface IMonikerOptions + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// The parameter of a `textDocument/prepareTypeHierarchy` request. +/// +/// @since 3.17.0 +type TypeHierarchyPrepareParams = + { + /// The text document. + TextDocument: TextDocumentIdentifier + /// The position inside the text document. + Position: Position + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + } + + interface ITextDocumentPositionParams with + /// The text document. + member x.TextDocument = x.TextDocument + /// The position inside the text document. + member x.Position = x.Position + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + +/// @since 3.17.0 +type TypeHierarchyItem = + { + /// The name of this item. + Name: string + /// The kind of this item. + Kind: SymbolKind + /// Tags for this item. + Tags: SymbolTag[] option + /// More detail for this item, e.g. the signature of a function. + Detail: string option + /// The resource identifier of this item. + Uri: DocumentUri + /// The range enclosing this symbol not including leading/trailing whitespace + /// but everything else, e.g. comments and code. + Range: Range + /// The range that should be selected and revealed when this symbol is being + /// picked, e.g. the name of a function. Must be contained by the + /// {@link TypeHierarchyItem.range `range`}. + SelectionRange: Range + /// A data entry field that is preserved between a type hierarchy prepare and + /// supertypes or subtypes requests. It could also be used to identify the + /// type hierarchy in the server, helping improve the performance on + /// resolving supertypes and subtypes. + Data: LSPAny option + } + +/// Type hierarchy options used during static or dynamic registration. +/// +/// @since 3.17.0 +type TypeHierarchyRegistrationOptions = + { + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + [] + DocumentSelector: DocumentSelector option + WorkDoneProgress: bool option + /// The id used to register the request. The id can be used to deregister + /// the request again. See also Registration#id. + Id: string option + } + + interface ITextDocumentRegistrationOptions with + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + member x.DocumentSelector = x.DocumentSelector + + interface ITypeHierarchyOptions + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// The parameter of a `typeHierarchy/supertypes` request. +/// +/// @since 3.17.0 +type TypeHierarchySupertypesParams = + { + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + PartialResultToken: ProgressToken option + Item: TypeHierarchyItem + } + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + + interface IPartialResultParams with + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + member x.PartialResultToken = x.PartialResultToken + +/// The parameter of a `typeHierarchy/subtypes` request. +/// +/// @since 3.17.0 +type TypeHierarchySubtypesParams = + { + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + PartialResultToken: ProgressToken option + Item: TypeHierarchyItem + } + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + + interface IPartialResultParams with + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + member x.PartialResultToken = x.PartialResultToken + +/// A parameter literal used in inline value requests. +/// +/// @since 3.17.0 +type InlineValueParams = + { + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + /// The text document. + TextDocument: TextDocumentIdentifier + /// The document range for which inline values should be computed. + Range: Range + /// Additional information about the context in which inline values were + /// requested. + Context: InlineValueContext + } + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + +/// Inline value options used during static or dynamic registration. +/// +/// @since 3.17.0 +type InlineValueRegistrationOptions = + { + WorkDoneProgress: bool option + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + [] + DocumentSelector: DocumentSelector option + /// The id used to register the request. The id can be used to deregister + /// the request again. See also Registration#id. + Id: string option + } + + interface IInlineValueOptions + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + + interface ITextDocumentRegistrationOptions with + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + member x.DocumentSelector = x.DocumentSelector + +/// A parameter literal used in inlay hint requests. +/// +/// @since 3.17.0 +type InlayHintParams = + { + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + /// The text document. + TextDocument: TextDocumentIdentifier + /// The document range for which inlay hints should be computed. + Range: Range + } + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + +/// Inlay hint information. +/// +/// @since 3.17.0 +type InlayHint = + { + /// The position of this hint. + /// + /// If multiple hints have the same position, they will be shown in the order + /// they appear in the response. + Position: Position + /// The label of this hint. A human readable string or an array of + /// InlayHintLabelPart label parts. + /// + /// *Note* that neither the string nor the label part can be empty. + Label: U2 + /// The kind of this hint. Can be omitted in which case the client + /// should fall back to a reasonable default. + Kind: InlayHintKind option + /// Optional text edits that are performed when accepting this inlay hint. + /// + /// *Note* that edits are expected to change the document so that the inlay + /// hint (or its nearest variant) is now part of the document and the inlay + /// hint itself is now obsolete. + TextEdits: TextEdit[] option + /// The tooltip text when you hover over this item. + Tooltip: U2 option + /// Render padding before the hint. + /// + /// Note: Padding should use the editor's background color, not the + /// background color of the hint itself. That means padding can be used + /// to visually align/separate an inlay hint. + PaddingLeft: bool option + /// Render padding after the hint. + /// + /// Note: Padding should use the editor's background color, not the + /// background color of the hint itself. That means padding can be used + /// to visually align/separate an inlay hint. + PaddingRight: bool option + /// A data entry field that is preserved on an inlay hint between + /// a `textDocument/inlayHint` and a `inlayHint/resolve` request. + Data: LSPAny option + } + +/// Inlay hint options used during static or dynamic registration. +/// +/// @since 3.17.0 +type InlayHintRegistrationOptions = + { + WorkDoneProgress: bool option + /// The server provides support to resolve additional + /// information for an inlay hint item. + ResolveProvider: bool option + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + [] + DocumentSelector: DocumentSelector option + /// The id used to register the request. The id can be used to deregister + /// the request again. See also Registration#id. + Id: string option + } + + interface IInlayHintOptions with + /// The server provides support to resolve additional + /// information for an inlay hint item. + member x.ResolveProvider = x.ResolveProvider + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + + interface ITextDocumentRegistrationOptions with + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + member x.DocumentSelector = x.DocumentSelector + +/// Parameters of the document diagnostic request. +/// +/// @since 3.17.0 +type DocumentDiagnosticParams = + { + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + PartialResultToken: ProgressToken option + /// The text document. + TextDocument: TextDocumentIdentifier + /// The additional identifier provided during registration. + Identifier: string option + /// The result id of a previous response if provided. + PreviousResultId: string option + } + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + + interface IPartialResultParams with + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + member x.PartialResultToken = x.PartialResultToken + +/// A partial result for a document diagnostic report. +/// +/// @since 3.17.0 +type DocumentDiagnosticReportPartialResult = + { RelatedDocuments: Map> } + +/// Cancellation data returned from a diagnostic request. +/// +/// @since 3.17.0 +type DiagnosticServerCancellationData = { RetriggerRequest: bool } + +/// Diagnostic registration options. +/// +/// @since 3.17.0 +type DiagnosticRegistrationOptions = + { + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + [] + DocumentSelector: DocumentSelector option + WorkDoneProgress: bool option + /// An optional identifier under which the diagnostics are + /// managed by the client. + Identifier: string option + /// Whether the language has inter file dependencies meaning that + /// editing code in one file can result in a different diagnostic + /// set in another file. Inter file dependencies are common for + /// most programming languages and typically uncommon for linters. + InterFileDependencies: bool + /// The server provides support for workspace diagnostics as well. + WorkspaceDiagnostics: bool + /// The id used to register the request. The id can be used to deregister + /// the request again. See also Registration#id. + Id: string option + } + + interface ITextDocumentRegistrationOptions with + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + member x.DocumentSelector = x.DocumentSelector + + interface IDiagnosticOptions with + /// An optional identifier under which the diagnostics are + /// managed by the client. + member x.Identifier = x.Identifier + /// Whether the language has inter file dependencies meaning that + /// editing code in one file can result in a different diagnostic + /// set in another file. Inter file dependencies are common for + /// most programming languages and typically uncommon for linters. + member x.InterFileDependencies = x.InterFileDependencies + /// The server provides support for workspace diagnostics as well. + member x.WorkspaceDiagnostics = x.WorkspaceDiagnostics + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// Parameters of the workspace diagnostic request. +/// +/// @since 3.17.0 +type WorkspaceDiagnosticParams = + { + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + PartialResultToken: ProgressToken option + /// The additional identifier provided during registration. + Identifier: string option + /// The currently known diagnostic reports with their + /// previous result ids. + PreviousResultIds: PreviousResultId[] + } + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + + interface IPartialResultParams with + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + member x.PartialResultToken = x.PartialResultToken + +/// A workspace diagnostic report. +/// +/// @since 3.17.0 +type WorkspaceDiagnosticReport = + { Items: WorkspaceDocumentDiagnosticReport[] } + +/// A partial result for a workspace diagnostic report. +/// +/// @since 3.17.0 +type WorkspaceDiagnosticReportPartialResult = + { Items: WorkspaceDocumentDiagnosticReport[] } + +/// The params sent in an open notebook document notification. +/// +/// @since 3.17.0 +type DidOpenNotebookDocumentParams = + { + /// The notebook document that got opened. + NotebookDocument: NotebookDocument + /// The text documents that represent the content + /// of a notebook cell. + CellTextDocuments: TextDocumentItem[] + } + +/// The params sent in a change notebook document notification. +/// +/// @since 3.17.0 +type DidChangeNotebookDocumentParams = + { + /// The notebook document that did change. The version number points + /// to the version after all provided changes have been applied. If + /// only the text document content of a cell changes the notebook version + /// doesn't necessarily have to change. + NotebookDocument: VersionedNotebookDocumentIdentifier + /// The actual changes to the notebook document. + /// + /// The changes describe single state changes to the notebook document. + /// So if there are two changes c1 (at array index 0) and c2 (at array + /// index 1) for a notebook in state S then c1 moves the notebook from + /// S to S' and c2 from S' to S''. So c1 is computed on the state S and + /// c2 is computed on the state S'. + /// + /// To mirror the content of a notebook using change events use the following approach: + /// - start with the same initial content + /// - apply the 'notebookDocument/didChange' notifications in the order you receive them. + /// - apply the `NotebookChangeEvent`s in a single notification in the order + /// you receive them. + Change: NotebookDocumentChangeEvent + } + +/// The params sent in a save notebook document notification. +/// +/// @since 3.17.0 +type DidSaveNotebookDocumentParams = + { + /// The notebook document that got saved. + NotebookDocument: NotebookDocumentIdentifier + } + +/// The params sent in a close notebook document notification. +/// +/// @since 3.17.0 +type DidCloseNotebookDocumentParams = + { + /// The notebook document that got closed. + NotebookDocument: NotebookDocumentIdentifier + /// The text documents that represent the content + /// of a notebook cell that got closed. + CellTextDocuments: TextDocumentIdentifier[] + } + +type RegistrationParams = { Registrations: Registration[] } +type UnregistrationParams = { Unregisterations: Unregistration[] } + +type _InitializeParamsClientInfo = + { + /// The name of the client as defined by the client. + Name: string + /// The client's version as defined by the client. + Version: string option + } + +type InitializeParams = + { + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + /// The process Id of the parent process that started + /// the server. + /// + /// Is `null` if the process has not been started by another process. + /// If the parent process is not alive then the server should exit. + [] + ProcessId: int32 option + /// Information about the client + /// + /// @since 3.15.0 + ClientInfo: _InitializeParamsClientInfo option + /// The locale the client is currently showing the user interface + /// in. This must not necessarily be the locale of the operating + /// system. + /// + /// Uses IETF language tags as the value's syntax + /// (See https://en.wikipedia.org/wiki/IETF_language_tag) + /// + /// @since 3.16.0 + Locale: string option + /// The rootPath of the workspace. Is null + /// if no folder is open. + /// + /// @deprecated in favour of rootUri. + RootPath: string option + /// The rootUri of the workspace. Is null if no + /// folder is open. If both `rootPath` and `rootUri` are set + /// `rootUri` wins. + /// + /// @deprecated in favour of workspaceFolders. + [] + RootUri: DocumentUri option + /// The capabilities provided by the client (editor or tool) + Capabilities: ClientCapabilities + /// User provided initialization options. + InitializationOptions: LSPAny option + /// The initial trace setting. If omitted trace is disabled ('off'). + Trace: TraceValues option + /// The workspace folders configured in the client when the server starts. + /// + /// This property is only available if the client supports workspace folders. + /// It can be `null` if the client supports workspace folders but none are + /// configured. + /// + /// @since 3.6.0 + WorkspaceFolders: WorkspaceFolder[] option + } + + interface I_InitializeParams with + /// The process Id of the parent process that started + /// the server. + /// + /// Is `null` if the process has not been started by another process. + /// If the parent process is not alive then the server should exit. + member x.ProcessId = x.ProcessId + /// Information about the client + /// + /// @since 3.15.0 + member x.ClientInfo = x.ClientInfo + /// The locale the client is currently showing the user interface + /// in. This must not necessarily be the locale of the operating + /// system. + /// + /// Uses IETF language tags as the value's syntax + /// (See https://en.wikipedia.org/wiki/IETF_language_tag) + /// + /// @since 3.16.0 + member x.Locale = x.Locale + /// The rootPath of the workspace. Is null + /// if no folder is open. + /// + /// @deprecated in favour of rootUri. + member x.RootPath = x.RootPath + /// The rootUri of the workspace. Is null if no + /// folder is open. If both `rootPath` and `rootUri` are set + /// `rootUri` wins. + /// + /// @deprecated in favour of workspaceFolders. + member x.RootUri = x.RootUri + /// The capabilities provided by the client (editor or tool) + member x.Capabilities = x.Capabilities + /// User provided initialization options. + member x.InitializationOptions = x.InitializationOptions + /// The initial trace setting. If omitted trace is disabled ('off'). + member x.Trace = x.Trace + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + + interface IWorkspaceFoldersInitializeParams with + /// The workspace folders configured in the client when the server starts. + /// + /// This property is only available if the client supports workspace folders. + /// It can be `null` if the client supports workspace folders but none are + /// configured. + /// + /// @since 3.6.0 + member x.WorkspaceFolders = x.WorkspaceFolders + +type InitializeResultServerInfo = + { + /// The name of the server as defined by the server. + Name: string + /// The server's version as defined by the server. + Version: string option + } + +/// The result returned from an initialize request. +type InitializeResult = + { + /// The capabilities the language server provides. + Capabilities: ServerCapabilities + /// Information about the server. + /// + /// @since 3.15.0 + ServerInfo: InitializeResultServerInfo option + } + +/// The data type of the ResponseError if the +/// initialize request fails. +type InitializeError = + { + /// Indicates whether the client execute the following retry logic: + /// (1) show the message provided by the ResponseError to the user + /// (2) user selects retry or cancel + /// (3) if user selected retry the initialize method is sent again. + Retry: bool + } + +/// The parameters of a change configuration notification. +type DidChangeConfigurationParams = + { + /// The actual changed settings + Settings: LSPAny + } + +type DidChangeConfigurationRegistrationOptions = + { Section: U2 option } + +/// The parameters of a notification message. +type ShowMessageParams = + { + /// The message type. See {@link MessageType} + Type: MessageType + /// The actual message. + Message: string + } + +type ShowMessageRequestParams = + { + /// The message type. See {@link MessageType} + Type: MessageType + /// The actual message. + Message: string + /// The message action items to present. + Actions: MessageActionItem[] option + } + +type MessageActionItem = + { + /// A short title like 'Retry', 'Open Log' etc. + Title: string + } + +/// The log message parameters. +type LogMessageParams = + { + /// The message type. See {@link MessageType} + Type: MessageType + /// The actual message. + Message: string + } + +/// The parameters sent in an open text document notification +type DidOpenTextDocumentParams = + { + /// The document that was opened. + TextDocument: TextDocumentItem + } + +/// The change text document notification's parameters. +type DidChangeTextDocumentParams = + { + /// The document that did change. The version number points + /// to the version after all provided content changes have + /// been applied. + TextDocument: VersionedTextDocumentIdentifier + /// The actual content changes. The content changes describe single state changes + /// to the document. So if there are two content changes c1 (at array index 0) and + /// c2 (at array index 1) for a document in state S then c1 moves the document from + /// S to S' and c2 from S' to S''. So c1 is computed on the state S and c2 is computed + /// on the state S'. + /// + /// To mirror the content of a document using change events use the following approach: + /// - start with the same initial content + /// - apply the 'textDocument/didChange' notifications in the order you receive them. + /// - apply the `TextDocumentContentChangeEvent`s in a single notification in the order + /// you receive them. + ContentChanges: TextDocumentContentChangeEvent[] + } + +/// Describe options to be used when registered for text document change events. +type TextDocumentChangeRegistrationOptions = + { + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + [] + DocumentSelector: DocumentSelector option + /// How documents are synced to the server. + SyncKind: TextDocumentSyncKind + } + + interface ITextDocumentRegistrationOptions with + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + member x.DocumentSelector = x.DocumentSelector + +/// The parameters sent in a close text document notification +type DidCloseTextDocumentParams = + { + /// The document that was closed. + TextDocument: TextDocumentIdentifier + } + +/// The parameters sent in a save text document notification +type DidSaveTextDocumentParams = + { + /// The document that was saved. + TextDocument: TextDocumentIdentifier + /// Optional the content when saved. Depends on the includeText value + /// when the save notification was requested. + Text: string option + } + +/// Save registration options. +type TextDocumentSaveRegistrationOptions = + { + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + [] + DocumentSelector: DocumentSelector option + /// The client is supposed to include the content on save. + IncludeText: bool option + } + + interface ITextDocumentRegistrationOptions with + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + member x.DocumentSelector = x.DocumentSelector + + interface ISaveOptions with + /// The client is supposed to include the content on save. + member x.IncludeText = x.IncludeText + +/// The parameters sent in a will save text document notification. +type WillSaveTextDocumentParams = + { + /// The document that will be saved. + TextDocument: TextDocumentIdentifier + /// The 'TextDocumentSaveReason'. + Reason: TextDocumentSaveReason + } + +/// A text edit applicable to a text document. +type TextEdit = + { + /// The range of the text document to be manipulated. To insert + /// text into a document create a range where start === end. + Range: Range + /// The string to be inserted. For delete operations use an + /// empty string. + NewText: string + } + + interface ITextEdit with + /// The range of the text document to be manipulated. To insert + /// text into a document create a range where start === end. + member x.Range = x.Range + /// The string to be inserted. For delete operations use an + /// empty string. + member x.NewText = x.NewText + +/// The watched files change notification's parameters. +type DidChangeWatchedFilesParams = + { + /// The actual file events. + Changes: FileEvent[] + } + +/// Describe options to be used when registered for text document change events. +type DidChangeWatchedFilesRegistrationOptions = + { + /// The watchers to register. + Watchers: FileSystemWatcher[] + } + +/// The publish diagnostic notification's parameters. +type PublishDiagnosticsParams = + { + /// The URI for which diagnostic information is reported. + Uri: DocumentUri + /// Optional the version number of the document the diagnostics are published for. + /// + /// @since 3.15.0 + Version: int32 option + /// An array of diagnostic information items. + Diagnostics: Diagnostic[] + } + +/// Completion parameters +type CompletionParams = + { + /// The text document. + TextDocument: TextDocumentIdentifier + /// The position inside the text document. + Position: Position + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + PartialResultToken: ProgressToken option + /// The completion context. This is only available it the client specifies + /// to send this using the client capability `textDocument.completion.contextSupport === true` + Context: CompletionContext option + } + + interface ITextDocumentPositionParams with + /// The text document. + member x.TextDocument = x.TextDocument + /// The position inside the text document. + member x.Position = x.Position + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + + interface IPartialResultParams with + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + member x.PartialResultToken = x.PartialResultToken + +/// A completion item represents a text snippet that is +/// proposed to complete text that is being typed. +type CompletionItem = + { + /// The label of this completion item. + /// + /// The label property is also by default the text that + /// is inserted when selecting this completion. + /// + /// If label details are provided the label itself should + /// be an unqualified name of the completion item. + Label: string + /// Additional details for the label + /// + /// @since 3.17.0 + LabelDetails: CompletionItemLabelDetails option + /// The kind of this completion item. Based of the kind + /// an icon is chosen by the editor. + Kind: CompletionItemKind option + /// Tags for this completion item. + /// + /// @since 3.15.0 + Tags: CompletionItemTag[] option + /// A human-readable string with additional information + /// about this item, like type or symbol information. + Detail: string option + /// A human-readable string that represents a doc-comment. + Documentation: U2 option + /// Indicates if this item is deprecated. + /// @deprecated Use `tags` instead. + Deprecated: bool option + /// Select this item when showing. + /// + /// *Note* that only one completion item can be selected and that the + /// tool / client decides which item that is. The rule is that the *first* + /// item of those that match best is selected. + Preselect: bool option + /// A string that should be used when comparing this item + /// with other items. When `falsy` the {@link CompletionItem.label label} + /// is used. + SortText: string option + /// A string that should be used when filtering a set of + /// completion items. When `falsy` the {@link CompletionItem.label label} + /// is used. + FilterText: string option + /// A string that should be inserted into a document when selecting + /// this completion. When `falsy` the {@link CompletionItem.label label} + /// is used. + /// + /// The `insertText` is subject to interpretation by the client side. + /// Some tools might not take the string literally. For example + /// VS Code when code complete is requested in this example + /// `con` and a completion item with an `insertText` of + /// `console` is provided it will only insert `sole`. Therefore it is + /// recommended to use `textEdit` instead since it avoids additional client + /// side interpretation. + InsertText: string option + /// The format of the insert text. The format applies to both the + /// `insertText` property and the `newText` property of a provided + /// `textEdit`. If omitted defaults to `InsertTextFormat.PlainText`. + /// + /// Please note that the insertTextFormat doesn't apply to + /// `additionalTextEdits`. + InsertTextFormat: InsertTextFormat option + /// How whitespace and indentation is handled during completion + /// item insertion. If not provided the clients default value depends on + /// the `textDocument.completion.insertTextMode` client capability. + /// + /// @since 3.16.0 + InsertTextMode: InsertTextMode option + /// An {@link TextEdit edit} which is applied to a document when selecting + /// this completion. When an edit is provided the value of + /// {@link CompletionItem.insertText insertText} is ignored. + /// + /// Most editors support two different operations when accepting a completion + /// item. One is to insert a completion text and the other is to replace an + /// existing text with a completion text. Since this can usually not be + /// predetermined by a server it can report both ranges. Clients need to + /// signal support for `InsertReplaceEdits` via the + /// `textDocument.completion.insertReplaceSupport` client capability + /// property. + /// + /// *Note 1:* The text edit's range as well as both ranges from an insert + /// replace edit must be a [single line] and they must contain the position + /// at which completion has been requested. + /// *Note 2:* If an `InsertReplaceEdit` is returned the edit's insert range + /// must be a prefix of the edit's replace range, that means it must be + /// contained and starting at the same position. + /// + /// @since 3.16.0 additional type `InsertReplaceEdit` + TextEdit: U2 option + /// The edit text used if the completion item is part of a CompletionList and + /// CompletionList defines an item default for the text edit range. + /// + /// Clients will only honor this property if they opt into completion list + /// item defaults using the capability `completionList.itemDefaults`. + /// + /// If not provided and a list's default range is provided the label + /// property is used as a text. + /// + /// @since 3.17.0 + TextEditText: string option + /// An optional array of additional {@link TextEdit text edits} that are applied when + /// selecting this completion. Edits must not overlap (including the same insert position) + /// with the main {@link CompletionItem.textEdit edit} nor with themselves. + /// + /// Additional text edits should be used to change text unrelated to the current cursor position + /// (for example adding an import statement at the top of the file if the completion item will + /// insert an unqualified type). + AdditionalTextEdits: TextEdit[] option + /// An optional set of characters that when pressed while this completion is active will accept it first and + /// then type that character. *Note* that all commit characters should have `length=1` and that superfluous + /// characters will be ignored. + CommitCharacters: string[] option + /// An optional {@link Command command} that is executed *after* inserting this completion. *Note* that + /// additional modifications to the current document should be described with the + /// {@link CompletionItem.additionalTextEdits additionalTextEdits}-property. + Command: Command option + /// A data entry field that is preserved on a completion item between a + /// {@link CompletionRequest} and a {@link CompletionResolveRequest}. + Data: LSPAny option + } + +type CompletionListItemDefaults = + { + /// A default commit character set. + /// + /// @since 3.17.0 + CommitCharacters: string[] option + /// A default edit range. + /// + /// @since 3.17.0 + EditRange: U2 option + /// A default insert text format. + /// + /// @since 3.17.0 + InsertTextFormat: InsertTextFormat option + /// A default insert text mode. + /// + /// @since 3.17.0 + InsertTextMode: InsertTextMode option + /// A default data value. + /// + /// @since 3.17.0 + Data: LSPAny option + } + +type CompletionListItemDefaultsEditRangeC2 = { Insert: Range; Replace: Range } + +/// Represents a collection of {@link CompletionItem completion items} to be presented +/// in the editor. +type CompletionList = + { + /// This list it not complete. Further typing results in recomputing this list. + /// + /// Recomputed lists have all their items replaced (not appended) in the + /// incomplete completion sessions. + IsIncomplete: bool + /// In many cases the items of an actual completion result share the same + /// value for properties like `commitCharacters` or the range of a text + /// edit. A completion list can therefore define item defaults which will + /// be used if a completion item itself doesn't specify the value. + /// + /// If a completion list specifies a default value and a completion item + /// also specifies a corresponding value the one from the item is used. + /// + /// Servers are only allowed to return default values if the client + /// signals support for this via the `completionList.itemDefaults` + /// capability. + /// + /// @since 3.17.0 + ItemDefaults: CompletionListItemDefaults option + /// The completion items. + Items: CompletionItem[] + } + +type CompletionOptionsCompletionItem = + { + /// The server has support for completion item label + /// details (see also `CompletionItemLabelDetails`) when + /// receiving a completion item in a resolve call. + /// + /// @since 3.17.0 + LabelDetailsSupport: bool option + } + +/// Registration options for a {@link CompletionRequest}. +type CompletionRegistrationOptions = + { + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + [] + DocumentSelector: DocumentSelector option + WorkDoneProgress: bool option + /// Most tools trigger completion request automatically without explicitly requesting + /// it using a keyboard shortcut (e.g. Ctrl+Space). Typically they do so when the user + /// starts to type an identifier. For example if the user types `c` in a JavaScript file + /// code complete will automatically pop up present `console` besides others as a + /// completion item. Characters that make up identifiers don't need to be listed here. + /// + /// If code complete should automatically be trigger on characters not being valid inside + /// an identifier (for example `.` in JavaScript) list them in `triggerCharacters`. + TriggerCharacters: string[] option + /// The list of all possible characters that commit a completion. This field can be used + /// if clients don't support individual commit characters per completion item. See + /// `ClientCapabilities.textDocument.completion.completionItem.commitCharactersSupport` + /// + /// If a server provides both `allCommitCharacters` and commit characters on an individual + /// completion item the ones on the completion item win. + /// + /// @since 3.2.0 + AllCommitCharacters: string[] option + /// The server provides support to resolve additional + /// information for a completion item. + ResolveProvider: bool option + /// The server supports the following `CompletionItem` specific + /// capabilities. + /// + /// @since 3.17.0 + CompletionItem: CompletionOptionsCompletionItem option + } + + interface ITextDocumentRegistrationOptions with + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + member x.DocumentSelector = x.DocumentSelector + + interface ICompletionOptions with + /// Most tools trigger completion request automatically without explicitly requesting + /// it using a keyboard shortcut (e.g. Ctrl+Space). Typically they do so when the user + /// starts to type an identifier. For example if the user types `c` in a JavaScript file + /// code complete will automatically pop up present `console` besides others as a + /// completion item. Characters that make up identifiers don't need to be listed here. + /// + /// If code complete should automatically be trigger on characters not being valid inside + /// an identifier (for example `.` in JavaScript) list them in `triggerCharacters`. + member x.TriggerCharacters = x.TriggerCharacters + /// The list of all possible characters that commit a completion. This field can be used + /// if clients don't support individual commit characters per completion item. See + /// `ClientCapabilities.textDocument.completion.completionItem.commitCharactersSupport` + /// + /// If a server provides both `allCommitCharacters` and commit characters on an individual + /// completion item the ones on the completion item win. + /// + /// @since 3.2.0 + member x.AllCommitCharacters = x.AllCommitCharacters + /// The server provides support to resolve additional + /// information for a completion item. + member x.ResolveProvider = x.ResolveProvider + /// The server supports the following `CompletionItem` specific + /// capabilities. + /// + /// @since 3.17.0 + member x.CompletionItem = x.CompletionItem + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// Parameters for a {@link HoverRequest}. +type HoverParams = + { + /// The text document. + TextDocument: TextDocumentIdentifier + /// The position inside the text document. + Position: Position + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + } + + interface ITextDocumentPositionParams with + /// The text document. + member x.TextDocument = x.TextDocument + /// The position inside the text document. + member x.Position = x.Position + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + +/// The result of a hover request. +type Hover = + { + /// The hover's content + Contents: U3 + /// An optional range inside the text document that is used to + /// visualize the hover, e.g. by changing the background color. + Range: Range option + } + +/// Registration options for a {@link HoverRequest}. +type HoverRegistrationOptions = + { + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + [] + DocumentSelector: DocumentSelector option + WorkDoneProgress: bool option + } + + interface ITextDocumentRegistrationOptions with + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + member x.DocumentSelector = x.DocumentSelector + + interface IHoverOptions + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// Parameters for a {@link SignatureHelpRequest}. +type SignatureHelpParams = + { + /// The text document. + TextDocument: TextDocumentIdentifier + /// The position inside the text document. + Position: Position + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + /// The signature help context. This is only available if the client specifies + /// to send this using the client capability `textDocument.signatureHelp.contextSupport === true` + /// + /// @since 3.15.0 + Context: SignatureHelpContext option + } + + interface ITextDocumentPositionParams with + /// The text document. + member x.TextDocument = x.TextDocument + /// The position inside the text document. + member x.Position = x.Position + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + +/// Signature help represents the signature of something +/// callable. There can be multiple signature but only one +/// active and only one active parameter. +type SignatureHelp = + { + /// One or more signatures. + Signatures: SignatureInformation[] + /// The active signature. If omitted or the value lies outside the + /// range of `signatures` the value defaults to zero or is ignored if + /// the `SignatureHelp` has no signatures. + /// + /// Whenever possible implementors should make an active decision about + /// the active signature and shouldn't rely on a default value. + /// + /// In future version of the protocol this property might become + /// mandatory to better express this. + ActiveSignature: uint32 option + /// The active parameter of the active signature. If omitted or the value + /// lies outside the range of `signatures[activeSignature].parameters` + /// defaults to 0 if the active signature has parameters. If + /// the active signature has no parameters it is ignored. + /// In future version of the protocol this property might become + /// mandatory to better express the active parameter if the + /// active signature does have any. + ActiveParameter: uint32 option + } + +/// Registration options for a {@link SignatureHelpRequest}. +type SignatureHelpRegistrationOptions = + { + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + [] + DocumentSelector: DocumentSelector option + WorkDoneProgress: bool option + /// List of characters that trigger signature help automatically. + TriggerCharacters: string[] option + /// List of characters that re-trigger signature help. + /// + /// These trigger characters are only active when signature help is already showing. All trigger characters + /// are also counted as re-trigger characters. + /// + /// @since 3.15.0 + RetriggerCharacters: string[] option + } + + interface ITextDocumentRegistrationOptions with + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + member x.DocumentSelector = x.DocumentSelector + + interface ISignatureHelpOptions with + /// List of characters that trigger signature help automatically. + member x.TriggerCharacters = x.TriggerCharacters + /// List of characters that re-trigger signature help. + /// + /// These trigger characters are only active when signature help is already showing. All trigger characters + /// are also counted as re-trigger characters. + /// + /// @since 3.15.0 + member x.RetriggerCharacters = x.RetriggerCharacters + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// Parameters for a {@link DefinitionRequest}. +type DefinitionParams = + { + /// The text document. + TextDocument: TextDocumentIdentifier + /// The position inside the text document. + Position: Position + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + PartialResultToken: ProgressToken option + } + + interface ITextDocumentPositionParams with + /// The text document. + member x.TextDocument = x.TextDocument + /// The position inside the text document. + member x.Position = x.Position + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + + interface IPartialResultParams with + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + member x.PartialResultToken = x.PartialResultToken + +/// Registration options for a {@link DefinitionRequest}. +type DefinitionRegistrationOptions = + { + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + [] + DocumentSelector: DocumentSelector option + WorkDoneProgress: bool option + } + + interface ITextDocumentRegistrationOptions with + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + member x.DocumentSelector = x.DocumentSelector + + interface IDefinitionOptions + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// Parameters for a {@link ReferencesRequest}. +type ReferenceParams = + { + /// The text document. + TextDocument: TextDocumentIdentifier + /// The position inside the text document. + Position: Position + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + PartialResultToken: ProgressToken option + Context: ReferenceContext + } + + interface ITextDocumentPositionParams with + /// The text document. + member x.TextDocument = x.TextDocument + /// The position inside the text document. + member x.Position = x.Position + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + + interface IPartialResultParams with + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + member x.PartialResultToken = x.PartialResultToken + +/// Registration options for a {@link ReferencesRequest}. +type ReferenceRegistrationOptions = + { + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + [] + DocumentSelector: DocumentSelector option + WorkDoneProgress: bool option + } + + interface ITextDocumentRegistrationOptions with + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + member x.DocumentSelector = x.DocumentSelector + + interface IReferenceOptions + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// Parameters for a {@link DocumentHighlightRequest}. +type DocumentHighlightParams = + { + /// The text document. + TextDocument: TextDocumentIdentifier + /// The position inside the text document. + Position: Position + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + PartialResultToken: ProgressToken option + } + + interface ITextDocumentPositionParams with + /// The text document. + member x.TextDocument = x.TextDocument + /// The position inside the text document. + member x.Position = x.Position + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + + interface IPartialResultParams with + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + member x.PartialResultToken = x.PartialResultToken + +/// A document highlight is a range inside a text document which deserves +/// special attention. Usually a document highlight is visualized by changing +/// the background color of its range. +type DocumentHighlight = + { + /// The range this highlight applies to. + Range: Range + /// The highlight kind, default is {@link DocumentHighlightKind.Text text}. + Kind: DocumentHighlightKind option + } + +/// Registration options for a {@link DocumentHighlightRequest}. +type DocumentHighlightRegistrationOptions = + { + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + [] + DocumentSelector: DocumentSelector option + WorkDoneProgress: bool option + } + + interface ITextDocumentRegistrationOptions with + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + member x.DocumentSelector = x.DocumentSelector + + interface IDocumentHighlightOptions + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// Parameters for a {@link DocumentSymbolRequest}. +type DocumentSymbolParams = + { + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + PartialResultToken: ProgressToken option + /// The text document. + TextDocument: TextDocumentIdentifier + } + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + + interface IPartialResultParams with + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + member x.PartialResultToken = x.PartialResultToken + +/// Represents information about programming constructs like variables, classes, +/// interfaces etc. +type SymbolInformation = + { + /// The name of this symbol. + Name: string + /// The kind of this symbol. + Kind: SymbolKind + /// Tags for this symbol. + /// + /// @since 3.16.0 + Tags: SymbolTag[] option + /// The name of the symbol containing this symbol. This information is for + /// user interface purposes (e.g. to render a qualifier in the user interface + /// if necessary). It can't be used to re-infer a hierarchy for the document + /// symbols. + ContainerName: string option + /// Indicates if this symbol is deprecated. + /// + /// @deprecated Use tags instead + Deprecated: bool option + /// The location of this symbol. The location's range is used by a tool + /// to reveal the location in the editor. If the symbol is selected in the + /// tool the range's start information is used to position the cursor. So + /// the range usually spans more than the actual symbol's name and does + /// normally include things like visibility modifiers. + /// + /// The range doesn't have to denote a node range in the sense of an abstract + /// syntax tree. It can therefore not be used to re-construct a hierarchy of + /// the symbols. + Location: Location + } + + interface IBaseSymbolInformation with + /// The name of this symbol. + member x.Name = x.Name + /// The kind of this symbol. + member x.Kind = x.Kind + /// Tags for this symbol. + /// + /// @since 3.16.0 + member x.Tags = x.Tags + /// The name of the symbol containing this symbol. This information is for + /// user interface purposes (e.g. to render a qualifier in the user interface + /// if necessary). It can't be used to re-infer a hierarchy for the document + /// symbols. + member x.ContainerName = x.ContainerName + +/// Represents programming constructs like variables, classes, interfaces etc. +/// that appear in a document. Document symbols can be hierarchical and they +/// have two ranges: one that encloses its definition and one that points to +/// its most interesting range, e.g. the range of an identifier. +type DocumentSymbol = + { + /// The name of this symbol. Will be displayed in the user interface and therefore must not be + /// an empty string or a string only consisting of white spaces. + Name: string + /// More detail for this symbol, e.g the signature of a function. + Detail: string option + /// The kind of this symbol. + Kind: SymbolKind + /// Tags for this document symbol. + /// + /// @since 3.16.0 + Tags: SymbolTag[] option + /// Indicates if this symbol is deprecated. + /// + /// @deprecated Use tags instead + Deprecated: bool option + /// The range enclosing this symbol not including leading/trailing whitespace but everything else + /// like comments. This information is typically used to determine if the clients cursor is + /// inside the symbol to reveal in the symbol in the UI. + Range: Range + /// The range that should be selected and revealed when this symbol is being picked, e.g the name of a function. + /// Must be contained by the `range`. + SelectionRange: Range + /// Children of this symbol, e.g. properties of a class. + Children: DocumentSymbol[] option + } + +/// Registration options for a {@link DocumentSymbolRequest}. +type DocumentSymbolRegistrationOptions = + { + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + [] + DocumentSelector: DocumentSelector option + WorkDoneProgress: bool option + /// A human-readable string that is shown when multiple outlines trees + /// are shown for the same document. + /// + /// @since 3.16.0 + Label: string option + } + + interface ITextDocumentRegistrationOptions with + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + member x.DocumentSelector = x.DocumentSelector + + interface IDocumentSymbolOptions with + /// A human-readable string that is shown when multiple outlines trees + /// are shown for the same document. + /// + /// @since 3.16.0 + member x.Label = x.Label + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// The parameters of a {@link CodeActionRequest}. +type CodeActionParams = + { + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + PartialResultToken: ProgressToken option + /// The document in which the command was invoked. + TextDocument: TextDocumentIdentifier + /// The range for which the command was invoked. + Range: Range + /// Context carrying additional information. + Context: CodeActionContext + } + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + + interface IPartialResultParams with + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + member x.PartialResultToken = x.PartialResultToken + +/// Represents a reference to a command. Provides a title which +/// will be used to represent a command in the UI and, optionally, +/// an array of arguments which will be passed to the command handler +/// function when invoked. +type Command = + { + /// Title of the command, like `save`. + Title: string + /// The identifier of the actual command handler. + Command: string + /// Arguments that the command handler should be + /// invoked with. + Arguments: LSPAny[] option + } + +type CodeActionDisabled = + { + /// Human readable description of why the code action is currently disabled. + /// + /// This is displayed in the code actions UI. + Reason: string + } + +/// A code action represents a change that can be performed in code, e.g. to fix a problem or +/// to refactor code. +/// +/// A CodeAction must set either `edit` and/or a `command`. If both are supplied, the `edit` is applied first, then the `command` is executed. +type CodeAction = + { + /// A short, human-readable, title for this code action. + Title: string + /// The kind of the code action. + /// + /// Used to filter code actions. + Kind: CodeActionKind option + /// The diagnostics that this code action resolves. + Diagnostics: Diagnostic[] option + /// Marks this as a preferred action. Preferred actions are used by the `auto fix` command and can be targeted + /// by keybindings. + /// + /// A quick fix should be marked preferred if it properly addresses the underlying error. + /// A refactoring should be marked preferred if it is the most reasonable choice of actions to take. + /// + /// @since 3.15.0 + IsPreferred: bool option + /// Marks that the code action cannot currently be applied. + /// + /// Clients should follow the following guidelines regarding disabled code actions: + /// + /// - Disabled code actions are not shown in automatic [lightbulbs](https://code.visualstudio.com/docs/editor/editingevolved#_code-action) + /// code action menus. + /// + /// - Disabled actions are shown as faded out in the code action menu when the user requests a more specific type + /// of code action, such as refactorings. + /// + /// - If the user has a [keybinding](https://code.visualstudio.com/docs/editor/refactoring#_keybindings-for-code-actions) + /// that auto applies a code action and only disabled code actions are returned, the client should show the user an + /// error message with `reason` in the editor. + /// + /// @since 3.16.0 + Disabled: CodeActionDisabled option + /// The workspace edit this code action performs. + Edit: WorkspaceEdit option + /// A command this code action executes. If a code action + /// provides an edit and a command, first the edit is + /// executed and then the command. + Command: Command option + /// A data entry field that is preserved on a code action between + /// a `textDocument/codeAction` and a `codeAction/resolve` request. + /// + /// @since 3.16.0 + Data: LSPAny option + } + +/// Registration options for a {@link CodeActionRequest}. +type CodeActionRegistrationOptions = + { + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + [] + DocumentSelector: DocumentSelector option + WorkDoneProgress: bool option + /// CodeActionKinds that this server may return. + /// + /// The list of kinds may be generic, such as `CodeActionKind.Refactor`, or the server + /// may list out every specific kind they provide. + CodeActionKinds: CodeActionKind[] option + /// The server provides support to resolve additional + /// information for a code action. + /// + /// @since 3.16.0 + ResolveProvider: bool option + } + + interface ITextDocumentRegistrationOptions with + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + member x.DocumentSelector = x.DocumentSelector + + interface ICodeActionOptions with + /// CodeActionKinds that this server may return. + /// + /// The list of kinds may be generic, such as `CodeActionKind.Refactor`, or the server + /// may list out every specific kind they provide. + member x.CodeActionKinds = x.CodeActionKinds + /// The server provides support to resolve additional + /// information for a code action. + /// + /// @since 3.16.0 + member x.ResolveProvider = x.ResolveProvider + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// The parameters of a {@link WorkspaceSymbolRequest}. +type WorkspaceSymbolParams = + { + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + PartialResultToken: ProgressToken option + /// A query string to filter symbols by. Clients may send an empty + /// string here to request all symbols. + Query: string + } + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + + interface IPartialResultParams with + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + member x.PartialResultToken = x.PartialResultToken + +type WorkspaceSymbolLocationC2 = { Uri: DocumentUri } + +/// A special workspace symbol that supports locations without a range. +/// +/// See also SymbolInformation. +/// +/// @since 3.17.0 +type WorkspaceSymbol = + { + /// The name of this symbol. + Name: string + /// The kind of this symbol. + Kind: SymbolKind + /// Tags for this symbol. + /// + /// @since 3.16.0 + Tags: SymbolTag[] option + /// The name of the symbol containing this symbol. This information is for + /// user interface purposes (e.g. to render a qualifier in the user interface + /// if necessary). It can't be used to re-infer a hierarchy for the document + /// symbols. + ContainerName: string option + /// The location of the symbol. Whether a server is allowed to + /// return a location without a range depends on the client + /// capability `workspace.symbol.resolveSupport`. + /// + /// See SymbolInformation#location for more details. + Location: U2 + /// A data entry field that is preserved on a workspace symbol between a + /// workspace symbol request and a workspace symbol resolve request. + Data: LSPAny option + } + + interface IBaseSymbolInformation with + /// The name of this symbol. + member x.Name = x.Name + /// The kind of this symbol. + member x.Kind = x.Kind + /// Tags for this symbol. + /// + /// @since 3.16.0 + member x.Tags = x.Tags + /// The name of the symbol containing this symbol. This information is for + /// user interface purposes (e.g. to render a qualifier in the user interface + /// if necessary). It can't be used to re-infer a hierarchy for the document + /// symbols. + member x.ContainerName = x.ContainerName + +/// Registration options for a {@link WorkspaceSymbolRequest}. +type WorkspaceSymbolRegistrationOptions = + { + WorkDoneProgress: bool option + /// The server provides support to resolve additional + /// information for a workspace symbol. + /// + /// @since 3.17.0 + ResolveProvider: bool option + } + + interface IWorkspaceSymbolOptions with + /// The server provides support to resolve additional + /// information for a workspace symbol. + /// + /// @since 3.17.0 + member x.ResolveProvider = x.ResolveProvider + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// The parameters of a {@link CodeLensRequest}. +type CodeLensParams = + { + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + PartialResultToken: ProgressToken option + /// The document to request code lens for. + TextDocument: TextDocumentIdentifier + } + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + + interface IPartialResultParams with + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + member x.PartialResultToken = x.PartialResultToken + +/// A code lens represents a {@link Command command} that should be shown along with +/// source text, like the number of references, a way to run tests, etc. +/// +/// A code lens is _unresolved_ when no command is associated to it. For performance +/// reasons the creation of a code lens and resolving should be done in two stages. +type CodeLens = + { + /// The range in which this code lens is valid. Should only span a single line. + Range: Range + /// The command this code lens represents. + Command: Command option + /// A data entry field that is preserved on a code lens item between + /// a {@link CodeLensRequest} and a {@link CodeLensResolveRequest} + Data: LSPAny option + } + +/// Registration options for a {@link CodeLensRequest}. +type CodeLensRegistrationOptions = + { + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + [] + DocumentSelector: DocumentSelector option + WorkDoneProgress: bool option + /// Code lens has a resolve provider as well. + ResolveProvider: bool option + } + + interface ITextDocumentRegistrationOptions with + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + member x.DocumentSelector = x.DocumentSelector + + interface ICodeLensOptions with + /// Code lens has a resolve provider as well. + member x.ResolveProvider = x.ResolveProvider + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// The parameters of a {@link DocumentLinkRequest}. +type DocumentLinkParams = + { + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + PartialResultToken: ProgressToken option + /// The document to provide document links for. + TextDocument: TextDocumentIdentifier + } + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + + interface IPartialResultParams with + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + member x.PartialResultToken = x.PartialResultToken + +/// A document link is a range in a text document that links to an internal or external resource, like another +/// text document or a web site. +type DocumentLink = + { + /// The range this link applies to. + Range: Range + /// The uri this link points to. If missing a resolve request is sent later. + Target: URI option + /// The tooltip text when you hover over this link. + /// + /// If a tooltip is provided, is will be displayed in a string that includes instructions on how to + /// trigger the link, such as `{0} (ctrl + click)`. The specific instructions vary depending on OS, + /// user settings, and localization. + /// + /// @since 3.15.0 + Tooltip: string option + /// A data entry field that is preserved on a document link between a + /// DocumentLinkRequest and a DocumentLinkResolveRequest. + Data: LSPAny option + } + +/// Registration options for a {@link DocumentLinkRequest}. +type DocumentLinkRegistrationOptions = + { + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + [] + DocumentSelector: DocumentSelector option + WorkDoneProgress: bool option + /// Document links have a resolve provider as well. + ResolveProvider: bool option + } + + interface ITextDocumentRegistrationOptions with + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + member x.DocumentSelector = x.DocumentSelector + + interface IDocumentLinkOptions with + /// Document links have a resolve provider as well. + member x.ResolveProvider = x.ResolveProvider + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// The parameters of a {@link DocumentFormattingRequest}. +type DocumentFormattingParams = + { + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + /// The document to format. + TextDocument: TextDocumentIdentifier + /// The format options. + Options: FormattingOptions + } + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + +/// Registration options for a {@link DocumentFormattingRequest}. +type DocumentFormattingRegistrationOptions = + { + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + [] + DocumentSelector: DocumentSelector option + WorkDoneProgress: bool option + } + + interface ITextDocumentRegistrationOptions with + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + member x.DocumentSelector = x.DocumentSelector + + interface IDocumentFormattingOptions + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// The parameters of a {@link DocumentRangeFormattingRequest}. +type DocumentRangeFormattingParams = + { + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + /// The document to format. + TextDocument: TextDocumentIdentifier + /// The range to format + Range: Range + /// The format options + Options: FormattingOptions + } + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + +/// Registration options for a {@link DocumentRangeFormattingRequest}. +type DocumentRangeFormattingRegistrationOptions = + { + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + [] + DocumentSelector: DocumentSelector option + WorkDoneProgress: bool option + } + + interface ITextDocumentRegistrationOptions with + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + member x.DocumentSelector = x.DocumentSelector + + interface IDocumentRangeFormattingOptions + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// The parameters of a {@link DocumentOnTypeFormattingRequest}. +type DocumentOnTypeFormattingParams = + { + /// The document to format. + TextDocument: TextDocumentIdentifier + /// The position around which the on type formatting should happen. + /// This is not necessarily the exact position where the character denoted + /// by the property `ch` got typed. + Position: Position + /// The character that has been typed that triggered the formatting + /// on type request. That is not necessarily the last character that + /// got inserted into the document since the client could auto insert + /// characters as well (e.g. like automatic brace completion). + Ch: string + /// The formatting options. + Options: FormattingOptions + } + +/// Registration options for a {@link DocumentOnTypeFormattingRequest}. +type DocumentOnTypeFormattingRegistrationOptions = + { + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + [] + DocumentSelector: DocumentSelector option + /// A character on which formatting should be triggered, like `{`. + FirstTriggerCharacter: string + /// More trigger characters. + MoreTriggerCharacter: string[] option + } + + interface ITextDocumentRegistrationOptions with + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + member x.DocumentSelector = x.DocumentSelector + + interface IDocumentOnTypeFormattingOptions with + /// A character on which formatting should be triggered, like `{`. + member x.FirstTriggerCharacter = x.FirstTriggerCharacter + /// More trigger characters. + member x.MoreTriggerCharacter = x.MoreTriggerCharacter + +/// The parameters of a {@link RenameRequest}. +type RenameParams = + { + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + /// The document to rename. + TextDocument: TextDocumentIdentifier + /// The position at which this request was sent. + Position: Position + /// 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. + NewName: string + } + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + +/// Registration options for a {@link RenameRequest}. +type RenameRegistrationOptions = + { + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + [] + DocumentSelector: DocumentSelector option + WorkDoneProgress: bool option + /// Renames should be checked and tested before being executed. + /// + /// @since version 3.12.0 + PrepareProvider: bool option + } + + interface ITextDocumentRegistrationOptions with + /// A document selector to identify the scope of the registration. If set to null + /// the document selector provided on the client side will be used. + member x.DocumentSelector = x.DocumentSelector + + interface IRenameOptions with + /// Renames should be checked and tested before being executed. + /// + /// @since version 3.12.0 + member x.PrepareProvider = x.PrepareProvider + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +type PrepareRenameParams = + { + /// The text document. + TextDocument: TextDocumentIdentifier + /// The position inside the text document. + Position: Position + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + } + + interface ITextDocumentPositionParams with + /// The text document. + member x.TextDocument = x.TextDocument + /// The position inside the text document. + member x.Position = x.Position + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + +/// The parameters of a {@link ExecuteCommandRequest}. +type ExecuteCommandParams = + { + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + /// The identifier of the actual command handler. + Command: string + /// Arguments that the command should be invoked with. + Arguments: LSPAny[] option + } + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + +/// Registration options for a {@link ExecuteCommandRequest}. +type ExecuteCommandRegistrationOptions = + { + WorkDoneProgress: bool option + /// The commands to be executed on the server + Commands: string[] + } + + interface IExecuteCommandOptions with + /// The commands to be executed on the server + member x.Commands = x.Commands + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// The parameters passed via an apply workspace edit request. +type ApplyWorkspaceEditParams = + { + /// An optional label of the workspace edit. This label is + /// presented in the user interface for example on an undo + /// stack to undo the workspace edit. + Label: string option + /// The edits to apply. + Edit: WorkspaceEdit + } + +/// The result returned from the apply workspace edit request. +/// +/// @since 3.17 renamed from ApplyWorkspaceEditResponse +type ApplyWorkspaceEditResult = + { + /// Indicates whether the edit was applied or not. + Applied: bool + /// An optional textual description for why the edit was not applied. + /// This may be used by the server for diagnostic logging or to provide + /// a suitable error for a request that triggered the edit. + FailureReason: string option + /// Depending on the client's failure handling strategy `failedChange` might + /// contain the index of the change that failed. This property is only available + /// if the client signals a `failureHandlingStrategy` in its client capabilities. + FailedChange: uint32 option + } + +type WorkDoneProgressBegin = + { + [] + Kind: string + /// Mandatory title of the progress operation. Used to briefly inform about + /// the kind of operation being performed. + /// + /// Examples: "Indexing" or "Linking dependencies". + Title: string + /// Controls if a cancel button should show to allow the user to cancel the + /// long running operation. Clients that don't support cancellation are allowed + /// to ignore the setting. + Cancellable: bool option + /// Optional, more detailed associated progress message. Contains + /// complementary information to the `title`. + /// + /// Examples: "3/25 files", "project/src/module2", "node_modules/some_dep". + /// If unset, the previous progress message (if any) is still valid. + Message: string option + /// Optional progress percentage to display (value 100 is considered 100%). + /// If not provided infinite progress is assumed and clients are allowed + /// to ignore the `percentage` value in subsequent in report notifications. + /// + /// The value should be steadily rising. Clients are free to ignore values + /// that are not following this rule. The value range is [0, 100]. + Percentage: uint32 option + } + +type WorkDoneProgressReport = + { + [] + Kind: string + /// Controls enablement state of a cancel button. + /// + /// Clients that don't support cancellation or don't support controlling the button's + /// enablement state are allowed to ignore the property. + Cancellable: bool option + /// Optional, more detailed associated progress message. Contains + /// complementary information to the `title`. + /// + /// Examples: "3/25 files", "project/src/module2", "node_modules/some_dep". + /// If unset, the previous progress message (if any) is still valid. + Message: string option + /// Optional progress percentage to display (value 100 is considered 100%). + /// If not provided infinite progress is assumed and clients are allowed + /// to ignore the `percentage` value in subsequent in report notifications. + /// + /// The value should be steadily rising. Clients are free to ignore values + /// that are not following this rule. The value range is [0, 100] + Percentage: uint32 option + } + +type WorkDoneProgressEnd = + { + [] + Kind: string + /// Optional, a final message indicating to for example indicate the outcome + /// of the operation. + Message: string option + } + +type SetTraceParams = { Value: TraceValues } + +type LogTraceParams = + { Message: string + Verbose: string option } + +type CancelParams = + { + /// The request id to cancel. + Id: U2 + } + +type ProgressParams = + { + /// The progress token provided by the client or server. + Token: ProgressToken + /// The progress data. + Value: LSPAny + } + +/// A parameter literal used in requests to pass a text document and a position inside that +/// document. +type TextDocumentPositionParams = + { + /// The text document. + TextDocument: TextDocumentIdentifier + /// The position inside the text document. + Position: Position + } + + interface ITextDocumentPositionParams with + /// The text document. + member x.TextDocument = x.TextDocument + /// The position inside the text document. + member x.Position = x.Position + +type WorkDoneProgressParams = + { + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + } + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + +type PartialResultParams = + { + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + PartialResultToken: ProgressToken option + } + + interface IPartialResultParams with + /// An optional token that a server can use to report partial results (e.g. streaming) to + /// the client. + member x.PartialResultToken = x.PartialResultToken + +/// Represents the connection of two locations. Provides additional metadata over normal {@link Location locations}, +/// including an origin range. +type LocationLink = + { + /// Span of the origin of this link. + /// + /// Used as the underlined span for mouse interaction. Defaults to the word range at + /// the definition position. + OriginSelectionRange: Range option + /// The target resource identifier of this link. + TargetUri: DocumentUri + /// The full target range of this link. If the target for example is a symbol then target range is the + /// range enclosing this symbol not including leading/trailing whitespace but everything else + /// like comments. This information is typically used to highlight the range in the editor. + TargetRange: Range + /// The range that should be selected and revealed when this link is being followed, e.g the name of a function. + /// Must be contained by the `targetRange`. See also `DocumentSymbol#range` + TargetSelectionRange: Range + } + +/// A range in a text document expressed as (zero-based) start and end positions. +/// +/// If you want to specify a range that contains a line including the line ending +/// character(s) then use an end position denoting the start of the next line. +/// For example: +/// ```ts +/// { +/// start: { line: 5, character: 23 } +/// end : { line 6, character : 0 } +/// } +/// ``` +[] +type Range = + { + /// The range's start position. + Start: Position + /// The range's end position. + End: Position + } + + [] + member x.DebuggerDisplay = $"{x.Start.DebuggerDisplay}-{x.End.DebuggerDisplay}" + +type ImplementationOptions = + { WorkDoneProgress: bool option } + + interface IImplementationOptions + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// Static registration options to be returned in the initialize +/// request. +type StaticRegistrationOptions = + { + /// The id used to register the request. The id can be used to deregister + /// the request again. See also Registration#id. + Id: string option + } + +type TypeDefinitionOptions = + { WorkDoneProgress: bool option } + + interface ITypeDefinitionOptions + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// The workspace folder change event. +type WorkspaceFoldersChangeEvent = + { + /// The array of added workspace folders + Added: WorkspaceFolder[] + /// The array of the removed workspace folders + Removed: WorkspaceFolder[] + } + +type ConfigurationItem = + { + /// The scope to get the configuration section for. + ScopeUri: URI option + /// The configuration section asked for. + Section: string option + } + +/// A literal to identify a text document in the client. +type TextDocumentIdentifier = + { + /// The text document's uri. + Uri: DocumentUri + } + + interface ITextDocumentIdentifier with + /// The text document's uri. + member x.Uri = x.Uri + +/// Represents a color in RGBA space. +type Color = + { + /// The red component of this color in the range [0-1]. + Red: decimal + /// The green component of this color in the range [0-1]. + Green: decimal + /// The blue component of this color in the range [0-1]. + Blue: decimal + /// The alpha component of this color in the range [0-1]. + Alpha: decimal + } + +type DocumentColorOptions = + { WorkDoneProgress: bool option } + + interface IDocumentColorOptions + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +type FoldingRangeOptions = + { WorkDoneProgress: bool option } + + interface IFoldingRangeOptions + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +type DeclarationOptions = + { WorkDoneProgress: bool option } + + interface IDeclarationOptions + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// Position in a text document expressed as zero-based line and character +/// offset. Prior to 3.17 the offsets were always based on a UTF-16 string +/// representation. So a string of the form `a𐐀b` the character offset of the +/// character `a` is 0, the character offset of `𐐀` is 1 and the character +/// offset of b is 3 since `𐐀` is represented using two code units in UTF-16. +/// Since 3.17 clients and servers can agree on a different string encoding +/// representation (e.g. UTF-8). The client announces it's supported encoding +/// via the client capability [`general.positionEncodings`](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#clientCapabilities). +/// The value is an array of position encodings the client supports, with +/// decreasing preference (e.g. the encoding at index `0` is the most preferred +/// one). To stay backwards compatible the only mandatory encoding is UTF-16 +/// represented via the string `utf-16`. The server can pick one of the +/// encodings offered by the client and signals that encoding back to the +/// client via the initialize result's property +/// [`capabilities.positionEncoding`](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#serverCapabilities). If the string value +/// `utf-16` is missing from the client's capability `general.positionEncodings` +/// servers can safely assume that the client supports UTF-16. If the server +/// omits the position encoding in its initialize result the encoding defaults +/// to the string value `utf-16`. Implementation considerations: since the +/// conversion from one encoding into another requires the content of the +/// file / line the conversion is best done where the file is read which is +/// usually on the server side. +/// +/// Positions are line end character agnostic. So you can not specify a position +/// that denotes `\r|\n` or `\n|` where `|` represents the character offset. +/// +/// @since 3.17.0 - support for negotiated position encoding. +[] +type Position = + { + /// Line position in a document (zero-based). + /// + /// If a line number is greater than the number of lines in a document, it defaults back to the number of lines in the document. + /// If a line number is negative, it defaults to 0. + Line: uint32 + /// Character offset on a line in a document (zero-based). + /// + /// The meaning of this offset is determined by the negotiated + /// `PositionEncodingKind`. + /// + /// If the character value is greater than the line length it defaults back to the + /// line length. + Character: uint32 + } + + [] + member x.DebuggerDisplay = $"({x.Line},{x.Character})" + +type SelectionRangeOptions = + { WorkDoneProgress: bool option } + + interface ISelectionRangeOptions + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// Call hierarchy options used during static registration. +/// +/// @since 3.16.0 +type CallHierarchyOptions = + { WorkDoneProgress: bool option } + + interface ICallHierarchyOptions + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// @since 3.16.0 +type SemanticTokensOptions = + { + WorkDoneProgress: bool option + /// The legend used by the server + Legend: SemanticTokensLegend + /// Server supports providing semantic tokens for a specific range + /// of a document. + Range: U2 option + /// Server supports providing semantic tokens for a full document. + Full: U2 option + } + + interface ISemanticTokensOptions with + /// The legend used by the server + member x.Legend = x.Legend + /// Server supports providing semantic tokens for a specific range + /// of a document. + member x.Range = x.Range + /// Server supports providing semantic tokens for a full document. + member x.Full = x.Full + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// @since 3.16.0 +type SemanticTokensEdit = + { + /// The start offset of the edit. + Start: uint32 + /// The count of elements to remove. + DeleteCount: uint32 + /// The elements to insert. + Data: uint32[] option + } + +type LinkedEditingRangeOptions = + { WorkDoneProgress: bool option } + + interface ILinkedEditingRangeOptions + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// Represents information on a file/folder create. +/// +/// @since 3.16.0 +type FileCreate = + { + /// A file:// URI for the location of the file/folder being created. + Uri: string + } + +/// Describes textual changes on a text document. A TextDocumentEdit describes all changes +/// on a document version Si and after they are applied move the document to version Si+1. +/// So the creator of a TextDocumentEdit doesn't need to sort the array of edits or do any +/// kind of ordering. However the edits must be non overlapping. +type TextDocumentEdit = + { + /// The text document to change. + TextDocument: OptionalVersionedTextDocumentIdentifier + /// The edits to be applied. + /// + /// @since 3.16.0 - support for AnnotatedTextEdit. This is guarded using a + /// client capability. + Edits: U2[] + } + +/// Create file operation. +type CreateFile = + { + /// A create + [] + Kind: string + /// An optional annotation identifier describing the operation. + /// + /// @since 3.16.0 + AnnotationId: ChangeAnnotationIdentifier option + /// The resource to create. + Uri: DocumentUri + /// Additional options + Options: CreateFileOptions option + } + + interface IResourceOperation with + /// The resource operation kind. + member x.Kind = x.Kind + /// An optional annotation identifier describing the operation. + /// + /// @since 3.16.0 + member x.AnnotationId = x.AnnotationId + +/// Rename file operation +type RenameFile = + { + /// A rename + [] + Kind: string + /// An optional annotation identifier describing the operation. + /// + /// @since 3.16.0 + AnnotationId: ChangeAnnotationIdentifier option + /// The old (existing) location. + OldUri: DocumentUri + /// The new location. + NewUri: DocumentUri + /// Rename options. + Options: RenameFileOptions option + } + + interface IResourceOperation with + /// The resource operation kind. + member x.Kind = x.Kind + /// An optional annotation identifier describing the operation. + /// + /// @since 3.16.0 + member x.AnnotationId = x.AnnotationId + +/// Delete file operation +type DeleteFile = + { + /// A delete + [] + Kind: string + /// An optional annotation identifier describing the operation. + /// + /// @since 3.16.0 + AnnotationId: ChangeAnnotationIdentifier option + /// The file to delete. + Uri: DocumentUri + /// Delete options. + Options: DeleteFileOptions option + } + + interface IResourceOperation with + /// The resource operation kind. + member x.Kind = x.Kind + /// An optional annotation identifier describing the operation. + /// + /// @since 3.16.0 + member x.AnnotationId = x.AnnotationId + +/// Additional information that describes document changes. +/// +/// @since 3.16.0 +type ChangeAnnotation = + { + /// A human-readable string describing the actual change. The string + /// is rendered prominent in the user interface. + Label: string + /// A flag which indicates that user confirmation is needed + /// before applying the change. + NeedsConfirmation: bool option + /// A human-readable string which is rendered less prominent in + /// the user interface. + Description: string option + } + +/// A filter to describe in which file operation requests or notifications +/// the server is interested in receiving. +/// +/// @since 3.16.0 +type FileOperationFilter = + { + /// A Uri scheme like `file` or `untitled`. + Scheme: string option + /// The actual file operation pattern. + Pattern: FileOperationPattern + } + +/// Represents information on a file/folder rename. +/// +/// @since 3.16.0 +type FileRename = + { + /// A file:// URI for the original location of the file/folder being renamed. + OldUri: string + /// A file:// URI for the new location of the file/folder being renamed. + NewUri: string + } + +/// Represents information on a file/folder delete. +/// +/// @since 3.16.0 +type FileDelete = + { + /// A file:// URI for the location of the file/folder being deleted. + Uri: string + } + +type MonikerOptions = + { WorkDoneProgress: bool option } + + interface IMonikerOptions + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// Type hierarchy options used during static registration. +/// +/// @since 3.17.0 +type TypeHierarchyOptions = + { WorkDoneProgress: bool option } + + interface ITypeHierarchyOptions + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// @since 3.17.0 +type InlineValueContext = + { + /// The stack frame (as a DAP Id) where the execution has stopped. + FrameId: int32 + /// The document range where execution has stopped. + /// Typically the end position of the range denotes the line where the inline values are shown. + StoppedLocation: Range + } + +/// Provide inline value as text. +/// +/// @since 3.17.0 +type InlineValueText = + { + /// The document range for which the inline value applies. + Range: Range + /// The text of the inline value. + Text: string + } + +/// Provide inline value through a variable lookup. +/// If only a range is specified, the variable name will be extracted from the underlying document. +/// An optional variable name can be used to override the extracted name. +/// +/// @since 3.17.0 +type InlineValueVariableLookup = + { + /// The document range for which the inline value applies. + /// The range is used to extract the variable name from the underlying document. + Range: Range + /// If specified the name of the variable to look up. + VariableName: string option + /// How to perform the lookup. + CaseSensitiveLookup: bool + } + +/// Provide an inline value through an expression evaluation. +/// If only a range is specified, the expression will be extracted from the underlying document. +/// An optional expression can be used to override the extracted expression. +/// +/// @since 3.17.0 +type InlineValueEvaluatableExpression = + { + /// The document range for which the inline value applies. + /// The range is used to extract the evaluatable expression from the underlying document. + Range: Range + /// If specified the expression overrides the extracted expression. + Expression: string option + } + +/// Inline value options used during static registration. +/// +/// @since 3.17.0 +type InlineValueOptions = + { WorkDoneProgress: bool option } + + interface IInlineValueOptions + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// An inlay hint label part allows for interactive and composite labels +/// of inlay hints. +/// +/// @since 3.17.0 +type InlayHintLabelPart = + { + /// The value of this label part. + Value: string + /// The tooltip text when you hover over this label part. Depending on + /// the client capability `inlayHint.resolveSupport` clients might resolve + /// this property late using the resolve request. + Tooltip: U2 option + /// An optional source code location that represents this + /// label part. + /// + /// The editor will use this location for the hover and for code navigation + /// features: This part will become a clickable link that resolves to the + /// definition of the symbol at the given location (not necessarily the + /// location itself), it shows the hover that shows at the given location, + /// and it shows a context menu with further code navigation commands. + /// + /// Depending on the client capability `inlayHint.resolveSupport` clients + /// might resolve this property late using the resolve request. + Location: Location option + /// An optional command for this label part. + /// + /// Depending on the client capability `inlayHint.resolveSupport` clients + /// might resolve this property late using the resolve request. + Command: Command option + } + +/// A `MarkupContent` literal represents a string value which content is interpreted base on its +/// kind flag. Currently the protocol supports `plaintext` and `markdown` as markup kinds. +/// +/// If the kind is `markdown` then the value can contain fenced code blocks like in GitHub issues. +/// See https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting +/// +/// Here is an example how such a string can be constructed using JavaScript / TypeScript: +/// ```ts +/// let markdown: MarkdownContent = { +/// kind: MarkupKind.Markdown, +/// value: [ +/// '# Header', +/// 'Some text', +/// '```typescript', +/// 'someCode();', +/// '```' +/// ].join('\n') +/// }; +/// ``` +/// +/// *Please Note* that clients might sanitize the return markdown. A client could decide to +/// remove HTML from the markdown to avoid script execution. +type MarkupContent = + { + /// The type of the Markup + Kind: MarkupKind + /// The content itself + Value: string + } + +/// Inlay hint options used during static registration. +/// +/// @since 3.17.0 +type InlayHintOptions = + { + WorkDoneProgress: bool option + /// The server provides support to resolve additional + /// information for an inlay hint item. + ResolveProvider: bool option + } + + interface IInlayHintOptions with + /// The server provides support to resolve additional + /// information for an inlay hint item. + member x.ResolveProvider = x.ResolveProvider + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// A full diagnostic report with a set of related documents. +/// +/// @since 3.17.0 +type RelatedFullDocumentDiagnosticReport = + { + /// A full document diagnostic report. + [] + Kind: string + /// An optional result id. If provided it will + /// be sent on the next diagnostic request for the + /// same document. + ResultId: string option + /// The actual items. + Items: Diagnostic[] + /// Diagnostics of related documents. This information is useful + /// in programming languages where code in a file A can generate + /// diagnostics in a file B which A depends on. An example of + /// such a language is C/C++ where marco definitions in a file + /// a.cpp and result in errors in a header file b.hpp. + /// + /// @since 3.17.0 + RelatedDocuments: Map> option + } + + interface IFullDocumentDiagnosticReport with + /// A full document diagnostic report. + member x.Kind = x.Kind + /// An optional result id. If provided it will + /// be sent on the next diagnostic request for the + /// same document. + member x.ResultId = x.ResultId + /// The actual items. + member x.Items = x.Items + +/// An unchanged diagnostic report with a set of related documents. +/// +/// @since 3.17.0 +type RelatedUnchangedDocumentDiagnosticReport = + { + /// A document diagnostic report indicating + /// no changes to the last result. A server can + /// only return `unchanged` if result ids are + /// provided. + [] + Kind: string + /// A result id which will be sent on the next + /// diagnostic request for the same document. + ResultId: string + /// Diagnostics of related documents. This information is useful + /// in programming languages where code in a file A can generate + /// diagnostics in a file B which A depends on. An example of + /// such a language is C/C++ where marco definitions in a file + /// a.cpp and result in errors in a header file b.hpp. + /// + /// @since 3.17.0 + RelatedDocuments: Map> option + } + + interface IUnchangedDocumentDiagnosticReport with + /// A document diagnostic report indicating + /// no changes to the last result. A server can + /// only return `unchanged` if result ids are + /// provided. + member x.Kind = x.Kind + /// A result id which will be sent on the next + /// diagnostic request for the same document. + member x.ResultId = x.ResultId + +/// A diagnostic report with a full set of problems. +/// +/// @since 3.17.0 +type FullDocumentDiagnosticReport = + { + /// A full document diagnostic report. + [] + Kind: string + /// An optional result id. If provided it will + /// be sent on the next diagnostic request for the + /// same document. + ResultId: string option + /// The actual items. + Items: Diagnostic[] + } + + interface IFullDocumentDiagnosticReport with + /// A full document diagnostic report. + member x.Kind = x.Kind + /// An optional result id. If provided it will + /// be sent on the next diagnostic request for the + /// same document. + member x.ResultId = x.ResultId + /// The actual items. + member x.Items = x.Items + +/// A diagnostic report indicating that the last returned +/// report is still accurate. +/// +/// @since 3.17.0 +type UnchangedDocumentDiagnosticReport = + { + /// A document diagnostic report indicating + /// no changes to the last result. A server can + /// only return `unchanged` if result ids are + /// provided. + [] + Kind: string + /// A result id which will be sent on the next + /// diagnostic request for the same document. + ResultId: string + } + + interface IUnchangedDocumentDiagnosticReport with + /// A document diagnostic report indicating + /// no changes to the last result. A server can + /// only return `unchanged` if result ids are + /// provided. + member x.Kind = x.Kind + /// A result id which will be sent on the next + /// diagnostic request for the same document. + member x.ResultId = x.ResultId + +/// Diagnostic options. +/// +/// @since 3.17.0 +type DiagnosticOptions = + { + WorkDoneProgress: bool option + /// An optional identifier under which the diagnostics are + /// managed by the client. + Identifier: string option + /// Whether the language has inter file dependencies meaning that + /// editing code in one file can result in a different diagnostic + /// set in another file. Inter file dependencies are common for + /// most programming languages and typically uncommon for linters. + InterFileDependencies: bool + /// The server provides support for workspace diagnostics as well. + WorkspaceDiagnostics: bool + } + + interface IDiagnosticOptions with + /// An optional identifier under which the diagnostics are + /// managed by the client. + member x.Identifier = x.Identifier + /// Whether the language has inter file dependencies meaning that + /// editing code in one file can result in a different diagnostic + /// set in another file. Inter file dependencies are common for + /// most programming languages and typically uncommon for linters. + member x.InterFileDependencies = x.InterFileDependencies + /// The server provides support for workspace diagnostics as well. + member x.WorkspaceDiagnostics = x.WorkspaceDiagnostics + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// A previous result id in a workspace pull request. +/// +/// @since 3.17.0 +type PreviousResultId = + { + /// The URI for which the client knowns a + /// result id. + Uri: DocumentUri + /// The value of the previous result id. + Value: string + } + +/// A notebook document. +/// +/// @since 3.17.0 +type NotebookDocument = + { + /// The notebook document's uri. + Uri: URI + /// The type of the notebook. + NotebookType: string + /// The version number of this document (it will increase after each + /// change, including undo/redo). + Version: int32 + /// Additional metadata stored with the notebook + /// document. + /// + /// Note: should always be an object literal (e.g. LSPObject) + Metadata: LSPObject option + /// The cells of a notebook. + Cells: NotebookCell[] + } + +/// An item to transfer a text document from the client to the +/// server. +type TextDocumentItem = + { + /// The text document's uri. + Uri: DocumentUri + /// The text document's language identifier. + LanguageId: string + /// The version number of this document (it will increase after each + /// change, including undo/redo). + Version: int32 + /// The content of the opened text document. + Text: string + } + +/// A versioned notebook document identifier. +/// +/// @since 3.17.0 +type VersionedNotebookDocumentIdentifier = + { + /// The version number of this notebook document. + Version: int32 + /// The notebook document's uri. + Uri: URI + } + +type NotebookDocumentChangeEventCells = + { + /// Changes to the cell structure to add or + /// remove cells. + Structure: NotebookDocumentChangeEventCellsStructure option + /// Changes to notebook cells properties like its + /// kind, execution summary or metadata. + Data: NotebookCell[] option + /// Changes to the text content of notebook cells. + TextContent: NotebookDocumentChangeEventCellsTextContent[] option + } + +type NotebookDocumentChangeEventCellsStructure = + { + /// The change to the cell array. + Array: NotebookCellArrayChange + /// Additional opened cell text documents. + DidOpen: TextDocumentItem[] option + /// Additional closed cell text documents. + DidClose: TextDocumentIdentifier[] option + } + +type NotebookDocumentChangeEventCellsTextContent = + { Document: VersionedTextDocumentIdentifier + Changes: TextDocumentContentChangeEvent[] } + +/// A change event for a notebook document. +/// +/// @since 3.17.0 +type NotebookDocumentChangeEvent = + { + /// The changed meta data if any. + /// + /// Note: should always be an object literal (e.g. LSPObject) + Metadata: LSPObject option + /// Changes to cells + Cells: NotebookDocumentChangeEventCells option + } + +/// A literal to identify a notebook document in the client. +/// +/// @since 3.17.0 +type NotebookDocumentIdentifier = + { + /// The notebook document's uri. + Uri: URI + } + +/// General parameters to register for a notification or to register a provider. +type Registration = + { + /// The id used to register the request. The id can be used to deregister + /// the request again. + Id: string + /// The method / capability to register for. + Method: string + /// Options necessary for the registration. + RegisterOptions: LSPAny option + } + +/// General parameters to unregister a request or notification. +type Unregistration = + { + /// The id used to unregister the request or notification. Usually an id + /// provided during the register request. + Id: string + /// The method to unregister for. + Method: string + } + +/// The initialize parameters +type _InitializeParams = + { + /// An optional token that a server can use to report work done progress. + WorkDoneToken: ProgressToken option + /// The process Id of the parent process that started + /// the server. + /// + /// Is `null` if the process has not been started by another process. + /// If the parent process is not alive then the server should exit. + [] + ProcessId: int32 option + /// Information about the client + /// + /// @since 3.15.0 + ClientInfo: _InitializeParamsClientInfo option + /// The locale the client is currently showing the user interface + /// in. This must not necessarily be the locale of the operating + /// system. + /// + /// Uses IETF language tags as the value's syntax + /// (See https://en.wikipedia.org/wiki/IETF_language_tag) + /// + /// @since 3.16.0 + Locale: string option + /// The rootPath of the workspace. Is null + /// if no folder is open. + /// + /// @deprecated in favour of rootUri. + RootPath: string option + /// The rootUri of the workspace. Is null if no + /// folder is open. If both `rootPath` and `rootUri` are set + /// `rootUri` wins. + /// + /// @deprecated in favour of workspaceFolders. + [] + RootUri: DocumentUri option + /// The capabilities provided by the client (editor or tool) + Capabilities: ClientCapabilities + /// User provided initialization options. + InitializationOptions: LSPAny option + /// The initial trace setting. If omitted trace is disabled ('off'). + Trace: TraceValues option + } + + interface I_InitializeParams with + /// The process Id of the parent process that started + /// the server. + /// + /// Is `null` if the process has not been started by another process. + /// If the parent process is not alive then the server should exit. + member x.ProcessId = x.ProcessId + /// Information about the client + /// + /// @since 3.15.0 + member x.ClientInfo = x.ClientInfo + /// The locale the client is currently showing the user interface + /// in. This must not necessarily be the locale of the operating + /// system. + /// + /// Uses IETF language tags as the value's syntax + /// (See https://en.wikipedia.org/wiki/IETF_language_tag) + /// + /// @since 3.16.0 + member x.Locale = x.Locale + /// The rootPath of the workspace. Is null + /// if no folder is open. + /// + /// @deprecated in favour of rootUri. + member x.RootPath = x.RootPath + /// The rootUri of the workspace. Is null if no + /// folder is open. If both `rootPath` and `rootUri` are set + /// `rootUri` wins. + /// + /// @deprecated in favour of workspaceFolders. + member x.RootUri = x.RootUri + /// The capabilities provided by the client (editor or tool) + member x.Capabilities = x.Capabilities + /// User provided initialization options. + member x.InitializationOptions = x.InitializationOptions + /// The initial trace setting. If omitted trace is disabled ('off'). + member x.Trace = x.Trace + + interface IWorkDoneProgressParams with + /// An optional token that a server can use to report work done progress. + member x.WorkDoneToken = x.WorkDoneToken + +type WorkspaceFoldersInitializeParams = + { + /// The workspace folders configured in the client when the server starts. + /// + /// This property is only available if the client supports workspace folders. + /// It can be `null` if the client supports workspace folders but none are + /// configured. + /// + /// @since 3.6.0 + WorkspaceFolders: WorkspaceFolder[] option + } + + interface IWorkspaceFoldersInitializeParams with + /// The workspace folders configured in the client when the server starts. + /// + /// This property is only available if the client supports workspace folders. + /// It can be `null` if the client supports workspace folders but none are + /// configured. + /// + /// @since 3.6.0 + member x.WorkspaceFolders = x.WorkspaceFolders + +type ServerCapabilitiesWorkspace = + { + /// The server supports workspace folder. + /// + /// @since 3.6.0 + WorkspaceFolders: WorkspaceFoldersServerCapabilities option + /// The server is interested in notifications/requests for operations on files. + /// + /// @since 3.16.0 + FileOperations: FileOperationOptions option + } + +/// Defines the capabilities provided by a language +/// server. +type ServerCapabilities = + { + /// The position encoding the server picked from the encodings offered + /// by the client via the client capability `general.positionEncodings`. + /// + /// If the client didn't provide any position encodings the only valid + /// value that a server can return is 'utf-16'. + /// + /// If omitted it defaults to 'utf-16'. + /// + /// @since 3.17.0 + PositionEncoding: PositionEncodingKind option + /// Defines how text documents are synced. Is either a detailed structure + /// defining each notification or for backwards compatibility the + /// TextDocumentSyncKind number. + TextDocumentSync: U2 option + /// Defines how notebook documents are synced. + /// + /// @since 3.17.0 + NotebookDocumentSync: U2 option + /// The server provides completion support. + CompletionProvider: CompletionOptions option + /// The server provides hover support. + HoverProvider: U2 option + /// The server provides signature help support. + SignatureHelpProvider: SignatureHelpOptions option + /// The server provides Goto Declaration support. + DeclarationProvider: U3 option + /// The server provides goto definition support. + DefinitionProvider: U2 option + /// The server provides Goto Type Definition support. + TypeDefinitionProvider: U3 option + /// The server provides Goto Implementation support. + ImplementationProvider: U3 option + /// The server provides find references support. + ReferencesProvider: U2 option + /// The server provides document highlight support. + DocumentHighlightProvider: U2 option + /// The server provides document symbol support. + DocumentSymbolProvider: U2 option + /// The server provides code actions. CodeActionOptions may only be + /// specified if the client states that it supports + /// `codeActionLiteralSupport` in its initial `initialize` request. + CodeActionProvider: U2 option + /// The server provides code lens. + CodeLensProvider: CodeLensOptions option + /// The server provides document link support. + DocumentLinkProvider: DocumentLinkOptions option + /// The server provides color provider support. + ColorProvider: U3 option + /// The server provides workspace symbol support. + WorkspaceSymbolProvider: U2 option + /// The server provides document formatting. + DocumentFormattingProvider: U2 option + /// The server provides document range formatting. + DocumentRangeFormattingProvider: U2 option + /// The server provides document formatting on typing. + DocumentOnTypeFormattingProvider: DocumentOnTypeFormattingOptions option + /// The server provides rename support. RenameOptions may only be + /// specified if the client states that it supports + /// `prepareSupport` in its initial `initialize` request. + RenameProvider: U2 option + /// The server provides folding provider support. + FoldingRangeProvider: U3 option + /// The server provides selection range support. + SelectionRangeProvider: U3 option + /// The server provides execute command support. + ExecuteCommandProvider: ExecuteCommandOptions option + /// The server provides call hierarchy support. + /// + /// @since 3.16.0 + CallHierarchyProvider: U3 option + /// The server provides linked editing range support. + /// + /// @since 3.16.0 + LinkedEditingRangeProvider: U3 option + /// The server provides semantic tokens support. + /// + /// @since 3.16.0 + SemanticTokensProvider: U2 option + /// The server provides moniker support. + /// + /// @since 3.16.0 + MonikerProvider: U3 option + /// The server provides type hierarchy support. + /// + /// @since 3.17.0 + TypeHierarchyProvider: U3 option + /// The server provides inline values. + /// + /// @since 3.17.0 + InlineValueProvider: U3 option + /// The server provides inlay hints. + /// + /// @since 3.17.0 + InlayHintProvider: U3 option + /// The server has support for pull model diagnostics. + /// + /// @since 3.17.0 + DiagnosticProvider: U2 option + /// Workspace specific server capabilities. + Workspace: ServerCapabilitiesWorkspace option + /// Experimental server capabilities. + Experimental: LSPAny option + } + +/// A text document identifier to denote a specific version of a text document. +type VersionedTextDocumentIdentifier = + { + /// The text document's uri. + Uri: DocumentUri + /// The version number of this document. + Version: int32 + } + + interface ITextDocumentIdentifier with + /// The text document's uri. + member x.Uri = x.Uri + +/// Save options. +type SaveOptions = + { + /// The client is supposed to include the content on save. + IncludeText: bool option + } + + interface ISaveOptions with + /// The client is supposed to include the content on save. + member x.IncludeText = x.IncludeText + +/// An event describing a file change. +type FileEvent = + { + /// The file's uri. + Uri: DocumentUri + /// The change type. + Type: FileChangeType + } + +type FileSystemWatcher = + { + /// The glob pattern to watch. See {@link GlobPattern glob pattern} for more detail. + /// + /// @since 3.17.0 support for relative patterns. + GlobPattern: GlobPattern + /// The kind of events of interest. If omitted it defaults + /// to WatchKind.Create | WatchKind.Change | WatchKind.Delete + /// which is 7. + Kind: WatchKind option + } + +/// Represents a diagnostic, such as a compiler error or warning. Diagnostic objects +/// are only valid in the scope of a resource. +[] +type Diagnostic = + { + /// The range at which the message applies + Range: Range + /// The diagnostic's severity. Can be omitted. If omitted it is up to the + /// client to interpret diagnostics as error, warning, info or hint. + Severity: DiagnosticSeverity option + /// The diagnostic's code, which usually appear in the user interface. + Code: U2 option + /// An optional property to describe the error code. + /// Requires the code field (above) to be present/not null. + /// + /// @since 3.16.0 + CodeDescription: CodeDescription option + /// A human-readable string describing the source of this + /// diagnostic, e.g. 'typescript' or 'super lint'. It usually + /// appears in the user interface. + Source: string option + /// The diagnostic's message. It usually appears in the user interface + Message: string + /// Additional metadata about the diagnostic. + /// + /// @since 3.15.0 + Tags: DiagnosticTag[] option + /// An array of related diagnostic information, e.g. when symbol-names within + /// a scope collide all definitions can be marked via this property. + RelatedInformation: DiagnosticRelatedInformation[] option + /// A data entry field that is preserved between a `textDocument/publishDiagnostics` + /// notification and `textDocument/codeAction` request. + /// + /// @since 3.16.0 + Data: LSPAny option + } + + [] + member x.DebuggerDisplay = + $"[{defaultArg x.Severity DiagnosticSeverity.Error}] ({x.Range.DebuggerDisplay}) {x.Message} ({Option.map string x.Code |> Option.defaultValue String.Empty})" + +/// Contains additional information about the context in which a completion request is triggered. +type CompletionContext = + { + /// How the completion was triggered. + TriggerKind: CompletionTriggerKind + /// The trigger character (a single character) that has trigger code complete. + /// Is undefined if `triggerKind !== CompletionTriggerKind.TriggerCharacter` + TriggerCharacter: string option + } + +/// Additional details for a completion item label. +/// +/// @since 3.17.0 +type CompletionItemLabelDetails = + { + /// An optional string which is rendered less prominently directly after {@link CompletionItem.label label}, + /// without any spacing. Should be used for function signatures and type annotations. + Detail: string option + /// An optional string which is rendered less prominently after {@link CompletionItem.detail}. Should be used + /// for fully qualified names and file paths. + Description: string option + } + +/// A special text edit to provide an insert and a replace operation. +/// +/// @since 3.16.0 +type InsertReplaceEdit = + { + /// The string to be inserted. + NewText: string + /// The range if the insert is requested + Insert: Range + /// The range if the replace is requested. + Replace: Range + } + +/// Completion options. +type CompletionOptions = + { + WorkDoneProgress: bool option + /// Most tools trigger completion request automatically without explicitly requesting + /// it using a keyboard shortcut (e.g. Ctrl+Space). Typically they do so when the user + /// starts to type an identifier. For example if the user types `c` in a JavaScript file + /// code complete will automatically pop up present `console` besides others as a + /// completion item. Characters that make up identifiers don't need to be listed here. + /// + /// If code complete should automatically be trigger on characters not being valid inside + /// an identifier (for example `.` in JavaScript) list them in `triggerCharacters`. + TriggerCharacters: string[] option + /// The list of all possible characters that commit a completion. This field can be used + /// if clients don't support individual commit characters per completion item. See + /// `ClientCapabilities.textDocument.completion.completionItem.commitCharactersSupport` + /// + /// If a server provides both `allCommitCharacters` and commit characters on an individual + /// completion item the ones on the completion item win. + /// + /// @since 3.2.0 + AllCommitCharacters: string[] option + /// The server provides support to resolve additional + /// information for a completion item. + ResolveProvider: bool option + /// The server supports the following `CompletionItem` specific + /// capabilities. + /// + /// @since 3.17.0 + CompletionItem: CompletionOptionsCompletionItem option + } + + interface ICompletionOptions with + /// Most tools trigger completion request automatically without explicitly requesting + /// it using a keyboard shortcut (e.g. Ctrl+Space). Typically they do so when the user + /// starts to type an identifier. For example if the user types `c` in a JavaScript file + /// code complete will automatically pop up present `console` besides others as a + /// completion item. Characters that make up identifiers don't need to be listed here. + /// + /// If code complete should automatically be trigger on characters not being valid inside + /// an identifier (for example `.` in JavaScript) list them in `triggerCharacters`. + member x.TriggerCharacters = x.TriggerCharacters + /// The list of all possible characters that commit a completion. This field can be used + /// if clients don't support individual commit characters per completion item. See + /// `ClientCapabilities.textDocument.completion.completionItem.commitCharactersSupport` + /// + /// If a server provides both `allCommitCharacters` and commit characters on an individual + /// completion item the ones on the completion item win. + /// + /// @since 3.2.0 + member x.AllCommitCharacters = x.AllCommitCharacters + /// The server provides support to resolve additional + /// information for a completion item. + member x.ResolveProvider = x.ResolveProvider + /// The server supports the following `CompletionItem` specific + /// capabilities. + /// + /// @since 3.17.0 + member x.CompletionItem = x.CompletionItem + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// Hover options. +type HoverOptions = + { WorkDoneProgress: bool option } + + interface IHoverOptions + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// Additional information about the context in which a signature help request was triggered. +/// +/// @since 3.15.0 +type SignatureHelpContext = + { + /// Action that caused signature help to be triggered. + TriggerKind: SignatureHelpTriggerKind + /// Character that caused signature help to be triggered. + /// + /// This is undefined when `triggerKind !== SignatureHelpTriggerKind.TriggerCharacter` + TriggerCharacter: string option + /// `true` if signature help was already showing when it was triggered. + /// + /// Retriggers occurs when the signature help is already active and can be caused by actions such as + /// typing a trigger character, a cursor move, or document content changes. + IsRetrigger: bool + /// The currently active `SignatureHelp`. + /// + /// The `activeSignatureHelp` has its `SignatureHelp.activeSignature` field updated based on + /// the user navigating through available signatures. + ActiveSignatureHelp: SignatureHelp option + } + +/// Represents the signature of something callable. A signature +/// can have a label, like a function-name, a doc-comment, and +/// a set of parameters. +type SignatureInformation = + { + /// The label of this signature. Will be shown in + /// the UI. + Label: string + /// The human-readable doc-comment of this signature. Will be shown + /// in the UI but can be omitted. + Documentation: U2 option + /// The parameters of this signature. + Parameters: ParameterInformation[] option + /// The index of the active parameter. + /// + /// If provided, this is used in place of `SignatureHelp.activeParameter`. + /// + /// @since 3.16.0 + ActiveParameter: uint32 option + } + +/// Server Capabilities for a {@link SignatureHelpRequest}. +type SignatureHelpOptions = + { + WorkDoneProgress: bool option + /// List of characters that trigger signature help automatically. + TriggerCharacters: string[] option + /// List of characters that re-trigger signature help. + /// + /// These trigger characters are only active when signature help is already showing. All trigger characters + /// are also counted as re-trigger characters. + /// + /// @since 3.15.0 + RetriggerCharacters: string[] option + } + + interface ISignatureHelpOptions with + /// List of characters that trigger signature help automatically. + member x.TriggerCharacters = x.TriggerCharacters + /// List of characters that re-trigger signature help. + /// + /// These trigger characters are only active when signature help is already showing. All trigger characters + /// are also counted as re-trigger characters. + /// + /// @since 3.15.0 + member x.RetriggerCharacters = x.RetriggerCharacters + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// Server Capabilities for a {@link DefinitionRequest}. +type DefinitionOptions = + { WorkDoneProgress: bool option } + + interface IDefinitionOptions + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// Value-object that contains additional information when +/// requesting references. +type ReferenceContext = + { + /// Include the declaration of the current symbol. + IncludeDeclaration: bool + } + +/// Reference options. +type ReferenceOptions = + { WorkDoneProgress: bool option } + + interface IReferenceOptions + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// Provider options for a {@link DocumentHighlightRequest}. +type DocumentHighlightOptions = + { WorkDoneProgress: bool option } + + interface IDocumentHighlightOptions + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// A base for all symbol information. +type BaseSymbolInformation = + { + /// The name of this symbol. + Name: string + /// The kind of this symbol. + Kind: SymbolKind + /// Tags for this symbol. + /// + /// @since 3.16.0 + Tags: SymbolTag[] option + /// The name of the symbol containing this symbol. This information is for + /// user interface purposes (e.g. to render a qualifier in the user interface + /// if necessary). It can't be used to re-infer a hierarchy for the document + /// symbols. + ContainerName: string option + } + + interface IBaseSymbolInformation with + /// The name of this symbol. + member x.Name = x.Name + /// The kind of this symbol. + member x.Kind = x.Kind + /// Tags for this symbol. + /// + /// @since 3.16.0 + member x.Tags = x.Tags + /// The name of the symbol containing this symbol. This information is for + /// user interface purposes (e.g. to render a qualifier in the user interface + /// if necessary). It can't be used to re-infer a hierarchy for the document + /// symbols. + member x.ContainerName = x.ContainerName + +/// Provider options for a {@link DocumentSymbolRequest}. +type DocumentSymbolOptions = + { + WorkDoneProgress: bool option + /// A human-readable string that is shown when multiple outlines trees + /// are shown for the same document. + /// + /// @since 3.16.0 + Label: string option + } + + interface IDocumentSymbolOptions with + /// A human-readable string that is shown when multiple outlines trees + /// are shown for the same document. + /// + /// @since 3.16.0 + member x.Label = x.Label + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// Contains additional diagnostic information about the context in which +/// a {@link CodeActionProvider.provideCodeActions code action} is run. +type CodeActionContext = + { + /// An array of diagnostics known on the client side overlapping the range provided to the + /// `textDocument/codeAction` request. They are provided so that the server knows which + /// errors are currently presented to the user for the given range. There is no guarantee + /// that these accurately reflect the error state of the resource. The primary parameter + /// to compute code actions is the provided range. + Diagnostics: Diagnostic[] + /// Requested kind of actions to return. + /// + /// Actions not of this kind are filtered out by the client before being shown. So servers + /// can omit computing them. + Only: CodeActionKind[] option + /// The reason why code actions were requested. + /// + /// @since 3.17.0 + TriggerKind: CodeActionTriggerKind option + } + +/// Provider options for a {@link CodeActionRequest}. +type CodeActionOptions = + { + WorkDoneProgress: bool option + /// CodeActionKinds that this server may return. + /// + /// The list of kinds may be generic, such as `CodeActionKind.Refactor`, or the server + /// may list out every specific kind they provide. + CodeActionKinds: CodeActionKind[] option + /// The server provides support to resolve additional + /// information for a code action. + /// + /// @since 3.16.0 + ResolveProvider: bool option + } + + interface ICodeActionOptions with + /// CodeActionKinds that this server may return. + /// + /// The list of kinds may be generic, such as `CodeActionKind.Refactor`, or the server + /// may list out every specific kind they provide. + member x.CodeActionKinds = x.CodeActionKinds + /// The server provides support to resolve additional + /// information for a code action. + /// + /// @since 3.16.0 + member x.ResolveProvider = x.ResolveProvider + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// Server capabilities for a {@link WorkspaceSymbolRequest}. +type WorkspaceSymbolOptions = + { + WorkDoneProgress: bool option + /// The server provides support to resolve additional + /// information for a workspace symbol. + /// + /// @since 3.17.0 + ResolveProvider: bool option + } + + interface IWorkspaceSymbolOptions with + /// The server provides support to resolve additional + /// information for a workspace symbol. + /// + /// @since 3.17.0 + member x.ResolveProvider = x.ResolveProvider + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// Code Lens provider options of a {@link CodeLensRequest}. +type CodeLensOptions = + { + WorkDoneProgress: bool option + /// Code lens has a resolve provider as well. + ResolveProvider: bool option + } + + interface ICodeLensOptions with + /// Code lens has a resolve provider as well. + member x.ResolveProvider = x.ResolveProvider + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// Provider options for a {@link DocumentLinkRequest}. +type DocumentLinkOptions = + { + WorkDoneProgress: bool option + /// Document links have a resolve provider as well. + ResolveProvider: bool option + } + + interface IDocumentLinkOptions with + /// Document links have a resolve provider as well. + member x.ResolveProvider = x.ResolveProvider + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// Value-object describing what options formatting should use. +type FormattingOptions = + { + /// Size of a tab in spaces. + TabSize: uint32 + /// Prefer spaces over tabs. + InsertSpaces: bool + /// Trim trailing whitespace on a line. + /// + /// @since 3.15.0 + TrimTrailingWhitespace: bool option + /// Insert a newline character at the end of the file if one does not exist. + /// + /// @since 3.15.0 + InsertFinalNewline: bool option + /// Trim all newlines after the final newline at the end of the file. + /// + /// @since 3.15.0 + TrimFinalNewlines: bool option + } + +/// Provider options for a {@link DocumentFormattingRequest}. +type DocumentFormattingOptions = + { WorkDoneProgress: bool option } + + interface IDocumentFormattingOptions + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// Provider options for a {@link DocumentRangeFormattingRequest}. +type DocumentRangeFormattingOptions = + { WorkDoneProgress: bool option } + + interface IDocumentRangeFormattingOptions + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// Provider options for a {@link DocumentOnTypeFormattingRequest}. +type DocumentOnTypeFormattingOptions = + { + /// A character on which formatting should be triggered, like `{`. + FirstTriggerCharacter: string + /// More trigger characters. + MoreTriggerCharacter: string[] option + } + + interface IDocumentOnTypeFormattingOptions with + /// A character on which formatting should be triggered, like `{`. + member x.FirstTriggerCharacter = x.FirstTriggerCharacter + /// More trigger characters. + member x.MoreTriggerCharacter = x.MoreTriggerCharacter + +/// Provider options for a {@link RenameRequest}. +type RenameOptions = + { + WorkDoneProgress: bool option + /// Renames should be checked and tested before being executed. + /// + /// @since version 3.12.0 + PrepareProvider: bool option + } + + interface IRenameOptions with + /// Renames should be checked and tested before being executed. + /// + /// @since version 3.12.0 + member x.PrepareProvider = x.PrepareProvider + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// The server capabilities of a {@link ExecuteCommandRequest}. +type ExecuteCommandOptions = + { + WorkDoneProgress: bool option + /// The commands to be executed on the server + Commands: string[] + } + + interface IExecuteCommandOptions with + /// The commands to be executed on the server + member x.Commands = x.Commands + + interface IWorkDoneProgressOptions with + member x.WorkDoneProgress = x.WorkDoneProgress + +/// @since 3.16.0 +type SemanticTokensLegend = + { + /// The token types a server uses. + TokenTypes: string[] + /// The token modifiers a server uses. + TokenModifiers: string[] + } + +/// A text document identifier to optionally denote a specific version of a text document. +type OptionalVersionedTextDocumentIdentifier = + { + /// The text document's uri. + Uri: DocumentUri + /// The version number of this document. If a versioned text document identifier + /// is sent from the server to the client and the file is not open in the editor + /// (the server has not received an open notification before) the server can send + /// `null` to indicate that the version is unknown and the content on disk is the + /// truth (as specified with document content ownership). + [] + Version: int32 option + } + + interface ITextDocumentIdentifier with + /// The text document's uri. + member x.Uri = x.Uri + +/// A special text edit with an additional change annotation. +/// +/// @since 3.16.0. +type AnnotatedTextEdit = + { + /// The range of the text document to be manipulated. To insert + /// text into a document create a range where start === end. + Range: Range + /// The string to be inserted. For delete operations use an + /// empty string. + NewText: string + /// The actual identifier of the change annotation + AnnotationId: ChangeAnnotationIdentifier + } + + interface ITextEdit with + /// The range of the text document to be manipulated. To insert + /// text into a document create a range where start === end. + member x.Range = x.Range + /// The string to be inserted. For delete operations use an + /// empty string. + member x.NewText = x.NewText + +/// A generic resource operation. +type ResourceOperation = + { + /// The resource operation kind. + Kind: string + /// An optional annotation identifier describing the operation. + /// + /// @since 3.16.0 + AnnotationId: ChangeAnnotationIdentifier option + } + + interface IResourceOperation with + /// The resource operation kind. + member x.Kind = x.Kind + /// An optional annotation identifier describing the operation. + /// + /// @since 3.16.0 + member x.AnnotationId = x.AnnotationId + +/// Options to create a file. +type CreateFileOptions = + { + /// Overwrite existing file. Overwrite wins over `ignoreIfExists` + Overwrite: bool option + /// Ignore if exists. + IgnoreIfExists: bool option + } + +/// Rename file options +type RenameFileOptions = + { + /// Overwrite target if existing. Overwrite wins over `ignoreIfExists` + Overwrite: bool option + /// Ignores if target exists. + IgnoreIfExists: bool option + } + +/// Delete file options +type DeleteFileOptions = + { + /// Delete the content recursively if a folder is denoted. + Recursive: bool option + /// Ignore the operation if the file doesn't exist. + IgnoreIfNotExists: bool option + } + +/// A pattern to describe in which file operation requests or notifications +/// the server is interested in receiving. +/// +/// @since 3.16.0 +type FileOperationPattern = + { + /// The glob pattern to match. Glob patterns can have the following syntax: + /// - `*` to match one or more characters in a path segment + /// - `?` to match on one character in a path segment + /// - `**` to match any number of path segments, including none + /// - `{}` to group sub patterns into an OR expression. (e.g. `**​/*.{ts,js}` matches all TypeScript and JavaScript files) + /// - `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …) + /// - `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`) + Glob: string + /// Whether to match files or folders with this pattern. + /// + /// Matches both if undefined. + Matches: FileOperationPatternKind option + /// Additional options used during matching. + Options: FileOperationPatternOptions option + } + +/// A full document diagnostic report for a workspace diagnostic result. +/// +/// @since 3.17.0 +type WorkspaceFullDocumentDiagnosticReport = + { + /// A full document diagnostic report. + [] + Kind: string + /// An optional result id. If provided it will + /// be sent on the next diagnostic request for the + /// same document. + ResultId: string option + /// The actual items. + Items: Diagnostic[] + /// The URI for which diagnostic information is reported. + Uri: DocumentUri + /// The version number for which the diagnostics are reported. + /// If the document is not marked as open `null` can be provided. + [] + Version: int32 option + } + + interface IFullDocumentDiagnosticReport with + /// A full document diagnostic report. + member x.Kind = x.Kind + /// An optional result id. If provided it will + /// be sent on the next diagnostic request for the + /// same document. + member x.ResultId = x.ResultId + /// The actual items. + member x.Items = x.Items + +/// An unchanged document diagnostic report for a workspace diagnostic result. +/// +/// @since 3.17.0 +type WorkspaceUnchangedDocumentDiagnosticReport = + { + /// A document diagnostic report indicating + /// no changes to the last result. A server can + /// only return `unchanged` if result ids are + /// provided. + [] + Kind: string + /// A result id which will be sent on the next + /// diagnostic request for the same document. + ResultId: string + /// The URI for which diagnostic information is reported. + Uri: DocumentUri + /// The version number for which the diagnostics are reported. + /// If the document is not marked as open `null` can be provided. + [] + Version: int32 option + } + + interface IUnchangedDocumentDiagnosticReport with + /// A document diagnostic report indicating + /// no changes to the last result. A server can + /// only return `unchanged` if result ids are + /// provided. + member x.Kind = x.Kind + /// A result id which will be sent on the next + /// diagnostic request for the same document. + member x.ResultId = x.ResultId + +/// A notebook cell. +/// +/// A cell's document URI must be unique across ALL notebook +/// cells and can therefore be used to uniquely identify a +/// notebook cell or the cell's text document. +/// +/// @since 3.17.0 +type NotebookCell = + { + /// The cell's kind + Kind: NotebookCellKind + /// The URI of the cell's text document + /// content. + Document: DocumentUri + /// Additional metadata stored with the cell. + /// + /// Note: should always be an object literal (e.g. LSPObject) + Metadata: LSPObject option + /// Additional execution summary information + /// if supported by the client. + ExecutionSummary: ExecutionSummary option + } + +/// A change describing how to move a `NotebookCell` +/// array from state S to S'. +/// +/// @since 3.17.0 +type NotebookCellArrayChange = + { + /// The start oftest of the cell that changed. + Start: uint32 + /// The deleted cells + DeleteCount: uint32 + /// The new cells, if any + Cells: NotebookCell[] option + } + +/// Defines the capabilities provided by the client. +type ClientCapabilities = + { + /// Workspace specific client capabilities. + Workspace: WorkspaceClientCapabilities option + /// Text document specific client capabilities. + TextDocument: TextDocumentClientCapabilities option + /// Capabilities specific to the notebook document support. + /// + /// @since 3.17.0 + NotebookDocument: NotebookDocumentClientCapabilities option + /// Window specific client capabilities. + Window: WindowClientCapabilities option + /// General client capabilities. + /// + /// @since 3.16.0 + General: GeneralClientCapabilities option + /// Experimental client capabilities. + Experimental: LSPAny option + } + +type TextDocumentSyncOptions = + { + /// Open and close notifications are sent to the server. If omitted open close notification should not + /// be sent. + OpenClose: bool option + /// Change notifications are sent to the server. See TextDocumentSyncKind.None, TextDocumentSyncKind.Full + /// and TextDocumentSyncKind.Incremental. If omitted it defaults to TextDocumentSyncKind.None. + Change: TextDocumentSyncKind option + /// If present will save notifications are sent to the server. If omitted the notification should not be + /// sent. + WillSave: bool option + /// If present will save wait until requests are sent to the server. If omitted the request should not be + /// sent. + WillSaveWaitUntil: bool option + /// If present save notifications are sent to the server. If omitted the notification should not be + /// sent. + Save: U2 option + } + +type NotebookDocumentSyncOptionsNotebookSelector = + { + /// The notebook to be synced If a string + /// value is provided it matches against the + /// notebook type. '*' matches every notebook. + Notebook: U2 option + /// The cells of the matching notebook to be synced. + Cells: NotebookDocumentSyncOptionsNotebookSelectorCells[] option + } + +type NotebookDocumentSyncOptionsNotebookSelectorCells = { Language: string } + +/// Options specific to a notebook plus its cells +/// to be synced to the server. +/// +/// If a selector provides a notebook document +/// filter but no cell selector all cells of a +/// matching notebook document will be synced. +/// +/// If a selector provides no notebook document +/// filter but only a cell selector all notebook +/// document that contain at least one matching +/// cell will be synced. +/// +/// @since 3.17.0 +type NotebookDocumentSyncOptions = + { + /// The notebooks to be synced + NotebookSelector: NotebookDocumentSyncOptionsNotebookSelector[] + /// Whether save notification should be forwarded to + /// the server. Will only be honored if mode === `notebook`. + Save: bool option + } + + interface INotebookDocumentSyncOptions with + /// The notebooks to be synced + member x.NotebookSelector = x.NotebookSelector + /// Whether save notification should be forwarded to + /// the server. Will only be honored if mode === `notebook`. + member x.Save = x.Save + +/// Registration options specific to a notebook. +/// +/// @since 3.17.0 +type NotebookDocumentSyncRegistrationOptions = + { + /// The notebooks to be synced + NotebookSelector: NotebookDocumentSyncOptionsNotebookSelector[] + /// Whether save notification should be forwarded to + /// the server. Will only be honored if mode === `notebook`. + Save: bool option + /// The id used to register the request. The id can be used to deregister + /// the request again. See also Registration#id. + Id: string option + } + + interface INotebookDocumentSyncOptions with + /// The notebooks to be synced + member x.NotebookSelector = x.NotebookSelector + /// Whether save notification should be forwarded to + /// the server. Will only be honored if mode === `notebook`. + member x.Save = x.Save + +type WorkspaceFoldersServerCapabilities = + { + /// The server has support for workspace folders + Supported: bool option + /// Whether the server wants to receive workspace folder + /// change notifications. + /// + /// If a string is provided the string is treated as an ID + /// under which the notification is registered on the client + /// side. The ID can be used to unregister for these events + /// using the `client/unregisterCapability` request. + ChangeNotifications: U2 option + } + +/// Options for notifications/requests for user operations on files. +/// +/// @since 3.16.0 +type FileOperationOptions = + { + /// The server is interested in receiving didCreateFiles notifications. + DidCreate: FileOperationRegistrationOptions option + /// The server is interested in receiving willCreateFiles requests. + WillCreate: FileOperationRegistrationOptions option + /// The server is interested in receiving didRenameFiles notifications. + DidRename: FileOperationRegistrationOptions option + /// The server is interested in receiving willRenameFiles requests. + WillRename: FileOperationRegistrationOptions option + /// The server is interested in receiving didDeleteFiles file notifications. + DidDelete: FileOperationRegistrationOptions option + /// The server is interested in receiving willDeleteFiles file requests. + WillDelete: FileOperationRegistrationOptions option + } + +/// Structure to capture a description for an error code. +/// +/// @since 3.16.0 +type CodeDescription = + { + /// An URI to open with more information about the diagnostic error. + Href: URI + } + +/// Represents a related message and source code location for a diagnostic. This should be +/// used to point to code locations that cause or related to a diagnostics, e.g when duplicating +/// a symbol in a scope. +type DiagnosticRelatedInformation = + { + /// The location of this related diagnostic information. + Location: Location + /// The message of this related diagnostic information. + Message: string + } + +/// Represents a parameter of a callable-signature. A parameter can +/// have a label and a doc-comment. +type ParameterInformation = + { + /// The label of this parameter information. + /// + /// Either a string or an inclusive start and exclusive end offsets within its containing + /// signature label. (see SignatureInformation.label). The offsets are based on a UTF-16 + /// string representation as `Position` and `Range` does. + /// + /// *Note*: a label of type string should be a substring of its containing signature label. + /// Its intended use case is to highlight the parameter label part in the `SignatureInformation.label`. + Label: U2 + /// The human-readable doc-comment of this parameter. Will be shown + /// in the UI but can be omitted. + Documentation: U2 option + } + +/// A notebook cell text document filter denotes a cell text +/// document by different properties. +/// +/// @since 3.17.0 +type NotebookCellTextDocumentFilter = + { + /// A filter that matches against the notebook + /// containing the notebook cell. If a string + /// value is provided it matches against the + /// notebook type. '*' matches every notebook. + Notebook: U2 + /// A language id like `python`. + /// + /// Will be matched against the language id of the + /// notebook cell document. '*' matches every language. + Language: string option + } + +/// Matching options for the file operation pattern. +/// +/// @since 3.16.0 +type FileOperationPatternOptions = + { + /// The pattern should be matched ignoring casing. + IgnoreCase: bool option + } + +type ExecutionSummary = + { + /// A strict monotonically increasing value + /// indicating the execution order of a cell + /// inside a notebook. + ExecutionOrder: uint32 + /// Whether the execution was successful or + /// not if known by the client. + Success: bool option + } + +/// Workspace specific client capabilities. +type WorkspaceClientCapabilities = + { + /// The client supports applying batch edits + /// to the workspace by supporting the request + /// 'workspace/applyEdit' + ApplyEdit: bool option + /// Capabilities specific to `WorkspaceEdit`s. + WorkspaceEdit: WorkspaceEditClientCapabilities option + /// Capabilities specific to the `workspace/didChangeConfiguration` notification. + DidChangeConfiguration: DidChangeConfigurationClientCapabilities option + /// Capabilities specific to the `workspace/didChangeWatchedFiles` notification. + DidChangeWatchedFiles: DidChangeWatchedFilesClientCapabilities option + /// Capabilities specific to the `workspace/symbol` request. + Symbol: WorkspaceSymbolClientCapabilities option + /// Capabilities specific to the `workspace/executeCommand` request. + ExecuteCommand: ExecuteCommandClientCapabilities option + /// The client has support for workspace folders. + /// + /// @since 3.6.0 + WorkspaceFolders: bool option + /// The client supports `workspace/configuration` requests. + /// + /// @since 3.6.0 + Configuration: bool option + /// Capabilities specific to the semantic token requests scoped to the + /// workspace. + /// + /// @since 3.16.0. + SemanticTokens: SemanticTokensWorkspaceClientCapabilities option + /// Capabilities specific to the code lens requests scoped to the + /// workspace. + /// + /// @since 3.16.0. + CodeLens: CodeLensWorkspaceClientCapabilities option + /// The client has support for file notifications/requests for user operations on files. + /// + /// Since 3.16.0 + FileOperations: FileOperationClientCapabilities option + /// Capabilities specific to the inline values requests scoped to the + /// workspace. + /// + /// @since 3.17.0. + InlineValue: InlineValueWorkspaceClientCapabilities option + /// Capabilities specific to the inlay hint requests scoped to the + /// workspace. + /// + /// @since 3.17.0. + InlayHint: InlayHintWorkspaceClientCapabilities option + /// Capabilities specific to the diagnostic requests scoped to the + /// workspace. + /// + /// @since 3.17.0. + Diagnostics: DiagnosticWorkspaceClientCapabilities option + } + +/// Text document specific client capabilities. +type TextDocumentClientCapabilities = + { + /// Defines which synchronization capabilities the client supports. + Synchronization: TextDocumentSyncClientCapabilities option + /// Capabilities specific to the `textDocument/completion` request. + Completion: CompletionClientCapabilities option + /// Capabilities specific to the `textDocument/hover` request. + Hover: HoverClientCapabilities option + /// Capabilities specific to the `textDocument/signatureHelp` request. + SignatureHelp: SignatureHelpClientCapabilities option + /// Capabilities specific to the `textDocument/declaration` request. + /// + /// @since 3.14.0 + Declaration: DeclarationClientCapabilities option + /// Capabilities specific to the `textDocument/definition` request. + Definition: DefinitionClientCapabilities option + /// Capabilities specific to the `textDocument/typeDefinition` request. + /// + /// @since 3.6.0 + TypeDefinition: TypeDefinitionClientCapabilities option + /// Capabilities specific to the `textDocument/implementation` request. + /// + /// @since 3.6.0 + Implementation: ImplementationClientCapabilities option + /// Capabilities specific to the `textDocument/references` request. + References: ReferenceClientCapabilities option + /// Capabilities specific to the `textDocument/documentHighlight` request. + DocumentHighlight: DocumentHighlightClientCapabilities option + /// Capabilities specific to the `textDocument/documentSymbol` request. + DocumentSymbol: DocumentSymbolClientCapabilities option + /// Capabilities specific to the `textDocument/codeAction` request. + CodeAction: CodeActionClientCapabilities option + /// Capabilities specific to the `textDocument/codeLens` request. + CodeLens: CodeLensClientCapabilities option + /// Capabilities specific to the `textDocument/documentLink` request. + DocumentLink: DocumentLinkClientCapabilities option + /// Capabilities specific to the `textDocument/documentColor` and the + /// `textDocument/colorPresentation` request. + /// + /// @since 3.6.0 + ColorProvider: DocumentColorClientCapabilities option + /// Capabilities specific to the `textDocument/formatting` request. + Formatting: DocumentFormattingClientCapabilities option + /// Capabilities specific to the `textDocument/rangeFormatting` request. + RangeFormatting: DocumentRangeFormattingClientCapabilities option + /// Capabilities specific to the `textDocument/onTypeFormatting` request. + OnTypeFormatting: DocumentOnTypeFormattingClientCapabilities option + /// Capabilities specific to the `textDocument/rename` request. + Rename: RenameClientCapabilities option + /// Capabilities specific to the `textDocument/foldingRange` request. + /// + /// @since 3.10.0 + FoldingRange: FoldingRangeClientCapabilities option + /// Capabilities specific to the `textDocument/selectionRange` request. + /// + /// @since 3.15.0 + SelectionRange: SelectionRangeClientCapabilities option + /// Capabilities specific to the `textDocument/publishDiagnostics` notification. + PublishDiagnostics: PublishDiagnosticsClientCapabilities option + /// Capabilities specific to the various call hierarchy requests. + /// + /// @since 3.16.0 + CallHierarchy: CallHierarchyClientCapabilities option + /// Capabilities specific to the various semantic token request. + /// + /// @since 3.16.0 + SemanticTokens: SemanticTokensClientCapabilities option + /// Capabilities specific to the `textDocument/linkedEditingRange` request. + /// + /// @since 3.16.0 + LinkedEditingRange: LinkedEditingRangeClientCapabilities option + /// Client capabilities specific to the `textDocument/moniker` request. + /// + /// @since 3.16.0 + Moniker: MonikerClientCapabilities option + /// Capabilities specific to the various type hierarchy requests. + /// + /// @since 3.17.0 + TypeHierarchy: TypeHierarchyClientCapabilities option + /// Capabilities specific to the `textDocument/inlineValue` request. + /// + /// @since 3.17.0 + InlineValue: InlineValueClientCapabilities option + /// Capabilities specific to the `textDocument/inlayHint` request. + /// + /// @since 3.17.0 + InlayHint: InlayHintClientCapabilities option + /// Capabilities specific to the diagnostic pull model. + /// + /// @since 3.17.0 + Diagnostic: DiagnosticClientCapabilities option + } + +/// Capabilities specific to the notebook document support. +/// +/// @since 3.17.0 +type NotebookDocumentClientCapabilities = + { + /// Capabilities specific to notebook document synchronization + /// + /// @since 3.17.0 + Synchronization: NotebookDocumentSyncClientCapabilities + } + +type WindowClientCapabilities = + { + /// It indicates whether the client supports server initiated + /// progress using the `window/workDoneProgress/create` request. + /// + /// The capability also controls Whether client supports handling + /// of progress notifications. If set servers are allowed to report a + /// `workDoneProgress` property in the request specific server + /// capabilities. + /// + /// @since 3.15.0 + WorkDoneProgress: bool option + /// Capabilities specific to the showMessage request. + /// + /// @since 3.16.0 + ShowMessage: ShowMessageRequestClientCapabilities option + /// Capabilities specific to the showDocument request. + /// + /// @since 3.16.0 + ShowDocument: ShowDocumentClientCapabilities option + } + +type GeneralClientCapabilitiesStaleRequestSupport = + { + /// The client will actively cancel the request. + Cancel: bool + /// The list of requests for which the client + /// will retry the request if it receives a + /// response with error code `ContentModified` + RetryOnContentModified: string[] + } + +/// General client capabilities. +/// +/// @since 3.16.0 +type GeneralClientCapabilities = + { + /// Client capability that signals how the client + /// handles stale requests (e.g. a request + /// for which the client will not process the response + /// anymore since the information is outdated). + /// + /// @since 3.17.0 + StaleRequestSupport: GeneralClientCapabilitiesStaleRequestSupport option + /// Client capabilities specific to regular expressions. + /// + /// @since 3.16.0 + RegularExpressions: RegularExpressionsClientCapabilities option + /// Client capabilities specific to the client's markdown parser. + /// + /// @since 3.16.0 + Markdown: MarkdownClientCapabilities option + /// The position encodings supported by the client. Client and server + /// have to agree on the same position encoding to ensure that offsets + /// (e.g. character position in a line) are interpreted the same on both + /// sides. + /// + /// To keep the protocol backwards compatible the following applies: if + /// the value 'utf-16' is missing from the array of position encodings + /// servers can assume that the client supports UTF-16. UTF-16 is + /// therefore a mandatory encoding. + /// + /// If omitted it defaults to ['utf-16']. + /// + /// Implementation considerations: since the conversion from one encoding + /// into another requires the content of the file / line the conversion + /// is best done where the file is read which is usually on the server + /// side. + /// + /// @since 3.17.0 + PositionEncodings: PositionEncodingKind[] option + } + +/// A relative pattern is a helper to construct glob patterns that are matched +/// relatively to a base URI. The common value for a `baseUri` is a workspace +/// folder root, but it can be another absolute URI as well. +/// +/// @since 3.17.0 +type RelativePattern = + { + /// A workspace folder or a base URI to which this pattern will be matched + /// against relatively. + BaseUri: U2 + /// The actual glob pattern; + Pattern: Pattern + } + +type WorkspaceEditClientCapabilitiesChangeAnnotationSupport = + { + /// Whether the client groups edits with equal labels into tree nodes, + /// for instance all edits labelled with "Changes in Strings" would + /// be a tree node. + GroupsOnLabel: bool option + } + +type WorkspaceEditClientCapabilities = + { + /// The client supports versioned document changes in `WorkspaceEdit`s + DocumentChanges: bool option + /// The resource operations the client supports. Clients should at least + /// support 'create', 'rename' and 'delete' files and folders. + /// + /// @since 3.13.0 + ResourceOperations: ResourceOperationKind[] option + /// The failure handling strategy of a client if applying the workspace edit + /// fails. + /// + /// @since 3.13.0 + FailureHandling: FailureHandlingKind option + /// Whether the client normalizes line endings to the client specific + /// setting. + /// If set to `true` the client will normalize line ending characters + /// in a workspace edit to the client-specified new line + /// character. + /// + /// @since 3.16.0 + NormalizesLineEndings: bool option + /// Whether the client in general supports change annotations on text edits, + /// create file, rename file and delete file changes. + /// + /// @since 3.16.0 + ChangeAnnotationSupport: WorkspaceEditClientCapabilitiesChangeAnnotationSupport option + } + +type DidChangeConfigurationClientCapabilities = + { + /// Did change configuration notification supports dynamic registration. + DynamicRegistration: bool option + } + +type DidChangeWatchedFilesClientCapabilities = + { + /// Did change watched files notification supports dynamic registration. Please note + /// that the current protocol doesn't support static configuration for file changes + /// from the server side. + DynamicRegistration: bool option + /// Whether the client has support for {@link RelativePattern relative pattern} + /// or not. + /// + /// @since 3.17.0 + RelativePatternSupport: bool option + } + +type WorkspaceSymbolClientCapabilitiesSymbolKind = + { + /// The symbol kind values the client supports. When this + /// property exists the client also guarantees that it will + /// handle values outside its set gracefully and falls back + /// to a default value when unknown. + /// + /// If this property is not present the client only supports + /// the symbol kinds from `File` to `Array` as defined in + /// the initial version of the protocol. + ValueSet: SymbolKind[] option + } + +type WorkspaceSymbolClientCapabilitiesTagSupport = + { + /// The tags supported by the client. + ValueSet: SymbolTag[] + } + +type WorkspaceSymbolClientCapabilitiesResolveSupport = + { + /// The properties that a client can resolve lazily. Usually + /// `location.range` + Properties: string[] + } + +/// Client capabilities for a {@link WorkspaceSymbolRequest}. +type WorkspaceSymbolClientCapabilities = + { + /// Symbol request supports dynamic registration. + DynamicRegistration: bool option + /// Specific capabilities for the `SymbolKind` in the `workspace/symbol` request. + SymbolKind: WorkspaceSymbolClientCapabilitiesSymbolKind option + /// The client supports tags on `SymbolInformation`. + /// Clients supporting tags have to handle unknown tags gracefully. + /// + /// @since 3.16.0 + TagSupport: WorkspaceSymbolClientCapabilitiesTagSupport option + /// The client support partial workspace symbols. The client will send the + /// request `workspaceSymbol/resolve` to the server to resolve additional + /// properties. + /// + /// @since 3.17.0 + ResolveSupport: WorkspaceSymbolClientCapabilitiesResolveSupport option + } + +/// The client capabilities of a {@link ExecuteCommandRequest}. +type ExecuteCommandClientCapabilities = + { + /// Execute command supports dynamic registration. + DynamicRegistration: bool option + } + +/// @since 3.16.0 +type SemanticTokensWorkspaceClientCapabilities = + { + /// Whether the client implementation supports a refresh request sent from + /// the server to the client. + /// + /// Note that this event is global and will force the client to refresh all + /// semantic tokens currently shown. It should be used with absolute care + /// and is useful for situation where a server for example detects a project + /// wide change that requires such a calculation. + RefreshSupport: bool option + } + +/// @since 3.16.0 +type CodeLensWorkspaceClientCapabilities = + { + /// Whether the client implementation supports a refresh request sent from the + /// server to the client. + /// + /// Note that this event is global and will force the client to refresh all + /// code lenses currently shown. It should be used with absolute care and is + /// useful for situation where a server for example detect a project wide + /// change that requires such a calculation. + RefreshSupport: bool option + } + +/// Capabilities relating to events from file operations by the user in the client. +/// +/// These events do not come from the file system, they come from user operations +/// like renaming a file in the UI. +/// +/// @since 3.16.0 +type FileOperationClientCapabilities = + { + /// Whether the client supports dynamic registration for file requests/notifications. + DynamicRegistration: bool option + /// The client has support for sending didCreateFiles notifications. + DidCreate: bool option + /// The client has support for sending willCreateFiles requests. + WillCreate: bool option + /// The client has support for sending didRenameFiles notifications. + DidRename: bool option + /// The client has support for sending willRenameFiles requests. + WillRename: bool option + /// The client has support for sending didDeleteFiles notifications. + DidDelete: bool option + /// The client has support for sending willDeleteFiles requests. + WillDelete: bool option + } + +/// Client workspace capabilities specific to inline values. +/// +/// @since 3.17.0 +type InlineValueWorkspaceClientCapabilities = + { + /// Whether the client implementation supports a refresh request sent from the + /// server to the client. + /// + /// Note that this event is global and will force the client to refresh all + /// inline values currently shown. It should be used with absolute care and is + /// useful for situation where a server for example detects a project wide + /// change that requires such a calculation. + RefreshSupport: bool option + } + +/// Client workspace capabilities specific to inlay hints. +/// +/// @since 3.17.0 +type InlayHintWorkspaceClientCapabilities = + { + /// Whether the client implementation supports a refresh request sent from + /// the server to the client. + /// + /// Note that this event is global and will force the client to refresh all + /// inlay hints currently shown. It should be used with absolute care and + /// is useful for situation where a server for example detects a project wide + /// change that requires such a calculation. + RefreshSupport: bool option + } + +/// Workspace client capabilities specific to diagnostic pull requests. +/// +/// @since 3.17.0 +type DiagnosticWorkspaceClientCapabilities = + { + /// Whether the client implementation supports a refresh request sent from + /// the server to the client. + /// + /// Note that this event is global and will force the client to refresh all + /// pulled diagnostics currently shown. It should be used with absolute care and + /// is useful for situation where a server for example detects a project wide + /// change that requires such a calculation. + RefreshSupport: bool option + } + +type TextDocumentSyncClientCapabilities = + { + /// Whether text document synchronization supports dynamic registration. + DynamicRegistration: bool option + /// The client supports sending will save notifications. + WillSave: bool option + /// The client supports sending a will save request and + /// waits for a response providing text edits which will + /// be applied to the document before it is saved. + WillSaveWaitUntil: bool option + /// The client supports did save notifications. + DidSave: bool option + } + +type CompletionClientCapabilitiesCompletionItem = + { + /// Client supports snippets as insert text. + /// + /// A snippet can define tab stops and placeholders with `$1`, `$2` + /// and `${3:foo}`. `$0` defines the final tab stop, it defaults to + /// the end of the snippet. Placeholders with equal identifiers are linked, + /// that is typing in one will update others too. + SnippetSupport: bool option + /// Client supports commit characters on a completion item. + CommitCharactersSupport: bool option + /// Client supports the following content formats for the documentation + /// property. The order describes the preferred format of the client. + DocumentationFormat: MarkupKind[] option + /// Client supports the deprecated property on a completion item. + DeprecatedSupport: bool option + /// Client supports the preselect property on a completion item. + PreselectSupport: bool option + /// Client supports the tag property on a completion item. Clients supporting + /// tags have to handle unknown tags gracefully. Clients especially need to + /// preserve unknown tags when sending a completion item back to the server in + /// a resolve call. + /// + /// @since 3.15.0 + TagSupport: CompletionClientCapabilitiesCompletionItemTagSupport option + /// Client support insert replace edit to control different behavior if a + /// completion item is inserted in the text or should replace text. + /// + /// @since 3.16.0 + InsertReplaceSupport: bool option + /// Indicates which properties a client can resolve lazily on a completion + /// item. Before version 3.16.0 only the predefined properties `documentation` + /// and `details` could be resolved lazily. + /// + /// @since 3.16.0 + ResolveSupport: CompletionClientCapabilitiesCompletionItemResolveSupport option + /// The client supports the `insertTextMode` property on + /// a completion item to override the whitespace handling mode + /// as defined by the client (see `insertTextMode`). + /// + /// @since 3.16.0 + InsertTextModeSupport: CompletionClientCapabilitiesCompletionItemInsertTextModeSupport option + /// The client has support for completion item label + /// details (see also `CompletionItemLabelDetails`). + /// + /// @since 3.17.0 + LabelDetailsSupport: bool option + } + +type CompletionClientCapabilitiesCompletionItemTagSupport = + { + /// The tags supported by the client. + ValueSet: CompletionItemTag[] + } + +type CompletionClientCapabilitiesCompletionItemResolveSupport = + { + /// The properties that a client can resolve lazily. + Properties: string[] + } + +type CompletionClientCapabilitiesCompletionItemInsertTextModeSupport = { ValueSet: InsertTextMode[] } + +type CompletionClientCapabilitiesCompletionItemKind = + { + /// The completion item kind values the client supports. When this + /// property exists the client also guarantees that it will + /// handle values outside its set gracefully and falls back + /// to a default value when unknown. + /// + /// If this property is not present the client only supports + /// the completion items kinds from `Text` to `Reference` as defined in + /// the initial version of the protocol. + ValueSet: CompletionItemKind[] option + } + +type CompletionClientCapabilitiesCompletionList = + { + /// The client supports the following itemDefaults on + /// a completion list. + /// + /// The value lists the supported property names of the + /// `CompletionList.itemDefaults` object. If omitted + /// no properties are supported. + /// + /// @since 3.17.0 + ItemDefaults: string[] option + } + +/// Completion client capabilities +type CompletionClientCapabilities = + { + /// Whether completion supports dynamic registration. + DynamicRegistration: bool option + /// The client supports the following `CompletionItem` specific + /// capabilities. + CompletionItem: CompletionClientCapabilitiesCompletionItem option + CompletionItemKind: CompletionClientCapabilitiesCompletionItemKind option + /// Defines how the client handles whitespace and indentation + /// when accepting a completion item that uses multi line + /// text in either `insertText` or `textEdit`. + /// + /// @since 3.17.0 + InsertTextMode: InsertTextMode option + /// The client supports to send additional context information for a + /// `textDocument/completion` request. + ContextSupport: bool option + /// The client supports the following `CompletionList` specific + /// capabilities. + /// + /// @since 3.17.0 + CompletionList: CompletionClientCapabilitiesCompletionList option + } + +type HoverClientCapabilities = + { + /// Whether hover supports dynamic registration. + DynamicRegistration: bool option + /// Client supports the following content formats for the content + /// property. The order describes the preferred format of the client. + ContentFormat: MarkupKind[] option + } + +type SignatureHelpClientCapabilitiesSignatureInformation = + { + /// Client supports the following content formats for the documentation + /// property. The order describes the preferred format of the client. + DocumentationFormat: MarkupKind[] option + /// Client capabilities specific to parameter information. + ParameterInformation: SignatureHelpClientCapabilitiesSignatureInformationParameterInformation option + /// The client supports the `activeParameter` property on `SignatureInformation` + /// literal. + /// + /// @since 3.16.0 + ActiveParameterSupport: bool option + } + +type SignatureHelpClientCapabilitiesSignatureInformationParameterInformation = + { + /// The client supports processing label offsets instead of a + /// simple label string. + /// + /// @since 3.14.0 + LabelOffsetSupport: bool option + } + +/// Client Capabilities for a {@link SignatureHelpRequest}. +type SignatureHelpClientCapabilities = + { + /// Whether signature help supports dynamic registration. + DynamicRegistration: bool option + /// The client supports the following `SignatureInformation` + /// specific properties. + SignatureInformation: SignatureHelpClientCapabilitiesSignatureInformation option + /// The client supports to send additional context information for a + /// `textDocument/signatureHelp` request. A client that opts into + /// contextSupport will also support the `retriggerCharacters` on + /// `SignatureHelpOptions`. + /// + /// @since 3.15.0 + ContextSupport: bool option + } + +/// @since 3.14.0 +type DeclarationClientCapabilities = + { + /// Whether declaration supports dynamic registration. If this is set to `true` + /// the client supports the new `DeclarationRegistrationOptions` return value + /// for the corresponding server capability as well. + DynamicRegistration: bool option + /// The client supports additional metadata in the form of declaration links. + LinkSupport: bool option + } + +/// Client Capabilities for a {@link DefinitionRequest}. +type DefinitionClientCapabilities = + { + /// Whether definition supports dynamic registration. + DynamicRegistration: bool option + /// The client supports additional metadata in the form of definition links. + /// + /// @since 3.14.0 + LinkSupport: bool option + } + +/// Since 3.6.0 +type TypeDefinitionClientCapabilities = + { + /// Whether implementation supports dynamic registration. If this is set to `true` + /// the client supports the new `TypeDefinitionRegistrationOptions` return value + /// for the corresponding server capability as well. + DynamicRegistration: bool option + /// The client supports additional metadata in the form of definition links. + /// + /// Since 3.14.0 + LinkSupport: bool option + } + +/// @since 3.6.0 +type ImplementationClientCapabilities = + { + /// Whether implementation supports dynamic registration. If this is set to `true` + /// the client supports the new `ImplementationRegistrationOptions` return value + /// for the corresponding server capability as well. + DynamicRegistration: bool option + /// The client supports additional metadata in the form of definition links. + /// + /// @since 3.14.0 + LinkSupport: bool option + } + +/// Client Capabilities for a {@link ReferencesRequest}. +type ReferenceClientCapabilities = + { + /// Whether references supports dynamic registration. + DynamicRegistration: bool option + } + +/// Client Capabilities for a {@link DocumentHighlightRequest}. +type DocumentHighlightClientCapabilities = + { + /// Whether document highlight supports dynamic registration. + DynamicRegistration: bool option + } + +type DocumentSymbolClientCapabilitiesSymbolKind = + { + /// The symbol kind values the client supports. When this + /// property exists the client also guarantees that it will + /// handle values outside its set gracefully and falls back + /// to a default value when unknown. + /// + /// If this property is not present the client only supports + /// the symbol kinds from `File` to `Array` as defined in + /// the initial version of the protocol. + ValueSet: SymbolKind[] option + } + +type DocumentSymbolClientCapabilitiesTagSupport = + { + /// The tags supported by the client. + ValueSet: SymbolTag[] + } + +/// Client Capabilities for a {@link DocumentSymbolRequest}. +type DocumentSymbolClientCapabilities = + { + /// Whether document symbol supports dynamic registration. + DynamicRegistration: bool option + /// Specific capabilities for the `SymbolKind` in the + /// `textDocument/documentSymbol` request. + SymbolKind: DocumentSymbolClientCapabilitiesSymbolKind option + /// The client supports hierarchical document symbols. + HierarchicalDocumentSymbolSupport: bool option + /// The client supports tags on `SymbolInformation`. Tags are supported on + /// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set to true. + /// Clients supporting tags have to handle unknown tags gracefully. + /// + /// @since 3.16.0 + TagSupport: DocumentSymbolClientCapabilitiesTagSupport option + /// The client supports an additional label presented in the UI when + /// registering a document symbol provider. + /// + /// @since 3.16.0 + LabelSupport: bool option + } + +type CodeActionClientCapabilitiesCodeActionLiteralSupport = + { + /// The code action kind is support with the following value + /// set. + CodeActionKind: CodeActionClientCapabilitiesCodeActionLiteralSupportCodeActionKind + } + +type CodeActionClientCapabilitiesCodeActionLiteralSupportCodeActionKind = + { + /// The code action kind values the client supports. When this + /// property exists the client also guarantees that it will + /// handle values outside its set gracefully and falls back + /// to a default value when unknown. + ValueSet: CodeActionKind[] + } + +type CodeActionClientCapabilitiesResolveSupport = + { + /// The properties that a client can resolve lazily. + Properties: string[] + } + +/// The Client Capabilities of a {@link CodeActionRequest}. +type CodeActionClientCapabilities = + { + /// Whether code action supports dynamic registration. + DynamicRegistration: bool option + /// The client support code action literals of type `CodeAction` as a valid + /// response of the `textDocument/codeAction` request. If the property is not + /// set the request can only return `Command` literals. + /// + /// @since 3.8.0 + CodeActionLiteralSupport: CodeActionClientCapabilitiesCodeActionLiteralSupport option + /// Whether code action supports the `isPreferred` property. + /// + /// @since 3.15.0 + IsPreferredSupport: bool option + /// Whether code action supports the `disabled` property. + /// + /// @since 3.16.0 + DisabledSupport: bool option + /// Whether code action supports the `data` property which is + /// preserved between a `textDocument/codeAction` and a + /// `codeAction/resolve` request. + /// + /// @since 3.16.0 + DataSupport: bool option + /// Whether the client supports resolving additional code action + /// properties via a separate `codeAction/resolve` request. + /// + /// @since 3.16.0 + ResolveSupport: CodeActionClientCapabilitiesResolveSupport option + /// Whether the client honors the change annotations in + /// text edits and resource operations returned via the + /// `CodeAction#edit` property by for example presenting + /// the workspace edit in the user interface and asking + /// for confirmation. + /// + /// @since 3.16.0 + HonorsChangeAnnotations: bool option + } + +/// The client capabilities of a {@link CodeLensRequest}. +type CodeLensClientCapabilities = + { + /// Whether code lens supports dynamic registration. + DynamicRegistration: bool option + } + +/// The client capabilities of a {@link DocumentLinkRequest}. +type DocumentLinkClientCapabilities = + { + /// Whether document link supports dynamic registration. + DynamicRegistration: bool option + /// Whether the client supports the `tooltip` property on `DocumentLink`. + /// + /// @since 3.15.0 + TooltipSupport: bool option + } + +type DocumentColorClientCapabilities = + { + /// Whether implementation supports dynamic registration. If this is set to `true` + /// the client supports the new `DocumentColorRegistrationOptions` return value + /// for the corresponding server capability as well. + DynamicRegistration: bool option + } + +/// Client capabilities of a {@link DocumentFormattingRequest}. +type DocumentFormattingClientCapabilities = + { + /// Whether formatting supports dynamic registration. + DynamicRegistration: bool option + } + +/// Client capabilities of a {@link DocumentRangeFormattingRequest}. +type DocumentRangeFormattingClientCapabilities = + { + /// Whether range formatting supports dynamic registration. + DynamicRegistration: bool option + } + +/// Client capabilities of a {@link DocumentOnTypeFormattingRequest}. +type DocumentOnTypeFormattingClientCapabilities = + { + /// Whether on type formatting supports dynamic registration. + DynamicRegistration: bool option + } + +type RenameClientCapabilities = + { + /// Whether rename supports dynamic registration. + DynamicRegistration: bool option + /// Client supports testing for validity of rename operations + /// before execution. + /// + /// @since 3.12.0 + PrepareSupport: bool option + /// Client supports the default behavior result. + /// + /// The value indicates the default behavior used by the + /// client. + /// + /// @since 3.16.0 + PrepareSupportDefaultBehavior: PrepareSupportDefaultBehavior option + /// Whether the client honors the change annotations in + /// text edits and resource operations returned via the + /// rename request's workspace edit by for example presenting + /// the workspace edit in the user interface and asking + /// for confirmation. + /// + /// @since 3.16.0 + HonorsChangeAnnotations: bool option + } + +type FoldingRangeClientCapabilitiesFoldingRangeKind = + { + /// The folding range kind values the client supports. When this + /// property exists the client also guarantees that it will + /// handle values outside its set gracefully and falls back + /// to a default value when unknown. + ValueSet: FoldingRangeKind[] option + } + +type FoldingRangeClientCapabilitiesFoldingRange = + { + /// If set, the client signals that it supports setting collapsedText on + /// folding ranges to display custom labels instead of the default text. + /// + /// @since 3.17.0 + CollapsedText: bool option + } + +type FoldingRangeClientCapabilities = + { + /// Whether implementation supports dynamic registration for folding range + /// providers. If this is set to `true` the client supports the new + /// `FoldingRangeRegistrationOptions` return value for the corresponding + /// server capability as well. + DynamicRegistration: bool option + /// The maximum number of folding ranges that the client prefers to receive + /// per document. The value serves as a hint, servers are free to follow the + /// limit. + RangeLimit: uint32 option + /// If set, the client signals that it only supports folding complete lines. + /// If set, client will ignore specified `startCharacter` and `endCharacter` + /// properties in a FoldingRange. + LineFoldingOnly: bool option + /// Specific options for the folding range kind. + /// + /// @since 3.17.0 + FoldingRangeKind: FoldingRangeClientCapabilitiesFoldingRangeKind option + /// Specific options for the folding range. + /// + /// @since 3.17.0 + FoldingRange: FoldingRangeClientCapabilitiesFoldingRange option + } + +type SelectionRangeClientCapabilities = + { + /// Whether implementation supports dynamic registration for selection range providers. If this is set to `true` + /// the client supports the new `SelectionRangeRegistrationOptions` return value for the corresponding server + /// capability as well. + DynamicRegistration: bool option + } + +type PublishDiagnosticsClientCapabilitiesTagSupport = + { + /// The tags supported by the client. + ValueSet: DiagnosticTag[] + } + +/// The publish diagnostic client capabilities. +type PublishDiagnosticsClientCapabilities = + { + /// Whether the clients accepts diagnostics with related information. + RelatedInformation: bool option + /// Client supports the tag property to provide meta data about a diagnostic. + /// Clients supporting tags have to handle unknown tags gracefully. + /// + /// @since 3.15.0 + TagSupport: PublishDiagnosticsClientCapabilitiesTagSupport option + /// Whether the client interprets the version property of the + /// `textDocument/publishDiagnostics` notification's parameter. + /// + /// @since 3.15.0 + VersionSupport: bool option + /// Client supports a codeDescription property + /// + /// @since 3.16.0 + CodeDescriptionSupport: bool option + /// Whether code action supports the `data` property which is + /// preserved between a `textDocument/publishDiagnostics` and + /// `textDocument/codeAction` request. + /// + /// @since 3.16.0 + DataSupport: bool option + } + +/// @since 3.16.0 +type CallHierarchyClientCapabilities = + { + /// Whether implementation supports dynamic registration. If this is set to `true` + /// the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` + /// return value for the corresponding server capability as well. + DynamicRegistration: bool option + } + +type SemanticTokensClientCapabilitiesRequests = + { + /// The client will send the `textDocument/semanticTokens/range` request if + /// the server provides a corresponding handler. + Range: U2 option + /// The client will send the `textDocument/semanticTokens/full` request if + /// the server provides a corresponding handler. + Full: U2 option + } + +type SemanticTokensClientCapabilitiesRequestsFullC2 = + { + /// The client will send the `textDocument/semanticTokens/full/delta` request if + /// the server provides a corresponding handler. + Delta: bool option + } + +/// @since 3.16.0 +type SemanticTokensClientCapabilities = + { + /// Whether implementation supports dynamic registration. If this is set to `true` + /// the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` + /// return value for the corresponding server capability as well. + DynamicRegistration: bool option + /// Which requests the client supports and might send to the server + /// depending on the server's capability. Please note that clients might not + /// show semantic tokens or degrade some of the user experience if a range + /// or full request is advertised by the client but not provided by the + /// server. If for example the client capability `requests.full` and + /// `request.range` are both set to true but the server only provides a + /// range provider the client might not render a minimap correctly or might + /// even decide to not show any semantic tokens at all. + Requests: SemanticTokensClientCapabilitiesRequests + /// The token types that the client supports. + TokenTypes: string[] + /// The token modifiers that the client supports. + TokenModifiers: string[] + /// The token formats the clients supports. + Formats: TokenFormat[] + /// Whether the client supports tokens that can overlap each other. + OverlappingTokenSupport: bool option + /// Whether the client supports tokens that can span multiple lines. + MultilineTokenSupport: bool option + /// Whether the client allows the server to actively cancel a + /// semantic token request, e.g. supports returning + /// LSPErrorCodes.ServerCancelled. If a server does the client + /// needs to retrigger the request. + /// + /// @since 3.17.0 + ServerCancelSupport: bool option + /// Whether the client uses semantic tokens to augment existing + /// syntax tokens. If set to `true` client side created syntax + /// tokens and semantic tokens are both used for colorization. If + /// set to `false` the client only uses the returned semantic tokens + /// for colorization. + /// + /// If the value is `undefined` then the client behavior is not + /// specified. + /// + /// @since 3.17.0 + AugmentsSyntaxTokens: bool option + } + +/// Client capabilities for the linked editing range request. +/// +/// @since 3.16.0 +type LinkedEditingRangeClientCapabilities = + { + /// Whether implementation supports dynamic registration. If this is set to `true` + /// the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` + /// return value for the corresponding server capability as well. + DynamicRegistration: bool option + } + +/// Client capabilities specific to the moniker request. +/// +/// @since 3.16.0 +type MonikerClientCapabilities = + { + /// Whether moniker supports dynamic registration. If this is set to `true` + /// the client supports the new `MonikerRegistrationOptions` return value + /// for the corresponding server capability as well. + DynamicRegistration: bool option + } + +/// @since 3.17.0 +type TypeHierarchyClientCapabilities = + { + /// Whether implementation supports dynamic registration. If this is set to `true` + /// the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` + /// return value for the corresponding server capability as well. + DynamicRegistration: bool option + } + +/// Client capabilities specific to inline values. +/// +/// @since 3.17.0 +type InlineValueClientCapabilities = + { + /// Whether implementation supports dynamic registration for inline value providers. + DynamicRegistration: bool option + } + +type InlayHintClientCapabilitiesResolveSupport = + { + /// The properties that a client can resolve lazily. + Properties: string[] + } + +/// Inlay hint client capabilities. +/// +/// @since 3.17.0 +type InlayHintClientCapabilities = + { + /// Whether inlay hints support dynamic registration. + DynamicRegistration: bool option + /// Indicates which properties a client can resolve lazily on an inlay + /// hint. + ResolveSupport: InlayHintClientCapabilitiesResolveSupport option + } + +/// Client capabilities specific to diagnostic pull requests. +/// +/// @since 3.17.0 +type DiagnosticClientCapabilities = + { + /// Whether implementation supports dynamic registration. If this is set to `true` + /// the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` + /// return value for the corresponding server capability as well. + DynamicRegistration: bool option + /// Whether the clients supports related documents for document diagnostic pulls. + RelatedDocumentSupport: bool option + } + +/// Notebook specific client capabilities. +/// +/// @since 3.17.0 +type NotebookDocumentSyncClientCapabilities = + { + /// Whether implementation supports dynamic registration. If this is + /// set to `true` the client supports the new + /// `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` + /// return value for the corresponding server capability as well. + DynamicRegistration: bool option + /// The client supports sending execution summary data per cell. + ExecutionSummarySupport: bool option + } + +type ShowMessageRequestClientCapabilitiesMessageActionItem = + { + /// Whether the client supports additional attributes which + /// are preserved and send back to the server in the + /// request's response. + AdditionalPropertiesSupport: bool option + } + +/// Show message request client capabilities +type ShowMessageRequestClientCapabilities = + { + /// Capabilities specific to the `MessageActionItem` type. + MessageActionItem: ShowMessageRequestClientCapabilitiesMessageActionItem option + } + +/// Client capabilities for the showDocument request. +/// +/// @since 3.16.0 +type ShowDocumentClientCapabilities = + { + /// The client has support for the showDocument + /// request. + Support: bool + } + +/// Client capabilities specific to regular expressions. +/// +/// @since 3.16.0 +type RegularExpressionsClientCapabilities = + { + /// The engine's name. + Engine: string + /// The engine's version. + Version: string option + } + +/// Client capabilities specific to the used markdown parser. +/// +/// @since 3.16.0 +type MarkdownClientCapabilities = + { + /// The name of the parser. + Parser: string + /// The version of the parser. + Version: string option + /// A list of HTML tags that the client allows / supports in + /// Markdown. + /// + /// @since 3.17.0 + AllowedTags: string[] option + } + +/// The definition of a symbol represented as one or many {@link Location locations}. +/// For most programming languages there is only one location at which a symbol is +/// defined. +/// +/// Servers should prefer returning `DefinitionLink` over `Definition` if supported +/// by the client. +type Definition = U2 +/// Information about where a symbol is defined. +/// +/// Provides additional metadata over normal {@link Location location} definitions, including the range of +/// the defining symbol +type DefinitionLink = LocationLink +/// LSP arrays. +/// @since 3.17.0 +type LSPArray = LSPAny[] +/// The LSP any type. +/// Please note that strictly speaking a property with the value `undefined` +/// can't be converted into JSON preserving the property name. However for +/// convenience it is allowed and assumed that all these properties are +/// optional as well. +/// @since 3.17.0 +type LSPAny = JToken +/// The declaration of a symbol representation as one or many {@link Location locations}. +type Declaration = U2 +/// Information about where a symbol is declared. +/// +/// Provides additional metadata over normal {@link Location location} declarations, including the range of +/// the declaring symbol. +/// +/// Servers should prefer returning `DeclarationLink` over `Declaration` if supported +/// by the client. +type DeclarationLink = LocationLink +/// Inline value information can be provided by different means: +/// - directly as a text value (class InlineValueText). +/// - as a name to use for a variable lookup (class InlineValueVariableLookup) +/// - as an evaluatable expression (class InlineValueEvaluatableExpression) +/// The InlineValue types combines all inline value types into one type. +/// +/// @since 3.17.0 +type InlineValue = U3 +/// The result of a document diagnostic pull request. A report can +/// either be a full report containing all diagnostics for the +/// requested document or an unchanged report indicating that nothing +/// has changed in terms of diagnostics in comparison to the last +/// pull request. +/// +/// @since 3.17.0 +type DocumentDiagnosticReport = U2 +type PrepareRenameResult = U3 +type PrepareRenameResultC2 = { Range: Range; Placeholder: string } +type PrepareRenameResultC3 = { DefaultBehavior: bool } +/// A document selector is the combination of one or many document filters. +/// +/// @sample `let sel:DocumentSelector = [{ language: 'typescript' }, { language: 'json', pattern: '**∕tsconfig.json' }]`; +/// +/// The use of a string as a document filter is deprecated @since 3.16.0. +type DocumentSelector = DocumentFilter[] +type ProgressToken = U2 +/// An identifier to refer to a change annotation stored with a workspace edit. +type ChangeAnnotationIdentifier = string + +/// A workspace diagnostic document report. +/// +/// @since 3.17.0 +type WorkspaceDocumentDiagnosticReport = + U2 + +/// An event describing a change to a text document. If only a text is provided +/// it is considered to be the full content of the document. +type TextDocumentContentChangeEvent = U2 + +type TextDocumentContentChangeEventC1 = + { + /// The range of the document that changed. + Range: Range + /// The optional length of the range that got replaced. + /// + /// @deprecated use range instead. + RangeLength: uint32 option + /// The new text for the provided range. + Text: string + } + +type TextDocumentContentChangeEventC2 = + { + /// The new text of the whole document. + Text: string + } + +/// MarkedString can be used to render human readable text. It is either a markdown string +/// or a code-block that provides a language and a code snippet. The language identifier +/// is semantically equal to the optional language identifier in fenced code blocks in GitHub +/// issues. See https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting +/// +/// The pair of a language and a value is an equivalent to markdown: +/// ```${language} +/// ${value} +/// ``` +/// +/// Note that markdown strings will be sanitized - that means html will be escaped. +/// @deprecated use MarkupContent instead. +type MarkedString = U2 +type MarkedStringC2 = { Language: string; Value: string } +/// A document filter describes a top level text document or +/// a notebook cell document. +/// +/// @since 3.17.0 - proposed support for NotebookCellTextDocumentFilter. +type DocumentFilter = U2 +/// LSP object definition. +/// @since 3.17.0 +type LSPObject = Map +/// The glob pattern. Either a string pattern or a relative pattern. +/// +/// @since 3.17.0 +type GlobPattern = U2 + +/// A document filter denotes a document by different properties like +/// the {@link TextDocument.languageId language}, the {@link Uri.scheme scheme} of +/// its resource, or a glob-pattern that is applied to the {@link TextDocument.fileName path}. +/// +/// Glob patterns can have the following syntax: +/// - `*` to match one or more characters in a path segment +/// - `?` to match on one character in a path segment +/// - `**` to match any number of path segments, including none +/// - `{}` to group sub patterns into an OR expression. (e.g. `**​/*.{ts,js}` matches all TypeScript and JavaScript files) +/// - `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …) +/// - `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`) +/// +/// @sample A language filter that applies to typescript files on disk: `{ language: 'typescript', scheme: 'file' }` +/// @sample A language filter that applies to all package.json paths: `{ language: 'json', pattern: '**package.json' }` +/// +/// @since 3.17.0 +type TextDocumentFilter = + { + /// A language id, like `typescript`. + Language: string option + /// A Uri {@link Uri.scheme scheme}, like `file` or `untitled`. + Scheme: string option + /// A glob pattern, like **​/*.{ts,js}. See TextDocumentFilter for examples. + Pattern: string option + } + +/// A notebook document filter denotes a notebook document by +/// different properties. The properties will be match +/// against the notebook's URI (same as with documents) +/// +/// @since 3.17.0 +type NotebookDocumentFilter = + { + /// The type of the enclosing notebook. + NotebookType: string option + /// A Uri {@link Uri.scheme scheme}, like `file` or `untitled`. + Scheme: string option + /// A glob pattern. + Pattern: string option + } + +/// The glob pattern to watch relative to the base path. Glob patterns can have the following syntax: +/// - `*` to match one or more characters in a path segment +/// - `?` to match on one character in a path segment +/// - `**` to match any number of path segments, including none +/// - `{}` to group conditions (e.g. `**​/*.{ts,js}` matches all TypeScript and JavaScript files) +/// - `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …) +/// - `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`) +/// +/// @since 3.17.0 +type Pattern = string +/// A set of predefined token types. This set is not fixed +/// an clients can specify additional token types via the +/// corresponding client capabilities. +/// +/// @since 3.16.0 +type SemanticTokenTypes = string + +module SemanticTokenTypes = + [] + let ``namespace``: SemanticTokenTypes = "namespace" + + /// Represents a generic type. Acts as a fallback for types which can't be mapped to + /// a specific type like class or enum. + [] + let ``type``: SemanticTokenTypes = "type" + + [] + let ``class``: SemanticTokenTypes = "class" + + [] + let enum: SemanticTokenTypes = "enum" + + [] + let ``interface``: SemanticTokenTypes = "interface" + + [] + let ``struct``: SemanticTokenTypes = "struct" + + [] + let typeParameter: SemanticTokenTypes = "typeParameter" + + [] + let parameter: SemanticTokenTypes = "parameter" + + [] + let variable: SemanticTokenTypes = "variable" + + [] + let property: SemanticTokenTypes = "property" + + [] + let enumMember: SemanticTokenTypes = "enumMember" + + [] + let event: SemanticTokenTypes = "event" + + [] + let ``function``: SemanticTokenTypes = "function" + + [] + let method: SemanticTokenTypes = "method" + + [] + let macro: SemanticTokenTypes = "macro" + + [] + let keyword: SemanticTokenTypes = "keyword" + + [] + let modifier: SemanticTokenTypes = "modifier" + + [] + let comment: SemanticTokenTypes = "comment" + + [] + let string: SemanticTokenTypes = "string" + + [] + let number: SemanticTokenTypes = "number" + + [] + let regexp: SemanticTokenTypes = "regexp" + + [] + let operator: SemanticTokenTypes = "operator" + + /// @since 3.17.0 + [] + let decorator: SemanticTokenTypes = "decorator" + +/// A set of predefined token modifiers. This set is not fixed +/// an clients can specify additional token types via the +/// corresponding client capabilities. +/// +/// @since 3.16.0 +type SemanticTokenModifiers = string + +module SemanticTokenModifiers = + [] + let declaration: SemanticTokenModifiers = "declaration" + + [] + let definition: SemanticTokenModifiers = "definition" + + [] + let readonly: SemanticTokenModifiers = "readonly" + + [] + let ``static``: SemanticTokenModifiers = "static" + + [] + let deprecated: SemanticTokenModifiers = "deprecated" + + [] + let ``abstract``: SemanticTokenModifiers = "abstract" + + [] + let async: SemanticTokenModifiers = "async" + + [] + let modification: SemanticTokenModifiers = "modification" + + [] + let documentation: SemanticTokenModifiers = "documentation" + + [] + let defaultLibrary: SemanticTokenModifiers = "defaultLibrary" + +/// The document diagnostic report kinds. +/// +/// @since 3.17.0 +[)>] +type DocumentDiagnosticReportKind = + /// A diagnostic report with a full + /// set of problems. + | [] Full = 0 + /// A report indicating that the last + /// returned report is still accurate. + | [] Unchanged = 1 + +/// Predefined error codes. +type ErrorCodes = + | ParseError = -32700 + | InvalidRequest = -32600 + | MethodNotFound = -32601 + | InvalidParams = -32602 + | InternalError = -32603 + /// Error code indicating that a server received a notification or + /// request before the server has received the `initialize` request. + | ServerNotInitialized = -32002 + | UnknownErrorCode = -32001 + +type LSPErrorCodes = + /// A request failed but it was syntactically correct, e.g the + /// method name was known and the parameters were valid. The error + /// message should contain human readable information about why + /// the request failed. + /// + /// @since 3.17.0 + | RequestFailed = -32803 + /// The server cancelled the request. This error code should + /// only be used for requests that explicitly support being + /// server cancellable. + /// + /// @since 3.17.0 + | ServerCancelled = -32802 + /// The server detected that the content of a document got + /// modified outside normal conditions. A server should + /// NOT send this error code if it detects a content change + /// in it unprocessed messages. The result even computed + /// on an older state might still be useful for the client. + /// + /// If a client decides that a result is not of any use anymore + /// the client should cancel the request. + | ContentModified = -32801 + /// The client has canceled a request and a server has detected + /// the cancel. + | RequestCancelled = -32800 + +/// A set of predefined range kinds. +type FoldingRangeKind = string + +module FoldingRangeKind = + /// Folding range for a comment + [] + let Comment: FoldingRangeKind = "comment" + + /// Folding range for an import or include + [] + let Imports: FoldingRangeKind = "imports" + + /// Folding range for a region (e.g. `#region`) + [] + let Region: FoldingRangeKind = "region" + +/// A symbol kind. +type SymbolKind = + | File = 1 + | Module = 2 + | Namespace = 3 + | Package = 4 + | Class = 5 + | Method = 6 + | Property = 7 + | Field = 8 + | Constructor = 9 + | Enum = 10 + | Interface = 11 + | Function = 12 + | Variable = 13 + | Constant = 14 + | String = 15 + | Number = 16 + | Boolean = 17 + | Array = 18 + | Object = 19 + | Key = 20 + | Null = 21 + | EnumMember = 22 + | Struct = 23 + | Event = 24 + | Operator = 25 + | TypeParameter = 26 + +/// Symbol tags are extra annotations that tweak the rendering of a symbol. +/// +/// @since 3.16 +type SymbolTag = + /// Render a symbol as obsolete, usually using a strike-out. + | Deprecated = 1 + +/// Moniker uniqueness level to define scope of the moniker. +/// +/// @since 3.16.0 +[)>] +type UniquenessLevel = + /// The moniker is only unique inside a document + | [] document = 0 + /// The moniker is unique inside a project for which a dump got created + | [] project = 1 + /// The moniker is unique inside the group to which a project belongs + | [] group = 2 + /// The moniker is unique inside the moniker scheme. + | [] scheme = 3 + /// The moniker is globally unique + | [] ``global`` = 4 + +/// The moniker kind. +/// +/// @since 3.16.0 +[)>] +type MonikerKind = + /// The moniker represent a symbol that is imported into a project + | [] import = 0 + /// The moniker represents a symbol that is exported from a project + | [] export = 1 + /// The moniker represents a symbol that is local to a project (e.g. a local + /// variable of a function, a class not visible outside the project, ...) + | [] local = 2 + +/// Inlay hint kinds. +/// +/// @since 3.17.0 +type InlayHintKind = + /// An inlay hint that for a type annotation. + | Type = 1 + /// An inlay hint that is for a parameter. + | Parameter = 2 + +/// The message type +type MessageType = + /// An error message. + | Error = 1 + /// A warning message. + | Warning = 2 + /// An information message. + | Info = 3 + /// A log message. + | Log = 4 + /// A debug message. + /// + /// @since 3.18.0 + | Debug = 5 + +/// Defines how the host (editor) should sync +/// document changes to the language server. +type TextDocumentSyncKind = + /// Documents should not be synced at all. + | None = 0 + /// Documents are synced by always sending the full content + /// of the document. + | Full = 1 + /// Documents are synced by sending the full content on open. + /// After that only incremental updates to the document are + /// send. + | Incremental = 2 + +/// Represents reasons why a text document is saved. +type TextDocumentSaveReason = + /// Manually triggered, e.g. by the user pressing save, by starting debugging, + /// or by an API call. + | Manual = 1 + /// Automatic after a delay. + | AfterDelay = 2 + /// When the editor lost focus. + | FocusOut = 3 + +/// The kind of a completion entry. +type CompletionItemKind = + | Text = 1 + | Method = 2 + | Function = 3 + | Constructor = 4 + | Field = 5 + | Variable = 6 + | Class = 7 + | Interface = 8 + | Module = 9 + | Property = 10 + | Unit = 11 + | Value = 12 + | Enum = 13 + | Keyword = 14 + | Snippet = 15 + | Color = 16 + | File = 17 + | Reference = 18 + | Folder = 19 + | EnumMember = 20 + | Constant = 21 + | Struct = 22 + | Event = 23 + | Operator = 24 + | TypeParameter = 25 + +/// Completion item tags are extra annotations that tweak the rendering of a completion +/// item. +/// +/// @since 3.15.0 +type CompletionItemTag = + /// Render a completion as obsolete, usually using a strike-out. + | Deprecated = 1 + +/// Defines whether the insert text in a completion item should be interpreted as +/// plain text or a snippet. +type InsertTextFormat = + /// The primary text to be inserted is treated as a plain string. + | PlainText = 1 + /// The primary text to be inserted is treated as a snippet. + /// + /// A snippet can define tab stops and placeholders with `$1`, `$2` + /// and `${3:foo}`. `$0` defines the final tab stop, it defaults to + /// the end of the snippet. Placeholders with equal identifiers are linked, + /// that is typing in one will update others too. + /// + /// See also: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#snippet_syntax + | Snippet = 2 + +/// How whitespace and indentation is handled during completion +/// item insertion. +/// +/// @since 3.16.0 +type InsertTextMode = + /// The insertion or replace strings is taken as it is. If the + /// value is multi line the lines below the cursor will be + /// inserted using the indentation defined in the string value. + /// The client will not apply any kind of adjustments to the + /// string. + | AsIs = 1 + /// The editor adjusts leading whitespace of new lines so that + /// they match the indentation up to the cursor of the line for + /// which the item is accepted. + /// + /// Consider a line like this: <2tabs><3tabs>foo. Accepting a + /// multi line completion item is indented using 2 tabs and all + /// following lines inserted will be indented using 2 tabs as well. + | AdjustIndentation = 2 + +/// A document highlight kind. +type DocumentHighlightKind = + /// A textual occurrence. + | Text = 1 + /// Read-access of a symbol, like reading a variable. + | Read = 2 + /// Write-access of a symbol, like writing to a variable. + | Write = 3 + +/// A set of predefined code action kinds +type CodeActionKind = string + +module CodeActionKind = + /// Empty kind. + [] + let Empty: CodeActionKind = "" + + /// Base kind for quickfix actions: 'quickfix' + [] + let QuickFix: CodeActionKind = "quickfix" + + /// Base kind for refactoring actions: 'refactor' + [] + let Refactor: CodeActionKind = "refactor" + + /// Base kind for refactoring extraction actions: 'refactor.extract' + /// + /// Example extract actions: + /// + /// - Extract method + /// - Extract function + /// - Extract variable + /// - Extract interface from class + /// - ... + [] + let RefactorExtract: CodeActionKind = "refactor.extract" + + /// Base kind for refactoring inline actions: 'refactor.inline' + /// + /// Example inline actions: + /// + /// - Inline function + /// - Inline variable + /// - Inline constant + /// - ... + [] + let RefactorInline: CodeActionKind = "refactor.inline" + + /// Base kind for refactoring rewrite actions: 'refactor.rewrite' + /// + /// Example rewrite actions: + /// + /// - Convert JavaScript function to class + /// - Add or remove parameter + /// - Encapsulate field + /// - Make method static + /// - Move method to base class + /// - ... + [] + let RefactorRewrite: CodeActionKind = "refactor.rewrite" + + /// Base kind for source actions: `source` + /// + /// Source code actions apply to the entire file. + [] + let Source: CodeActionKind = "source" + + /// Base kind for an organize imports source action: `source.organizeImports` + [] + let SourceOrganizeImports: CodeActionKind = "source.organizeImports" + + /// Base kind for auto-fix source actions: `source.fixAll`. + /// + /// Fix all actions automatically fix errors that have a clear fix that do not require user input. + /// They should not suppress errors or perform unsafe fixes such as generating new types or classes. + /// + /// @since 3.15.0 + [] + let SourceFixAll: CodeActionKind = "source.fixAll" + +[)>] +type TraceValues = + /// Turn tracing off. + | [] Off = 0 + /// Trace messages only. + | [] Messages = 1 + /// Verbose message tracing. + | [] Verbose = 2 + +/// Describes the content type that a client supports in various +/// result literals like `Hover`, `ParameterInfo` or `CompletionItem`. +/// +/// Please note that `MarkupKinds` must not start with a `$`. This kinds +/// are reserved for internal usage. +[)>] +type MarkupKind = + /// Plain text is supported as a content format + | [] PlainText = 0 + /// Markdown is supported as a content format + | [] Markdown = 1 + +/// A set of predefined position encoding kinds. +/// +/// @since 3.17.0 +type PositionEncodingKind = string + +module PositionEncodingKind = + /// Character offsets count UTF-8 code units (e.g. bytes). + [] + let UTF8: PositionEncodingKind = "utf-8" + + /// Character offsets count UTF-16 code units. + /// + /// This is the default and must always be supported + /// by servers + [] + let UTF16: PositionEncodingKind = "utf-16" + + /// Character offsets count UTF-32 code units. + /// + /// Implementation note: these are the same as Unicode codepoints, + /// so this `PositionEncodingKind` may also be used for an + /// encoding-agnostic representation of character offsets. + [] + let UTF32: PositionEncodingKind = "utf-32" + +/// The file event type +type FileChangeType = + /// The file got created. + | Created = 1 + /// The file got changed. + | Changed = 2 + /// The file got deleted. + | Deleted = 3 + +type WatchKind = + /// Interested in create events. + | Create = 1 + /// Interested in change events + | Change = 2 + /// Interested in delete events + | Delete = 4 + +/// The diagnostic's severity. +type DiagnosticSeverity = + /// Reports an error. + | Error = 1 + /// Reports a warning. + | Warning = 2 + /// Reports an information. + | Information = 3 + /// Reports a hint. + | Hint = 4 + +/// The diagnostic tags. +/// +/// @since 3.15.0 +type DiagnosticTag = + /// Unused or unnecessary code. + /// + /// Clients are allowed to render diagnostics with this tag faded out instead of having + /// an error squiggle. + | Unnecessary = 1 + /// Deprecated or obsolete code. + /// + /// Clients are allowed to rendered diagnostics with this tag strike through. + | Deprecated = 2 + +/// How a completion was triggered +type CompletionTriggerKind = + /// Completion was triggered by typing an identifier (24x7 code + /// complete), manual invocation (e.g Ctrl+Space) or via API. + | Invoked = 1 + /// Completion was triggered by a trigger character specified by + /// the `triggerCharacters` properties of the `CompletionRegistrationOptions`. + | TriggerCharacter = 2 + /// Completion was re-triggered as current completion list is incomplete + | TriggerForIncompleteCompletions = 3 + +/// How a signature help was triggered. +/// +/// @since 3.15.0 +type SignatureHelpTriggerKind = + /// Signature help was invoked manually by the user or by a command. + | Invoked = 1 + /// Signature help was triggered by a trigger character. + | TriggerCharacter = 2 + /// Signature help was triggered by the cursor moving or by the document content changing. + | ContentChange = 3 + +/// The reason why code actions were requested. +/// +/// @since 3.17.0 +type CodeActionTriggerKind = + /// Code actions were explicitly requested by the user or by an extension. + | Invoked = 1 + /// Code actions were requested automatically. + /// + /// This typically happens when current selection in a file changes, but can + /// also be triggered when file content changes. + | Automatic = 2 + +/// A pattern kind describing if a glob pattern matches a file a folder or +/// both. +/// +/// @since 3.16.0 +[)>] +type FileOperationPatternKind = + /// The pattern matches a file only. + | [] file = 0 + /// The pattern matches a folder only. + | [] folder = 1 + +/// A notebook cell kind. +/// +/// @since 3.17.0 +type NotebookCellKind = + /// A markup-cell is formatted source that is used for display. + | Markup = 1 + /// A code-cell is source code. + | Code = 2 + +[)>] +type ResourceOperationKind = + /// Supports creating new files and folders. + | [] Create = 0 + /// Supports renaming existing files and folders. + | [] Rename = 1 + /// Supports deleting existing files and folders. + | [] Delete = 2 + +[)>] +type FailureHandlingKind = + /// Applying the workspace change is simply aborted if one of the changes provided + /// fails. All operations executed before the failing operation stay executed. + | [] Abort = 0 + /// All operations are executed transactional. That means they either all + /// succeed or no changes at all are applied to the workspace. + | [] Transactional = 1 + /// If the workspace edit contains only textual file changes they are executed transactional. + /// If resource changes (create, rename or delete file) are part of the change the failure + /// handling strategy is abort. + | [] TextOnlyTransactional = 2 + /// The client tries to undo the operations already executed. But there is no + /// guarantee that this is succeeding. + | [] Undo = 3 + +type PrepareSupportDefaultBehavior = + /// The client's default behavior is to select the identifier + /// according the to language's syntax rule. + | Identifier = 1 + +[)>] +type TokenFormat = + | [] Relative = 0 diff --git a/src/Types.fs b/src/Types.fs index 1c447e0..d8c842e 100644 --- a/src/Types.fs +++ b/src/Types.fs @@ -1,25 +1,63 @@ -module Ionide.LanguageServerProtocol.Types +namespace Ionide.LanguageServerProtocol.Types -open System.Diagnostics -open Newtonsoft.Json -open Newtonsoft.Json.Linq -open System -open System.Collections.Generic -open System.Runtime.Serialization +open Ionide.LanguageServerProtocol + +/// Types in typescript can have hardcoded values for their fields, this attribute is used to mark +/// the default value for a field in a type and is used when deserializing the type to json +/// but these types might not actually be used as a discriminated union or only partially used +/// so we don't generate a dedicated union type because of that +/// +/// see https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#resourceChanges for a dedicated example +type UnionKindAttribute( value: string ) = + inherit System.Attribute() + member x.Value = value + +/// Represents a Union type where the individual cases are erased when serialized or deserialized +/// For instance a union could be defined as: "string | int | bool" and when serialized it would be +/// serialized as a only a value based on the actual case type ErasedUnionAttribute() = - inherit Attribute() + inherit System.Attribute() + +[] +type U2<'T1, 'T2> = + | C1 of 'T1 + | C2 of 'T2 + override x.ToString() = + match x with + | C1 c -> string c + | C2 c -> string c [] -type U2<'a, 'b> = - | First of 'a - | Second of 'b +type U3<'T1, 'T2, 'T3> = + | C1 of 'T1 + | C2 of 'T2 + | C3 of 'T3 + override x.ToString() = + match x with + | C1 c -> string c + | C2 c -> string c + | C3 c -> string c + +[] +type U4<'T1, 'T2, 'T3, 'T4> = + | C1 of 'T1 + | C2 of 'T2 + | C3 of 'T3 + | C4 of 'T4 + override x.ToString() = + match x with + | C1 c -> string c + | C2 c -> string c + | C3 c -> string 3 + | C4 c -> string 3 + type LspResult<'t> = Result<'t, JsonRpc.Error> type AsyncLspResult<'t> = Async> + module LspResult = - open Ionide.LanguageServerProtocol let success x : LspResult<_> = Result.Ok x @@ -33,7 +71,6 @@ module LspResult = let requestCancelled<'a> : LspResult<'a> = Result.Error(JsonRpc.Error.RequestCancelled) module AsyncLspResult = - open Ionide.LanguageServerProtocol let success x : AsyncLspResult<_> = async.Return(Result.Ok x) @@ -45,3900 +82,4 @@ module AsyncLspResult = let notImplemented<'a> : AsyncLspResult<'a> = async.Return(Result.Error(JsonRpc.Error.MethodNotFound)) -/// The LSP any type -type LSPAny = JToken - -type TextDocumentSyncKind = - | None = 0 - | Full = 1 - | Incremental = 2 - -type DocumentFilter = - { - /// A language id, like `typescript`. - Language: string option - - /// A Uri scheme, like `file` or `untitled`. - Scheme: string option - - /// A glob pattern, like `*.{ts,js}`. - Pattern: string option - } - -type DocumentSelector = DocumentFilter[] - -/// Position in a text document expressed as zero-based line and zero-based character offset. -/// A position is between two characters like an ‘insert’ cursor in a editor. -/// Special values like for example -1 to denote the end of a line are not supported. -[] -type Position = - { - /// Line position in a document (zero-based). - Line: int - - /// Character offset on a line in a document (zero-based). Assuming that the line is - /// represented as a string, the `character` value represents the gap between the - /// `character` and `character + 1`. - /// - /// If the character value is greater than the line length it defaults back to the - /// line length. - Character: int - } - - [] - member x.DebuggerDisplay = $"({x.Line},{x.Character})" - -/// A range in a text document expressed as (zero-based) start and end positions. -/// A range is comparable to a selection in an editor. Therefore the end position is exclusive. -/// -/// If you want to specify a range that contains a line including the line ending character(s) -/// then use an end position denoting the start of the next line. For example: -/// -/// ```fsharp -/// { -/// Start = { Line = 5; character = 23 } -/// End = { Line = 6; character = 0 } -/// } -/// ``` -[] -type Range = - { - /// The range's start position. - Start: Position - - /// The range's end position. - End: Position - } - - [] - member x.DebuggerDisplay = $"{x.Start.DebuggerDisplay}-{x.End.DebuggerDisplay}" - -type DocumentUri = string - -/// Represents a location inside a resource, such as a line inside a text file. -type Location = { Uri: DocumentUri; Range: Range } - -type ITextDocumentIdentifier = - /// Warning: normalize this member by UrlDecoding it before use - abstract member Uri: DocumentUri - -type TextDocumentIdentifier = - { - /// The text document's URI. - Uri: DocumentUri - } - - interface ITextDocumentIdentifier with - member this.Uri = this.Uri - -type VersionedTextDocumentIdentifier = - { - /// The text document's URI. - Uri: DocumentUri - - /// The version number of this document. - /// The version number of a document will increase after each change, - /// including undo/redo. The number doesn't need to be consecutive. - Version: int - } - - interface ITextDocumentIdentifier with - member this.Uri = this.Uri - -type OptionalVersionedTextDocumentIdentifier = - { - /// The text document's URI. - Uri: DocumentUri - - /// The version number of this document. If a versioned text document identifier - /// is sent from the server to the client and the file is not open in the editor - /// (the server has not received an open notification before) the server can send - /// `null` to indicate that the version is known and the content on disk is the - /// truth (as speced with document content ownership) - /// Explicitly include the null value here. - [] - Version: int option - } - - interface ITextDocumentIdentifier with - member this.Uri = this.Uri - -type SymbolKind = - | File = 1 - | Module = 2 - | Namespace = 3 - | Package = 4 - | Class = 5 - | Method = 6 - | Property = 7 - | Field = 8 - | Constructor = 9 - | Enum = 10 - | Interface = 11 - | Function = 12 - | Variable = 13 - | Constant = 14 - | String = 15 - | Number = 16 - | Boolean = 17 - | Array = 18 - | Object = 19 - | Key = 20 - | Null = 21 - | EnumMember = 22 - | Struct = 23 - | Event = 24 - | Operator = 25 - | TypeParameter = 26 - -type SymbolTag = - | Deprecated = 1 - -/// Represents information about programming constructs like variables, classes, -/// interfaces etc. -/// -/// Deprecated: use DocumentSymbol or WorkspaceSymbol instead. -type SymbolInformation = - { - /// The name of this symbol. - Name: string - - /// The kind of this symbol. - Kind: SymbolKind - - /// Tags for this symbol. - Tags: SymbolTag[] option - - /// Indicates if this symbol is deprecated. - /// - /// Deprecated: Use Tags instead - Deprecated: bool option - - /// The location of this symbol. The location's range is used by a tool - /// to reveal the location in the editor. If the symbol is selected in the - /// tool the range's start information is used to position the cursor. So - /// the range usually spans more then the actual symbol's name and does - /// normally include things like visibility modifiers. - /// - /// The range doesn't have to denote a node range in the sense of a abstract - /// syntax tree. It can therefore not be used to re-construct a hierarchy of - /// the symbols. - Location: Location - - /// The name of the symbol containing this symbol. This information is for - /// user interface purposes (e.g. to render a qualifier in the user interface - /// if necessary). It can't be used to re-infer a hierarchy for the document - /// symbols. - ContainerName: string option - } - -/// Represents programming constructs like variables, classes, interfaces etc. -/// that appear in a document. Document symbols can be hierarchical and they -/// have two ranges: one that encloses its definition and one that points to its -/// most interesting range, e.g. the range of an identifier. -type DocumentSymbol = - { - /// The name of this symbol. Will be displayed in the user interface and - /// therefore must not be an empty string or a string only consisting of - /// white spaces. - Name: string - /// More detail for this symbol, e.g the signature of a function. - Detail: string option - /// The kind of this symbol. - Kind: SymbolKind - /// tags for this document symbol. - Tags: SymbolTag[] option - /// Indicates if this symbol is deprecated. - /// - /// Deprecated: Use Tags instead - Deprecated: bool option - /// The range enclosing this symbol not including leading/trailing whitespace - /// but everything else like comments. This information is typically used to - /// determine if the clients cursor is inside the symbol to reveal in the - /// symbol in the UI. - Range: Range - /// The range that should be selected and revealed when this symbol is being - /// picked, e.g. the name of a function. Must be contained by the `range`. - SelectionRange: Range - /// Children of this symbol, e.g. properties of a class. - Children: DocumentSymbol[] option - } - -type WorkspaceSymbol = - { - /// The name of this symbol. - Name: string - - /// The kind of this symbol. - Kind: SymbolKind - - /// Tags for this completion item. - Tags: SymbolTag[] option - - /// The name of the symbol containing this symbol. This information is for - /// user interface purposes (e.g. to render a qualifier in the user - /// interface if necessary). It can't be used to re-infer a hierarchy for - /// the document symbols. - ContainerName: string option - - /// The location of this symbol. Whether a server is allowed to return a - /// location without a range depends on the client capability - /// `workspace.symbol.resolveSupport`. - /// See also `SymbolInformation.location`. - Location: U2 - - /// A data entry field that is preserved on a workspace symbol between a - /// workspace symbol request and a workspace symbol resolve request. - Data: LSPAny option - } - -/// A textual edit applicable to a text document. -type TextEdit = - { - /// The range of the text document to be manipulated. To insert - /// text into a document create a range where start === end. - Range: Range - - /// The string to be inserted. For delete operations use an - /// empty string. - NewText: string - } - -/// Describes textual changes on a single text document. The text document is referred to as a -/// `VersionedTextDocumentIdentifier` to allow clients to check the text document version before an edit is -/// applied. A `TextDocumentEdit` describes all changes on a version Si and after they are applied move the -/// document to version Si+1. So the creator of a `TextDocumentEdit `doesn't need to sort the array or do any -/// kind of ordering. However the edits must be non overlapping. -type TextDocumentEdit = - { - /// The text document to change. - TextDocument: OptionalVersionedTextDocumentIdentifier - - /// The edits to be applied. - Edits: TextEdit[] - } - -type TraceSetting = - | Off = 0 - | Messages = 1 - | Verbose = 2 - -/// Capabilities for methods that support dynamic registration. -type DynamicCapabilities = - { - /// Method supports dynamic registration. - DynamicRegistration: bool option - } - -type DynamicLinkSupportCapabilities = - { - /// Whether implementation supports dynamic registration. - DynamicRegistration: bool option - - /// The client supports additional metadata in the form of declaration links. - LinkSupport: bool option - } - -type ResourceOperationKind = - | Create - | Rename - | Delete - -type FailureHandlingKind = - | Abort - | Transactional - | Undo - | TextOnlyTransactional - -type ChangeAnnotationSupport = { GroupsOnLabel: bool option } - -/// Capabilities specific to `WorkspaceEdit`s -type WorkspaceEditCapabilities = - { - /// The client supports versioned document changes in `WorkspaceEdit`s - DocumentChanges: bool option - /// The resource operations the client supports. Clients should at least - /// support 'create', 'rename' and 'delete' files and folders. - ResourceOperations: ResourceOperationKind[] option - /// The failure handling strategy of a client if applying the workspace edit fails. - FailureHandling: FailureHandlingKind option - /// Whether the client normalizes line endings to the client specific setting. - /// If set to `true` the client will normalize line ending characters - /// in a workspace edit to the client specific new line character(s). - NormalizesLineEndings: bool option - /// Whether the client in general supports change annotations on text edits, create file, rename file and delete file changes. - ChangeAnnotationSupport: ChangeAnnotationSupport option - } - -/// Specific capabilities for the `SymbolKind` in the `workspace/symbol` request. -type SymbolKindCapabilities = - { - /// The symbol kind values the client supports. When this - /// property exists the client also guarantees that it will - /// handle values outside its set gracefully and falls back - /// to a default value when unknown. - /// - /// If this property is not present the client only supports - /// the symbol kinds from `File` to `Array` as defined in - /// the initial version of the protocol. - ValueSet: SymbolKind[] option - } - - static member DefaultValueSet = - [| SymbolKind.File - SymbolKind.Module - SymbolKind.Namespace - SymbolKind.Package - SymbolKind.Class - SymbolKind.Method - SymbolKind.Property - SymbolKind.Field - SymbolKind.Constructor - SymbolKind.Enum - SymbolKind.Interface - SymbolKind.Function - SymbolKind.Variable - SymbolKind.Constant - SymbolKind.String - SymbolKind.Number - SymbolKind.Boolean - SymbolKind.Array |] - -type SymbolTagSupport = - { - /// The tags supported by the client. - ValueSet: SymbolTag[] - } - -type ResolveSupport = - { - /// The properties that a client can resolve lazily. - Properties: string[] - } - -/// Capabilities specific to the `workspace/symbol` request. -type SymbolCapabilities = - { - /// Symbol request supports dynamic registration. - DynamicRegistration: bool option - - /// Specific capabilities for the `SymbolKind` in the `workspace/symbol` request. - SymbolKind: SymbolKindCapabilities option - - /// The client supports tags on `SymbolInformation` and `WorkspaceSymbol`. - /// Clients supporting tags have to handle unknown tags gracefully. - TagSupport: SymbolTagSupport option - - /// The client support partial workspace symbols. The client will send the - /// request `workspaceSymbol/resolve` to the server to resolve additional - /// properties. - ResolveSupport: ResolveSupport option - } - -type SemanticTokensWorkspaceClientCapabilities = - { - /// Whether the client implementation supports a refresh request sent from - /// the server to the client. - /// - /// Note that this event is global and will force the client to refresh all - /// semantic tokens currently shown. It should be used with absolute care - /// and is useful for situation where a server for example detect a project - /// wide change that requires such a calculation. - RefreshSupport: bool option - } - -/// Client workspace capabilities specific to inlay hints. -type InlayHintWorkspaceClientCapabilities = - { - /// Whether the client implementation supports a refresh request sent from - /// the server to the client. - /// - /// Note that this event is global and will force the client to refresh all - /// inlay hints currently shown. It should be used with absolute care and - /// is useful for situation where a server for example detects a project wide - /// change that requires such a calculation. - RefreshSupport: bool option - } - -/// Client workspace capabilities specific to inline values. -type InlineValueWorkspaceClientCapabilities = - { - /// Whether the client implementation supports a refresh request sent from - /// the server to the client. - /// - /// Note that this event is global and will force the client to refresh all - /// inline values currently shown. It should be used with absolute care and - /// is useful for situation where a server for example detects a project wide - /// change that requires such a calculation. - RefreshSupport: bool option - } - -type CodeLensWorkspaceClientCapabilities = - { - /// Whether the client implementation supports a refresh request sent from the - /// server to the client. - /// - /// Note that this event is global and will force the client to refresh all - /// code lenses currently shown. It should be used with absolute care and is - /// useful for situation where a server for example detect a project wide - /// change that requires such a calculation. - RefreshSupport: bool option - } - -type WorkspaceFileOperationsClientCapabilities = - { - /// Whether the client supports dynamic registration for file - /// requests/notifications. - DynamicRegistration: bool option - - /// The client has support for sending didCreateFiles notifications. - DidCreate: bool option - - /// The client has support for sending willCreateFiles requests. - WillCreate: bool option - - /// The client has support for sending didRenameFiles notifications. - DidRename: bool option - - /// The client has support for sending willRenameFiles requests. - WillRename: bool option - - /// The client has support for sending didDeleteFiles notifications. - DidDelete: bool option - - /// The client has support for sending willDeleteFiles requests. - WillDelete: bool option - } - -type DidChangeWatchedFilesClientCapabilities = - { - /// Did change watched files notification supports dynamic registration. - /// Please note that the current protocol doesn't support static - /// configuration for file changes from the server side. - DynamicRegistration: bool option - - /// Whether the client has support for relative patterns or not. - RelativePatternSupport: bool option - } - -type DiagnosticWorkspaceClientCapabilities = - { - /// Whether the client implementation supports a refresh request sent from - /// the server to the client. - /// Note that this event is global and will force the client to refresh all - /// pulled diagnostics currently shown. It should be used with absolute care - /// and is useful for situation where a server for example detects a project - /// wide change that requires such a calculation. - RefreshSupport: bool option - } - -/// Workspace specific client capabilities. -type WorkspaceClientCapabilities = - { - /// The client supports applying batch edits to the workspace by supporting - /// the request 'workspace/applyEdit' - ApplyEdit: bool option - - /// Capabilities specific to `WorkspaceEdit`s - WorkspaceEdit: WorkspaceEditCapabilities option - - /// Capabilities specific to the `workspace/didChangeConfiguration` notification. - DidChangeConfiguration: DynamicCapabilities option - - /// Capabilities specific to the `workspace/didChangeWatchedFiles` notification. - DidChangeWatchedFiles: DidChangeWatchedFilesClientCapabilities option - - /// Capabilities specific to the `workspace/symbol` request. - Symbol: SymbolCapabilities option - - /// Capabilities specific to the `workspace/executeCommand` request. - ExecuteCommand: DynamicCapabilities option - - /// The client has support for workspace folders. - WorkspaceFolders: bool option - - /// The client supports `workspace/configuration` requests. - Configuration: bool option - - /// Capabilities specific to the semantic token requests scoped to the - /// workspace. - /// - /// @since 3.16.0 - SemanticTokens: SemanticTokensWorkspaceClientCapabilities option - - /// Client workspace capabilities specific to inlay hints. - /// - /// @since 3.17.0 - InlayHint: InlayHintWorkspaceClientCapabilities option - - - /// Client workspace capabilities specific to inline value. - /// - /// @since 3.17.0 - InlineValue: InlineValueWorkspaceClientCapabilities option - - /// Client workspace capabilities specific to code lenses. - /// - /// @since 3.16.0 - CodeLens: CodeLensWorkspaceClientCapabilities option - - /// The client has support for file requests/notifications. - FileOperations: WorkspaceFileOperationsClientCapabilities option - - /// Client workspace capabilities specific to diagnostics. - Diagnostics: DiagnosticWorkspaceClientCapabilities option - } - -type SynchronizationCapabilities = - { - /// Whether text document synchronization supports dynamic registration. - DynamicRegistration: bool option - - /// The client supports sending will save notifications. - WillSave: bool option - - /// The client supports sending a will save request and - /// waits for a response providing text edits which will - /// be applied to the document before it is saved. - WillSaveWaitUntil: bool option - - /// The client supports did save notifications. - DidSave: bool option - } - -module MarkupKind = - let PlainText = "plaintext" - let Markdown = "markdown" - -type HoverCapabilities = - { - /// Whether hover synchronization supports dynamic registration. - DynamicRegistration: bool option - - /// Client supports the follow content formats for the content - /// property. The order describes the preferred format of the client. - /// See `MarkupKind` for common values - ContentFormat: string[] option - } - -type CompletionItemTag = - /// Render a completion as obsolete, usually using a strike-out. - | Deprecated = 1 - -type CompletionItemTagSupport = - { - /// The tags supported by the client. - ValueSet: CompletionItemTag[] - } - -type InsertTextMode = - /// The insertion or replace strings is taken as it is. If the value is multi - /// line the lines below the cursor will be inserted using the indentation - /// defined in the string value. The client will not apply any kind of - /// adjustments to the string. - | AsIs = 1 - /// The editor adjusts leading whitespace of new lines so that they match the - /// indentation up to the cursor of the line for which the item is accepted. - /// Consider a line like this: <2tabs><3tabs>foo. Accepting a multi - /// line completion item is indented using 2 tabs and all following lines - /// inserted will be indented using 2 tabs as well. - | AdjustIndentation = 2 - -type InsertTextModeSupportCapability = { ValueSet: InsertTextMode[] } - -type CompletionItemCapabilities = - { - /// Client supports snippets as insert text. - /// - /// A snippet can define tab stops and placeholders with `$1`, `$2` - /// and `${3:foo}`. `$0` defines the final tab stop, it defaults to - /// the end of the snippet. Placeholders with equal identifiers are linked, - /// that is typing in one will update others too. - SnippetSupport: bool option - - /// Client supports commit characters on a completion item. - CommitCharactersSupport: bool option - - /// Client supports the follow content formats for the documentation - /// property. The order describes the preferred format of the client. - /// See `MarkupKind` for common values - DocumentationFormat: string[] option - - /// Client supports the deprecated property on a completion item. - DeprecatedSupport: bool option - - /// Client supports the preselect property on a completion item. - PreselectSupport: bool option - - /// Client supports the tag property on a completion item. Clients - /// supporting tags have to handle unknown tags gracefully. Clients - /// especially need to preserve unknown tags when sending a completion item - /// back to the server in a resolve call. - TagSupport: CompletionItemTagSupport option - - /// Client supports insert replace edit to control different behavior if a - /// completion item is inserted in the text or should replace text. - InsertReplaceSupport: bool option - - /// Indicates which properties a client can resolve lazily on a completion - /// item. Before version 3.16.0 only the predefined properties - /// `documentation` and `detail` could be resolved lazily. - ResolveSupport: ResolveSupport option - - /// The client supports the `insertTextMode` property on a completion item - /// to override the whitespace handling mode as defined by the client. - InsertTextModeSupport: InsertTextModeSupportCapability option - - /// The client has support for completion item label details. - LabelDetailsSupport: bool option - } - -type CompletionItemKind = - | Text = 1 - | Method = 2 - | Function = 3 - | Constructor = 4 - | Field = 5 - | Variable = 6 - | Class = 7 - | Interface = 8 - | Module = 9 - | Property = 10 - | Unit = 11 - | Value = 12 - | Enum = 13 - | Keyword = 14 - | Snippet = 15 - | Color = 16 - | File = 17 - | Reference = 18 - | Folder = 19 - | EnumMember = 20 - | Constant = 21 - | Struct = 22 - | Event = 23 - | Operator = 24 - | TypeParameter = 25 - -type CompletionItemKindCapabilities = - { - /// The completion item kind values the client supports. When this - /// property exists the client also guarantees that it will - /// handle values outside its set gracefully and falls back - /// to a default value when unknown. - /// - /// If this property is not present the client only supports - /// the completion items kinds from `Text` to `Reference` as defined in - /// the initial version of the protocol. - ValueSet: CompletionItemKind[] option - } - - static member DefaultValueSet = - [| CompletionItemKind.Text - CompletionItemKind.Method - CompletionItemKind.Function - CompletionItemKind.Constructor - CompletionItemKind.Field - CompletionItemKind.Variable - CompletionItemKind.Class - CompletionItemKind.Interface - CompletionItemKind.Module - CompletionItemKind.Property - CompletionItemKind.Unit - CompletionItemKind.Value - CompletionItemKind.Enum - CompletionItemKind.Keyword - CompletionItemKind.Snippet - CompletionItemKind.Color - CompletionItemKind.File - CompletionItemKind.Reference |] - -type CompletionListCapabilities = - { - /// The client supports the following itemDefaults on a completion list. - /// The value lists the supported property names of the - /// `CompletionList.itemDefaults` object. If omitted no properties are - /// supported. - ItemDefaults: string[] option - } - -/// Capabilities specific to the `textDocument/completion` -type CompletionCapabilities = - { - /// Whether completion supports dynamic registration. - DynamicRegistration: bool option - - /// The client supports the following `CompletionItem` specific - /// capabilities. - CompletionItem: CompletionItemCapabilities option - - CompletionItemKind: CompletionItemKindCapabilities option - - /// The client supports to send additional context information for a - /// `textDocument/completion` request. - ContextSupport: bool option - - /// The client's default when the completion item doesn't provide a - /// `insertTextMode` property. - InsertTextMode: InsertTextMode option - - /// The client supports the following `CompletionList` specific capabilities. - CompletionList: CompletionListCapabilities option - } - -type ParameterInformationCapability = - { - /// The client supports processing label offsets instead of a simple label - /// string. - LabelOffsetSupport: bool option - } - -type SignatureInformationCapabilities = - { - /// Client supports the follow content formats for the documentation - /// property. The order describes the preferred format of the client. - /// See `MarkupKind` for common values - DocumentationFormat: string[] option - - /// Client capabilities specific to parameter information. - ParameterInformation: ParameterInformationCapability option - - /// The client supports the `activeParameter` property on - /// `SignatureInformation` literal. - ActiveParameterSupport: bool option - } - -type SignatureHelpCapabilities = - { - /// Whether signature help supports dynamic registration. - DynamicRegistration: bool option - - /// The client supports the following `SignatureInformation` - /// specific properties. - SignatureInformation: SignatureInformationCapabilities option - - /// The client supports to send additional context information for a - /// `textDocument/signatureHelp` request. A client that opts into - /// contextSupport will also support the `retriggerCharacters` on - /// `SignatureHelpOptions`. - ContextSupport: bool option - } - -/// capabilities specific to the `textDocument/documentSymbol` -type DocumentSymbolCapabilities = - { - /// Whether document symbol supports dynamic registration. - DynamicRegistration: bool option - - /// Specific capabilities for the `SymbolKind`. - SymbolKind: SymbolKindCapabilities option - - /// The client supports hierarchical document symbols. - HierarchicalDocumentSymbolSupport: bool option - - /// The client supports tags on `SymbolInformation`. Tags are supported on - /// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set to true. - /// Clients supporting tags have to handle unknown tags gracefully. - TagSupport: SymbolTagSupport option - - /// The client supports an additional label presented in the UI when - /// registering a document symbol provider. - LabelSupport: bool option - } - -module CodeActionKind = - /// Empty kind. - let Empty = "" - - /// Base kind for quickfix actions: 'quickfix'. - let QuickFix = "quickfix" - - /// Base kind for refactoring actions: 'refactor'. - let Refactor = "refactor" - - /// Base kind for refactoring extraction actions: 'refactor.extract'. - /// - /// Example extract actions: - /// - /// - Extract method - /// - Extract function - /// - Extract variable - /// - Extract interface from class - /// - ... - let RefactorExtract = "refactor.extract" - - /// Base kind for refactoring inline actions: 'refactor.inline'. - /// - /// Example inline actions: - /// - /// - Inline function - /// - Inline variable - /// - Inline constant - /// - ... - let RefactorInline = "refactor.inline" - - /// Base kind for refactoring rewrite actions: 'refactor.rewrite'. - /// - /// Example rewrite actions: - /// - /// - Convert JavaScript function to class - /// - Add or remove parameter - /// - Encapsulate field - /// - Make method static - /// - Move method to base class - /// - ... - let RefactorRewrite = "refactor.rewrite" - - /// Base kind for source actions: `source`. - /// - /// Source code actions apply to the entire file. - let Source = "source" - - /// - /// Base kind for an organize imports source action: - /// `source.organizeImports`. - /// - let SourceOrganizeImports = "source.organizeImports" - - /// - /// Base kind for a 'fix all' source action: `source.fixAll`. - /// - /// 'Fix all' actions automatically fix errors that have a clear fix that - /// do not require user input. They should not suppress errors or perform - /// unsafe fixes such as generating new types or classes. - /// - /// @since 3.17.0 - let SourceFixAll = "source.fixAll" - -type CodeActionClientCapabilityLiteralSupportCodeActionKind = - { - /// The code action kind values the client supports. When this - /// property exists the client also guarantees that it will - /// handle values outside its set gracefully and falls back - /// to a default value when unknown. - /// See `CodeActionKind` for common values - ValueSet: string[] - } - -type CodeActionClientCapabilityLiteralSupport = - { - /// The code action kind is supported with the following value set. - CodeActionKind: CodeActionClientCapabilityLiteralSupportCodeActionKind - } - -/// capabilities specific to the `textDocument/codeAction` -type CodeActionClientCapabilities = - { - /// Whether document symbol supports dynamic registration. - DynamicRegistration: bool option - - /// The client supports code action literals as a valid - /// response of the `textDocument/codeAction` request. - CodeActionLiteralSupport: CodeActionClientCapabilityLiteralSupport option - - /// Whether code action supports the `isPreferred` property. - IsPreferredSupport: bool option - - /// Whether code action supports the `disabled` property. - DisabledSupport: bool option - - /// Whether code action supports the `data` property which is - /// preserved between a `textDocument/codeAction` and a - /// `codeAction/resolve` request. - DataSupport: bool option - - /// Whether the client supports resolving additional code action - /// properties via a separate `codeAction/resolve` request. - ResolveSupport: ResolveSupport option - - /// Whether the client honors the change annotations in - /// text edits and resource operations returned via the - /// `CodeAction#edit` property by for example presenting - /// the workspace edit in the user interface and asking - /// for confirmation. - HonorsChangeAnnotations: bool option - } - -[] -type DiagnosticTag = - /// Unused or unnecessary code. - /// - /// Clients are allowed to render diagnostics with this tag faded out instead of having - /// an error squiggle. - | Unnecessary = 1 - /// Deprecated or obsolete code. - /// - /// Clients are allowed to rendered diagnostics with this tag strike through. - | Deprecated = 2 - -type DiagnosticTagSupport = - { - - /// Represents the tags supported by the client - ValueSet: DiagnosticTag[] - } - -/// Capabilities specific to `textDocument/publishDiagnostics`. -type PublishDiagnosticsCapabilities = - { - /// Whether the clients accepts diagnostics with related information. - RelatedInformation: bool option - - /// Client supports the tag property to provide meta data about a diagnostic. - TagSupport: DiagnosticTagSupport option - - /// Whether the client interprets the version property of the - /// `textDocument/publishDiagnostics` notification's parameter. - VersionSupport: bool option - - /// Client supports a codeDescription property - CodeDescriptionSupport: bool option - - /// Whether code action supports the `data` property which is preserved - /// between a `textDocument/publishDiagnostics` and `textDocument/codeAction` - /// request. - DataSupport: bool option - } - -type FoldingRangeKindCapabilities = - { - /// The folding range kind values the client supports. When this property - /// exists the client also guarantees that it will handle values outside its - /// set gracefully and falls back to a default value when unknown. - ValueSet: string[] option - } - -type FoldingRangeCapabilities' = - { - /// If set, the client signals that it supports setting collapsedText on - /// folding ranges to display custom labels instead of the default text. - CollapsedText: bool option - } - -type FoldingRangeCapabilities = - { - /// Whether implementation supports dynamic registration for folding range providers. If this is set to `true` - /// the client supports the new `(FoldingRangeProviderOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions)` - /// return value for the corresponding server capability as well. - DynamicRegistration: bool option - - /// The maximum number of folding ranges that the client prefers to receive per document. The value serves as a - /// hint, servers are free to follow the limit. - RangeLimit: int option - - /// If set, the client signals that it only supports folding complete lines. If set, client will - /// ignore specified `startCharacter` and `endCharacter` properties in a FoldingRange. - LineFoldingOnly: bool option - - /// Specific options for the folding range kind. - FoldingRangeKind: FoldingRangeKindCapabilities option - - /// Specific options for the folding range. - FoldingRange: FoldingRangeCapabilities' option - } - -type SemanticTokenFullRequestType = - { - /// The client will send the `textDocument/semanticTokens/full/delta` - /// request if the server provides a corresponding handler. - Delta: bool option - } - -type SemanticTokensRequests = - { - /// The client will send the `textDocument/semanticTokens/range` request - /// if the server provides a corresponding handler. - Range: bool option - - /// The client will send the `textDocument/semanticTokens/full` request - /// if the server provides a corresponding handler. - Full: U2 option - } - -type TokenFormat = | Relative - -type SemanticTokensClientCapabilities = - { - /// Whether implementation supports dynamic registration. If this is set to - /// `true` the client supports the new `(TextDocumentRegistrationOptions & - /// StaticRegistrationOptions)` return value for the corresponding server - /// capability as well. - DynamicRegistration: bool option - - /// Which requests the client supports and might send to the server - /// depending on the server's capability. Please note that clients might not - /// show semantic tokens or degrade some of the user experience if a range - /// or full request is advertised by the client but not provided by the - /// server. If for example the client capability `requests.full` and - /// `request.range` are both set to true but the server only provides a - /// range provider the client might not render a minimap correctly or might - /// even decide to not show any semantic tokens at all. - Requests: SemanticTokensRequests - - /// The token types that the client supports. - TokenTypes: string[] - - /// The token modifiers that the client supports. - TokenModifiers: string[] - - /// The formats the clients supports. - Formats: TokenFormat[] - - /// Whether the client supports tokens that can overlap each other. - OverlappingTokenSupport: bool option - - /// Whether the client supports tokens that can span multiple lines. - MultilineTokenSupport: bool option - - /// Whether the client allows the server to actively cancel a semantic token - /// request, e.g. supports returning ErrorCodes.ServerCancelled. If a server - /// does the client needs to retrigger the request. - ServerCancelSupport: bool option - - /// Whether the client uses semantic tokens to augment existing syntax - /// tokens. If set to `true` client side created syntax tokens and semantic - /// tokens are both used for colorization. If set to `false` the client only - /// uses the returned semantic tokens for colorization. - /// If the value is `undefined` then the client behavior is not specified. - AugmentsSyntaxTokens: bool option - } - -/// Inlay hint client capabilities. -type InlayHintClientCapabilities = - { - /// Whether inlay hints support dynamic registration. - DynamicRegistration: bool option - /// Indicates which properties a client can resolve lazily on a inlay - /// hint. - ResolveSupport: ResolveSupport option - } - -type DiagnosticCapabilities = - { - /// Whether implementation supports dynamic registration. If this is set to `true` the client supports the new - /// `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` return value for the corresponding server - /// capability as well. - DynamicRegistration: bool option - - /// Whether the clients supports related documents for document diagnostic pulls. - RelatedDocumentSupport: bool option - } - - -/// Inline value client capabilities. -type InlineValueClientCapabilities = - { - /// Whether inline value support dynamic registration. - DynamicRegistration: bool option - /// Indicates which properties a client can resolve lazily on a inline - /// value. - ResolveSupport: ResolveSupport option - } - -type PrepareSupportDefaultBehavior = - /// The client's default behavior is to select the identifier according to the - /// language's syntax rule. - | Identifier = 1 - -type RenameClientCapabilities = - { - /// Whether rename supports dynamic registration. - DynamicRegistration: bool option - - /// Client supports testing for validity of rename operations before execution. - /// @since 3.12.0 - PrepareSupport: bool option - - /// Client supports the default behavior result - /// (`{ defaultBehavior: boolean }`). - /// The value indicates the default behavior used by the client. - PrepareSupportDefaultBehavior: PrepareSupportDefaultBehavior option - - /// Whether the client honors the change annotations in text edits and resource operations - /// returned via the rename request's workspace edit by for example presenting the workspace - /// edit in the user interface and asking for confirmation. - /// - /// @since 3.16.0 - HonorsChangeAnnotations: bool option - } - -type DocumentLinkCapabilities = - { - /// Whether document link supports dynamic registration. - DynamicRegistration: bool option - - /// Whether the client supports the `tooltip` property on `DocumentLink`. - TooltipSupport: bool option - } - -/// Text document specific client capabilities. -type TextDocumentClientCapabilities = - { - Synchronization: SynchronizationCapabilities option - - /// Capabilities specific to `textDocument/publishDiagnostics`. - PublishDiagnostics: PublishDiagnosticsCapabilities option - - /// Capabilities specific to the `textDocument/completion` - Completion: CompletionCapabilities option - - /// Capabilities specific to the `textDocument/hover` - Hover: HoverCapabilities option - - /// Capabilities specific to the `textDocument/signatureHelp` - SignatureHelp: SignatureHelpCapabilities option - - /// Capabilities specific to the `textDocument/declaration` request. - Declaration: DynamicLinkSupportCapabilities option - - /// Capabilities specific to the `textDocument/references` - References: DynamicCapabilities option - - /// Whether document highlight supports dynamic registration. - DocumentHighlight: DynamicCapabilities option - - /// Capabilities specific to the `textDocument/documentSymbol` - DocumentSymbol: DocumentSymbolCapabilities option - - /// Capabilities specific to the `textDocument/formatting` - Formatting: DynamicCapabilities option - - /// Capabilities specific to the `textDocument/rangeFormatting` - RangeFormatting: DynamicCapabilities option - - /// Capabilities specific to the `textDocument/onTypeFormatting` - OnTypeFormatting: DynamicCapabilities option - - /// Capabilities specific to the `textDocument/definition` - Definition: DynamicLinkSupportCapabilities option - - /// Capabilities specific to the `textDocument/typeDefinition` request. - TypeDefinition: DynamicLinkSupportCapabilities option - - /// Capabilities specific to the `textDocument/implementation` request. - Implementation: DynamicLinkSupportCapabilities option - - /// Capabilities specific to the `textDocument/codeAction` - CodeAction: CodeActionClientCapabilities option - - /// Capabilities specific to the `textDocument/codeLens` - CodeLens: DynamicCapabilities option - - /// Capabilities specific to the `textDocument/documentLink` - DocumentLink: DocumentLinkCapabilities option - - /// Capabilities specific to the `textDocument/documentColor` and the `textDocument/colorPresentation` request. - ColorProvider: DynamicCapabilities option - - /// Capabilities specific to the `textDocument/rename` - Rename: RenameClientCapabilities option - - /// Capabilities for the `textDocument/foldingRange` - FoldingRange: FoldingRangeCapabilities option - - /// Capabilities for the `textDocument/selectionRange` - SelectionRange: DynamicCapabilities option - - /// Capabilities specific to the `textDocument/linkedEditingRange` request. - LinkedEditingRange: DynamicCapabilities option - - /// Capabilities specific to the various call hierarchy requests. - /// - /// @since 3.16.0 - CallHierarchy: DynamicCapabilities option - - /// Capabilities specific to the various semantic token requests. - /// @since 3.16.0 - SemanticTokens: SemanticTokensClientCapabilities option - - /// Capabilities specific to the `textDocument/moniker` request. - Moniker: DynamicCapabilities option - - /// Capabilities specific to the various type hierarchy requests. - /// - /// @since 3.17.0 - TypeHierarchy: DynamicCapabilities option - - /// Capabilities specific to the `textDocument/inlineValue` request. - /// @since 3.17.0 - InlineValue: DynamicCapabilities option - - /// Capabilities specific to the `textDocument/inlayHint` request. - /// - /// @since 3.17.0 - InlayHint: InlayHintClientCapabilities option - - /// Capabilities specific to the diagnostic pull model. - /// @since 3.17.0 - Diagnostic: DiagnosticCapabilities option - } - -/// Client capabilities for the showDocument request. -/// -/// @since 3.16.0 -type ShowDocumentClientCapabilities = - { - /// The client has support for the showDocument request - support: bool - } - -/// Capabilities specific to the `MessageActionItem` type -type MessageActionItemCapabilties = - { - /// Whether the client supports additional attributes which - /// are preserved and send back to the server in the - /// request's response. - additionalPropertiesSupport: bool option - } - -/// Show message request client capabilities -type ShowMessageRequestClientCapabilities = - { - /// Capabilities specific to the `MessageActionItem` type - messageActionItem: MessageActionItemCapabilties option - } - -type WindowClientCapabilities = - { - /// - /// It indicates whether the client supports server initiated - /// progress using the `window/workDoneProgress/create` request. - /// - /// The capability also controls Whether client supports handling - /// of progress notifications. If set servers are allowed to report a - /// `workDoneProgress` property in the request specific server - /// capabilities. - /// - /// @since 3.15.0 - workDoneProgress: bool option - - /// Capabilities specific to the showMessage request. - /// - /// @since 3.16.0 - showMessage: ShowMessageRequestClientCapabilities option - - /// Capabilities specific to the showDocument request. - /// - /// @since 3.16.0 - showDocument: ShowDocumentClientCapabilities option - } - -/// Client capability that signals how the client -/// handles stale requests (e.g. a request -/// for which the client will not process the response -/// anymore since the information is outdated). -type StaleRequestSupportClientCapabilities = - { - /// The client will actively cancel the request. - Cancel: bool - - /// The list of requests for which the client will retry the request if it - /// receives a response with error code `ContentModified`` - RetryOnContentModified: string[] - } - -type RegularExpressionsClientCapabilities = - { - /// The engine's name. - Engine: string - - /// The engine's version. - Version: string option - } - -/// Client capabilities specific to the used markdown parser. -/// @since 3.16.0 -type MarkdownClientCapabilities = - { - /// The name of the parser. - Parser: string - - /// The version of the parser. - Version: string option - - /// A list of HTML tags that the client allows / supports in Markdown. - /// @since 3.17.0 - AllowedTags: string[] option - } - -/// A type indicating how positions are encoded, -/// specifically what column offsets mean. -/// -/// @since 3.17.0 -type PositionEncodingKind = string - -type GeneralClientCapabilities = - { - /// Client capability that signals how the client handles stale requests - /// (e.g. a request for which the client will not process the response - /// anymore since the information is outdated). - /// @since 3.17.0 - StaleRequestSupport: StaleRequestSupportClientCapabilities option - - /// Client capabilities specific to regular expressions. - /// @since 3.16.0 - RegularExpressions: RegularExpressionsClientCapabilities option - - /// Client capabilities specific to the client's markdown parser. - /// @since 3.16.0 - Markdown: MarkdownClientCapabilities option - - /// The position encodings supported by the client. Client and server have - /// to agree on the same position encoding to ensure that offsets (e.g. - /// character position in a line) are interpreted the same on both side. - /// To keep the protocol backwards compatible the following applies: if the - /// value 'utf-16' is missing from the array of position encodings servers - /// can assume that the client supports UTF-16. UTF-16 is therefore a - /// mandatory encoding. - /// If omitted it defaults to ['utf-16']. - /// Implementation considerations: since the conversion from one encoding - /// into another requires the content of the file / line the conversion is - /// best done where the file is read which is usually on the server side. - PositionEncodings: PositionEncodingKind[] option - } - -type ClientCapabilities = - { - /// Workspace specific client capabilities. - Workspace: WorkspaceClientCapabilities option - - /// Text document specific client capabilities. - TextDocument: TextDocumentClientCapabilities option - - /// General client capabilities. - General: GeneralClientCapabilities option - - /// Experimental client capabilities. - Experimental: LSPAny option - - /// Window specific client capabilities. - Window: WindowClientCapabilities option - } - -type WorkspaceFolder = - { - /// The associated URI for this workspace folder. - Uri: DocumentUri - - /// The name of the workspace folder. Defaults to the - /// uri's basename. - Name: string - } - -type ClientInfo = { Name: string; Version: string option } - -type InitializeParams = - { - /// The process Id of the parent process that started the server. Is null if - /// the process has not been started by another process. If the parent - /// process is not alive then the server should exit (see exit notification) - /// its process. - ProcessId: int option - /// Information about the client. - /// @since 3.15.0 - ClientInfo: ClientInfo option - /// The locale the client is currently showing the user interface in. This - /// must not necessarily be the locale of the operating system. - /// Uses IETF language tags as the value's syntax (See - /// https://en.wikipedia.org/wiki/IETF_language_tag) - Locale: string option - /// The rootPath of the workspace. Is null if no folder is open. - /// - /// Deprecated: Use RootUri instead - RootPath: string option - /// The rootUri of the workspace. Is null if no folder is open. If both - /// `rootPath` and `rootUri` are set `rootUri` wins. - /// - /// Deprecated: Use WorkspaceFolders instead - RootUri: string option - /// User provided initialization options. - InitializationOptions: JToken option - /// The capabilities provided by the client (editor or tool) - Capabilities: ClientCapabilities option - /// The initial trace setting. If omitted trace is disabled ('off'). - trace: string option - /// The workspace folders configured in the client when the server starts. - /// This property is only available if the client supports workspace folders. - /// It can be `null` if the client supports workspace folders but none are configured. - /// @since 3.6.0 - WorkspaceFolders: WorkspaceFolder[] option - } - -type InitializedParams() = - override _.Equals(o) = o :? InitializedParams - override _.GetHashCode() = 0 - override _.ToString() = "{}" - - -type CompletionItemOptions = - { - /// The server has support for completion item label details (see also - /// `CompletionItemLabelDetails`) when receiving a completion item in a resolve call. - LabelDetailsSupport: bool option - } - -/// Completion options. -type CompletionOptions = - { - /// The server provides support to resolve additional information for a completion item. - ResolveProvider: bool option - - /// The characters that trigger completion automatically. - TriggerCharacters: char[] option - - /// The list of all possible characters that commit a completion. - /// This field can be used if clients don't support individual commit - /// characters per completion item. - /// - /// See `ClientCapabilities.textDocument.completion.completionItem.commitCharactersSupport`. - /// - /// If a server provides both `allCommitCharacters` and commit characters - /// on an individual completion item, the ones on the completion item win. - AllCommitCharacters: char[] option - - /// The server supports the following `CompletionItem` specific capabilities. - CompletionItem: CompletionItemOptions option - } - -type CompletionRegistrationOptions = - { - TriggerCharacters: char [] option - AllCommitCharacters: char [] option - CompletionItem: CompletionItemOptions option - ResolveProvider: bool option - DocumentSelector: DocumentSelector option - } - -/// Signature help options. -type SignatureHelpOptions = - { - /// The characters that trigger signature help automatically. - TriggerCharacters: char[] option - /// List of characters that re-trigger signature help. - /// - /// These trigger characters are only active when signature help is already showing. - /// All trigger characters are also counted as re-trigger characters. - RetriggerCharacters: char[] option - } - -type SignatureHelpRegistrationOptions = - { - TriggerCharacters: char [] option - RetriggerCharacters: char [] option - DocumentSelector: DocumentSelector option - } - -/// Document Symbol options -type DocumentSymbolOptions = - { - /// A human-readable string that is shown when multiple outlines trees are - /// shown for the same document. - Label: string option - } - -type DocumentSymbolRegistrationOptions = - { - Label: string option - DocumentSelector: DocumentSelector option - } - -/// Code action options. -type CodeActionOptions = - { - /// CodeActionKinds that this server may return. - /// - /// The list of kinds may be generic, such as `CodeActionKind.Refactor`, - /// or the server may list out every specific kind they provide. - CodeActionKinds: string[] option - - /// The server provides support to resolve additional - /// information for a code action. - ResolveProvider: bool option - } - -/// Code Lens options. -type CodeLensOptions = - { - /// Code lens has a resolve provider as well. - ResolveProvider: bool option - } - -type CodeLensRegistrationOptions = - { - ResolveProvider: bool option - DocumentSelector: DocumentSelector option - } - -/// Format document on type options -type DocumentOnTypeFormattingOptions = - { - /// A character on which formatting should be triggered, like `}`. - FirstTriggerCharacter: char - - /// More trigger characters. - MoreTriggerCharacter: char[] option - } - -type DocumentOnTypeFormattingRegistrationOptions = - { - FirstTriggerCharacter: char - MoreTriggerCharacter: char [] option - DocumentSelector: DocumentSelector option - } - -/// Document link options -type DocumentLinkOptions = - { - /// Document links have a resolve provider as well. - ResolveProvider: bool option - } - -/// Execute command options. -type ExecuteCommandOptions = - { - /// The commands to be executed on the server - commands: string[] option - } - -/// Save options. -type SaveOptions = - { - /// The client is supposed to include the content on save. - IncludeText: bool option - } - -type TextDocumentSyncOptions = - { - /// Open and close notifications are sent to the server. - OpenClose: bool option - - /// Change notifications are sent to the server. See TextDocumentSyncKind.None, TextDocumentSyncKind.Full - /// and TextDocumentSyncKind.Incremental. - Change: TextDocumentSyncKind option - - /// Will save notifications are sent to the server. - WillSave: bool option - - /// Will save wait until requests are sent to the server. - WillSaveWaitUntil: bool option - - /// Save notifications are sent to the server. - Save: SaveOptions option - } - - static member Default = - { OpenClose = None - Change = None - WillSave = None - WillSaveWaitUntil = None - Save = None } - -type SemanticTokensLegend = - { - /// The token types a server uses. - TokenTypes: string[] - /// The token modifiers a server uses. - TokenModifiers: string[] - } - -type SemanticTokenFullOptions = - { - /// The server supports deltas for full documents. - Delta: bool option - } - -type SemanticTokensOptions = - { - /// The legend used by the server - Legend: SemanticTokensLegend - - /// Server supports providing semantic tokens for a specific range of a document. - Range: bool option - - /// Server supports providing semantic tokens for a full document. - Full: U2 option - } - -type SemanticTokensRegistrationOptions = - { - Legend: SemanticTokensLegend - Range: bool option - Full: U2 option - DocumentSelector: DocumentSelector option - } - -type InlayHintOptions = - { - /// The server provides support to resolve additional information for an inlay hint item. - ResolveProvider: bool option - } - -type InlayHintRegistrationOptions = - { - ResolveProvider: bool option - DocumentSelector: DocumentSelector option - } - -type InlineValueOptions = - { - /// The server provides support to resolve additional information for aniline lay hint item. - ResolveProvider: bool option - } - -type DiagnosticOptions = - { - /// An optional identifier under which the diagnostics are managed by the client. - Identifier: string option - - /// Whether the language has inter file dependencies meaning that editing code in one file can result in a different - /// diagnostic set in another file. Inter file dependencies are common for most programming languages and typically - /// uncommon for linters. - InterFileDependencies: bool - - /// The server provides support for workspace diagnostics as well. - WorkspaceDiagnostics: bool - } - -type WorkspaceFoldersServerCapabilities = - { - /// The server has support for workspace folders. - Supported: bool option - /// Whether the server wants to receive workspace folder change notifications. - ChangeNotifications: U2 option - } - - static member Default = { Supported = None; ChangeNotifications = None } - -module FileOperationPatternKind = - let File = "file" - let Folder = "folder" - -type FileOperationPatternOptions = - { - /// The pattern should be matched ignoring casing. - IgnoreCase: bool option - } - - static member Default = { IgnoreCase = None } - -/// See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#fileOperationPattern. -type FileOperationPattern = - { - Glob: string - /// Whether to match files or folders with this pattern. Matches both if undefined. - /// See FileOperationPatternKind for allowed values - Matches: string option - /// Additional options used during matching - Options: FileOperationPatternOptions option - } - -type FileOperationFilter = - { - /// A Uri like `file` or `untitled`. - Scheme: string option - /// The actual file operation pattern. - Pattern: FileOperationPattern - } - -type FileOperationRegistrationOptions = { Filters: FileOperationFilter[] } - -/// The types of workspace-level file notifications the server is interested in. -type WorkspaceFileOperationsServerCapabilities = - { DidCreate: FileOperationRegistrationOptions option - WillCreate: FileOperationRegistrationOptions option - DidRename: FileOperationRegistrationOptions option - WillRename: FileOperationRegistrationOptions option - DidDelete: FileOperationRegistrationOptions option - WillDelete: FileOperationRegistrationOptions option } - - static member Default = - { DidCreate = None - WillCreate = None - DidRename = None - WillRename = None - DidDelete = None - WillDelete = None } - -type WorkspaceServerCapabilities = - { - /// The server supports workspace folder. - /// @since 3.6.0 - WorkspaceFolders: WorkspaceFoldersServerCapabilities option - /// The server is interested in file notifications/requests. - /// @since 3.16.0 - FileOperations: WorkspaceFileOperationsServerCapabilities option - } - - static member Default = { WorkspaceFolders = None; FileOperations = None } - - -/// RenameOptions may only be specified if the client states that it supports prepareSupport in its -/// initial initialize request. -type RenameOptions = - { - /// Renames should be checked and tested before being executed. - PrepareProvider: bool option - } - -type RenameRegistrationOptions = - { - PrepareProvider: bool option - DocumentSelector: DocumentSelector option - } - -type WorkspaceSymbolOptions = - { - /// The server provides support to resolve additional information for a - /// workspace symbol. - ResolveProvider: bool option - } - -/// A set of predefined position encoding kinds. -/// @since 3.17.0 -module PositionEncodingKind = - /// Character offsets count UTF-8 code units (e.g bytes). - let UTF8 = "utf-8" - /// Character offsets count UTF-16 code units. This is the default and must always be supported by servers. - let UTF16 = "utf-16" - /// Character offsets count UTF-32 code units. - /// - /// Implementation note: these are the same as Unicode code points, - /// so this `PositionEncodingKind` may also be used for an - /// encoding-agnostic representation of character offsets. - let UTF32 = "utf-32" - -type ServerCapabilities = - { - /// The position encoding the server picked from the encodings offered by - /// the client via the client capability `general.positionEncodings`. - /// If the client didn't provide any position encodings the only valid value - /// that a server can return is 'utf-16'. - /// If omitted it defaults to 'utf-16'. - PositionEncoding: PositionEncodingKind option - - /// Defines how text documents are synced. Is either a detailed structure defining each notification or - /// for backwards compatibility the TextDocumentSyncKind number. - TextDocumentSync: TextDocumentSyncOptions option - - /// The server provides hover support. - HoverProvider: bool option - - /// The server provides completion support. - CompletionProvider: CompletionOptions option - - /// The server provides signature help support. - SignatureHelpProvider: SignatureHelpOptions option - - /// The server provides go to declaration support. - DeclarationProvider: bool option - - /// The server provides goto definition support. - DefinitionProvider: bool option - - ///The server provides Goto Implementation support - ImplementationProvider: bool option - - /// The server provides goto type definition support. - TypeDefinitionProvider: bool option - - /// The server provides find references support. - ReferencesProvider: bool option - - /// The server provides document highlight support. - DocumentHighlightProvider: bool option - - /// The server provides document symbol support. - DocumentSymbolProvider: U2 option - - /// The server provides workspace symbol support. - WorkspaceSymbolProvider: U2 option - - /// The server provides code actions. The `CodeActionOptions` return type is - /// only valid if the client signals code action literal support via the - /// property `textDocument.codeAction.codeActionLiteralSupport`. - CodeActionProvider: U2 option - - /// The server provides code lens. - CodeLensProvider: CodeLensOptions option - - /// The server provides document formatting. - DocumentFormattingProvider: bool option - - /// The server provides document range formatting. - DocumentRangeFormattingProvider: bool option - - /// The server provides document formatting on typing. - DocumentOnTypeFormattingProvider: DocumentOnTypeFormattingOptions option - - /// The server provides rename support. RenameOptions may only be specified - /// if the client states that it supports `prepareSupport` in its initial - /// `initialize` request. - RenameProvider: U2 option - - /// The server provides document link support. - DocumentLinkProvider: DocumentLinkOptions option - - /// The server provides color provider support. - ColorProvider: bool option - - /// The server provides execute command support. - ExecuteCommandProvider: ExecuteCommandOptions option - - /// Experimental server capabilities. - Experimental: JToken option - - /// The server provides folding provider support. - /// @since 3.10.0 - FoldingRangeProvider: bool option - - /// The server provides selection range support. - SelectionRangeProvider: bool option - - /// The server provides linked editing range support. - LinkedEditingRangeProvider: bool option - - /// The server provides call hierarchy support. - CallHierarchyProvider: bool option - - /// The server provides semantic tokens support. - SemanticTokensProvider: SemanticTokensOptions option - - /// Whether server provides moniker support. - MonikerProvider: bool option - - /// The server provides type hierarchy support. - TypeHierarchyProvider: bool option - - /// The server provides inlay hints. - InlayHintProvider: InlayHintOptions option - - /// The server provides inline values. - InlineValueProvider: InlineValueOptions option - - /// The server has support for pull model diagnostics. - DiagnosticProvider: DiagnosticOptions option - - /// Workspace specific server capabilities. - Workspace: WorkspaceServerCapabilities option - } - - static member Default = - { PositionEncoding = None - TextDocumentSync = None - HoverProvider = None - CompletionProvider = None - SignatureHelpProvider = None - DeclarationProvider = None - DefinitionProvider = None - TypeDefinitionProvider = None - ImplementationProvider = None - ReferencesProvider = None - DocumentHighlightProvider = None - DocumentSymbolProvider = None - WorkspaceSymbolProvider = None - CodeActionProvider = None - CodeLensProvider = None - DocumentFormattingProvider = None - DocumentRangeFormattingProvider = None - DocumentOnTypeFormattingProvider = None - RenameProvider = None - DocumentLinkProvider = None - ColorProvider = None - ExecuteCommandProvider = None - Experimental = None - FoldingRangeProvider = None - SelectionRangeProvider = None - LinkedEditingRangeProvider = None - CallHierarchyProvider = None - SemanticTokensProvider = None - MonikerProvider = None - TypeHierarchyProvider = None - InlayHintProvider = None - InlineValueProvider = None - DiagnosticProvider = None - Workspace = None } - -type ServerInfo = - { - /// The name of the server as defined by the server. - Name: string - /// The server's version as defined by the server. - Version: string option - } - -type InitializeResult = - { - /// The capabilities the language server provides. - Capabilities: ServerCapabilities - - /// Information about the server. - ServerInfo: ServerInfo option - } - - static member Default = { Capabilities = ServerCapabilities.Default; ServerInfo = None } - -/// A workspace edit represents changes to many resources managed in the workspace. -/// The edit should either provide `changes` or `documentChanges`. If the client can handle versioned document -/// edits and if `documentChanges` are present, the latter are preferred over `changes`. -type WorkspaceEdit = - { - /// Holds changes to existing resources. - Changes: Map option - - /// An array of `TextDocumentEdit`s to express changes to n different text documents - /// where each text document edit addresses a specific version of a text document. - /// Whether a client supports versioned document edits is expressed via - /// `WorkspaceClientCapabilities.workspaceEdit.documentChanges`. - DocumentChanges: TextDocumentEdit[] option - } - - static member DocumentChangesToChanges(edits: TextDocumentEdit[]) = - edits - |> Array.map (fun edit -> edit.TextDocument.Uri.ToString(), edit.Edits) - |> Map.ofArray - - static member CanUseDocumentChanges(capabilities: ClientCapabilities) = - (capabilities.Workspace - |> Option.bind (fun x -> x.WorkspaceEdit) - |> Option.bind (fun x -> x.DocumentChanges)) = Some true - - static member Create(edits: TextDocumentEdit[], capabilities: ClientCapabilities) = - if WorkspaceEdit.CanUseDocumentChanges(capabilities) then - { Changes = None; DocumentChanges = Some edits } - else - { Changes = Some(WorkspaceEdit.DocumentChangesToChanges edits) - DocumentChanges = None } - -type MessageType = - | Error = 1 - | Warning = 2 - | Info = 3 - | Log = 4 - -type LogMessageParams = { Type: MessageType; Message: string } - -type ShowMessageParams = { Type: MessageType; Message: string } - -type MessageActionItem = - { - /// A short title like 'Retry', 'Open Log' etc. - Title: string - } - -type ShowMessageRequestParams = - { - /// The message type. - Type: MessageType - - /// The actual message - Message: string - - /// The message action items to present. - Actions: MessageActionItem[] option - } - -type ShowDocumentParams = - { - /// The uri to show. - Uri: DocumentUri - - /// Indicates to show the resource in an external program. To show, for - /// example, `https://code.visualstudio.com/` in the default WEB browser set - /// `external` to `true`. - External: bool option - - /// An optional property to indicate whether the editor showing the document - /// should take focus or not. Clients might ignore this property if an - /// external program is started. - TakeFocus: bool option - - /// An optional selection range if the document is a text document. Clients - /// might ignore the property if an external program is started or the file - /// is not a text file. - Selection: Range option - } - -type ShowDocumentResult = - { - /// A boolean indicating if the show was successful. - Success: bool - } - -/// General parameters to register for a capability. -type Registration = - { - /// The id used to register the request. The id can be used to deregister - /// the request again. - Id: string - - /// The method / capability to register for. - Method: string - - /// Options necessary for the registration. - RegisterOptions: JToken option - } - -type RegistrationParams = { Registrations: Registration[] } - -type ITextDocumentRegistrationOptions = - /// A document selector to identify the scope of the registration. If set to null - /// the document selector provided on the client side will be used. - abstract member DocumentSelector: DocumentSelector option - -/// General parameters to unregister a capability. -type Unregistration = - { - /// The id used to unregister the request or notification. Usually an id - /// provided during the register request. - Id: string - - /// The method / capability to unregister for. - Method: string - } - -type UnregistrationParams = { Unregisterations: Unregistration[] } - -type FileChangeType = - | Created = 1 - | Changed = 2 - | Deleted = 3 - -/// An event describing a file change. -type FileEvent = - { - /// The file's URI. - Uri: DocumentUri - - /// The change type. - Type: FileChangeType - } - -type DidChangeWatchedFilesParams = - { - /// The actual file events. - Changes: FileEvent[] - } - -/// The workspace folder change event. -type WorkspaceFoldersChangeEvent = - { - /// The array of added workspace folders - Added: WorkspaceFolder[] - - /// The array of the removed workspace folders - Removed: WorkspaceFolder[] - } - -type DidChangeWorkspaceFoldersParams = - { - /// The actual workspace folder change event. - Event: WorkspaceFoldersChangeEvent - } - -type DidChangeConfigurationParams = - { - /// The actual changed settings - Settings: JToken - } - -type ConfigurationItem = - { - /// The scope to get the configuration section for. - ScopeUri: string option - - /// The configuration section asked for. - Section: string option - } - -type ConfigurationParams = { items: ConfigurationItem[] } - -/// The parameters of a Workspace Symbol Request. -type WorkspaceSymbolParams = - { - /// A query string to filter symbols by. Clients may send an empty string - /// here to request all symbols. - Query: string - } - -type ExecuteCommandParams = - { - /// The identifier of the actual command handler. - Command: string - /// Arguments that the command should be invoked with. - Arguments: JToken[] option - } - -type ApplyWorkspaceEditParams = - { - /// An optional label of the workspace edit. This label is - /// presented in the user interface for example on an undo - /// stack to undo the workspace edit. - Label: string option - - /// The edits to apply. - Edit: WorkspaceEdit - } - -type ApplyWorkspaceEditResponse = - { - /// Indicates whether the edit was applied or not. - Applied: bool - - /// An optional textual description for why the edit was not applied. This - /// may be used by the server for diagnostic logging or to provide a - /// suitable error for a request that triggered the edit. - FailureReason: string option - - /// Depending on the client's failure handling strategy `failedChange` might - /// contain the index of the change that failed. This property is only - /// available if the client signals a `failureHandling` strategy in its - /// client capabilities. - FailedChange: uint - } - -/// Represents reasons why a text document is saved. -type TextDocumentSaveReason = - /// Manually triggered, e.g. by the user pressing save, by starting debugging, - /// or by an API call. - | Manual = 1 - /// Automatic after a delay. - | AfterDelay = 2 - /// When the editor lost focus. - | FocusOut = 3 - -/// The parameters send in a will save text document notification. -type WillSaveTextDocumentParams = - { - /// The document that will be saved. - TextDocument: TextDocumentIdentifier - - /// The 'TextDocumentSaveReason'. - Reason: TextDocumentSaveReason - } - -type DidSaveTextDocumentParams = - { - /// The document that was saved. - TextDocument: TextDocumentIdentifier - - /// Optional the content when saved. Depends on the includeText value - /// when the save notification was requested. - Text: string option - } - -type DidCloseTextDocumentParams = - { - /// The document that was closed. - TextDocument: TextDocumentIdentifier - } - -/// Value-object describing what options formatting should use. -type FormattingOptions = - { - /// Size of a tab in spaces. - TabSize: int - /// Prefer spaces over tabs. - InsertSpaces: bool - /// Trim trailing whitespace on a line. - /// - /// @since 3.15.0 - TrimTrailingWhitespace: bool option - /// Insert a newline character at the end of the file if one does not exist. - /// - /// @since 3.15.0 - InsertFinalNewline: bool option - /// Trim all newlines after the final newline at the end of the file. - /// - /// @since 3.15.0 - TrimFinalNewlines: bool option - /// Signature for further properties. - [] - mutable AdditionalData: IDictionary - } - - [] - member o.OnDeserialized(context: StreamingContext) = - if isNull o.AdditionalData then - o.AdditionalData <- Map.empty - -type DocumentFormattingParams = - { - /// The document to format. - TextDocument: TextDocumentIdentifier - - /// The format options. - Options: FormattingOptions - } - -type DocumentRangeFormattingParams = - { - /// The document to format. - TextDocument: TextDocumentIdentifier - - /// The range to format - Range: Range - - /// The format options - Options: FormattingOptions - } - -type DocumentOnTypeFormattingParams = - { - /// The document to format. - TextDocument: TextDocumentIdentifier - - /// The position at which this request was sent. - Position: Position - - /// The character that has been typed. - Ch: char - - /// The format options. - Options: FormattingOptions - } - -type DocumentSymbolParams = - { - /// The text document. - TextDocument: TextDocumentIdentifier - } - -type ITextDocumentPositionParams = - /// The text document. - abstract member TextDocument: TextDocumentIdentifier - /// The position inside the text document. - abstract member Position: Position - -type TextDocumentPositionParams = - { - /// The text document. - TextDocument: TextDocumentIdentifier - /// The position inside the text document. - Position: Position - } - - interface ITextDocumentPositionParams with - member this.TextDocument = this.TextDocument - member this.Position = this.Position - -type ReferenceContext = - { - /// Include the declaration of the current symbol. - IncludeDeclaration: bool - } - -type ReferenceParams = - { - /// The text document. - TextDocument: TextDocumentIdentifier - /// The position inside the text document. - Position: Position - Context: ReferenceContext - } - - interface ITextDocumentPositionParams with - member this.TextDocument = this.TextDocument - member this.Position = this.Position - -/// A `MarkupContent` literal represents a string value which content is interpreted base on its -/// kind flag. Currently the protocol supports `plaintext` and `markdown` as markup kinds. -/// -/// If the kind is `markdown` then the value can contain fenced code blocks like in GitHub issues. -/// See https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting -/// -/// Here is an example how such a string can be constructed using JavaScript / TypeScript: -/// ```ts -/// let markdown: MarkdownContent = { -/// kind: MarkupKind.Markdown, -/// value: [ -/// '# Header', -/// 'Some text', -/// '```typescript', -/// 'someCode();', -/// '```' -/// ].join('\n') -/// }; -/// ``` -/// -/// *Please Note* that clients might sanitize the return markdown. A client could decide to -/// remove HTML from the markdown to avoid script execution. -type MarkupContent = - { - /// The type of the Markup - Kind: string - - // The content itself - Value: string - } - -type MarkedStringData = { Language: string; Value: string } - -/// -/// MarkedString can be used to render human readable text. It is either a -/// markdown string or a code-block that provides a language and a code snippet. -/// The language identifier is semantically equal to the optional language -/// identifier in fenced code blocks in GitHub issues. -/// -/// The pair of a language and a value is an equivalent to markdown: -/// -/// ```${language} -/// ${value} -/// ``` -/// -/// -/// Note that markdown strings will be sanitized - that means html will be -/// escaped. -/// -/// Deprecated: Use MarkupContent instead -/// -[] -[] -type MarkedString = - | String of string - | WithLanguage of MarkedStringData - -let plaintext s = { Kind = MarkupKind.PlainText; Value = s } -let markdown s = { Kind = MarkupKind.Markdown; Value = s } - -[] -type HoverContent = - | MarkedString of MarkedString - | MarkedStrings of MarkedString[] - | MarkupContent of MarkupContent - -/// The result of a hover request. -type Hover = - { - /// The hover's content - Contents: HoverContent - - /// An optional range is a range inside a text document - /// that is used to visualize a hover, e.g. by changing the background color. - Range: Range option - } - -/// An item to transfer a text document from the client to the server. -type TextDocumentItem = - { - /// The text document's URI. - Uri: DocumentUri - - /// The text document's language identifier. - LanguageId: string - - /// The version number of this document (it will increase after each - /// change, including undo/redo). - Version: int - - /// The content of the opened text document. - Text: string - } - -type DidOpenTextDocumentParams = - { - /// The document that was opened. - TextDocument: TextDocumentItem - } - -/// An event describing a change to a text document. If range and rangeLength are omitted -/// the new text is considered to be the full content of the document. -type TextDocumentContentChangeEvent = - { - /// The range of the document that changed. - Range: Range option - - /// The length of the range that got replaced. - /// - /// Deprecated: Use Range instead - RangeLength: int option - - /// The new text of the range/document. - Text: string - } - -type DidChangeTextDocumentParams = - { - /// The document that did change. The version number points - /// to the version after all provided content changes have - /// been applied. - TextDocument: VersionedTextDocumentIdentifier - - /// The actual content changes. The content changes describe single state changes - /// to the document. So if there are two content changes c1 and c2 for a document - /// in state S10 then c1 move the document to S11 and c2 to S12. - ContentChanges: TextDocumentContentChangeEvent[] - } - -[] -type WatchKind = - | Create = 1 - | Change = 2 - | Delete = 4 - -type RelativePattern = - { - /// A workspace folder or a base URI to which this pattern will be matched - /// against relatively. - BaseUri: U2 - - /// The actual glob pattern; - Pattern: string - } - -type GlobPattern = U2 - -type FileSystemWatcher = - { - /// The glob pattern to watch - GlobPattern: GlobPattern - - /// The kind of events of interest. If omitted it defaults - /// to WatchKind.Create | WatchKind.Change | WatchKind.Delete - /// which is 7. - Kind: WatchKind option - } - -/// Describe options to be used when registered for text document change events. -type DidChangeWatchedFilesRegistrationOptions = - { - /// The watchers to register. - Watchers: FileSystemWatcher[] - } - -/// How a completion was triggered -type CompletionTriggerKind = - /// Completion was triggered by typing an identifier (24x7 code - /// complete), manual invocation (e.g Ctrl+Space) or via API. - | Invoked = 1 - /// Completion was triggered by a trigger character specified by - /// the `triggerCharacters` properties of the `CompletionRegistrationOptions`. - | TriggerCharacter = 2 - /// Completion was re-triggered as the current completion list is incomplete. - | TriggerForIncompleteCompletions = 3 - -type CompletionContext = - { - /// How the completion was triggered. - TriggerKind: CompletionTriggerKind - - /// The trigger character (a single character) that has trigger code complete. - /// Is undefined if `triggerKind !== CompletionTriggerKind.TriggerCharacter` - TriggerCharacter: char option - } - -type CompletionParams = - { - /// The text document. - TextDocument: TextDocumentIdentifier - - /// The position inside the text document. - Position: Position - - /// The completion context. This is only available it the client specifies - /// to send this using `ClientCapabilities.textDocument.completion.contextSupport === true` - Context: CompletionContext option - } - - interface ITextDocumentPositionParams with - member this.TextDocument = this.TextDocument - member this.Position = this.Position - -/// Represents a reference to a command. Provides a title which will be used to represent a command in the UI. -/// Commands are identified by a string identifier. The protocol currently doesn't specify a set of well-known -/// commands. So executing a command requires some tool extension code. -type Command = - { - /// Title of the command, like `save`. - Title: string - - /// The identifier of the actual command handler. - Command: string - - /// Arguments that the command handler should be - /// invoked with. - Arguments: JToken[] option - } - -type CompletionItemLabelDetails = - { - /// An optional string which is rendered less prominently directly after - /// label, without any spacing. Should be used - /// for function signatures or type annotations. - Detail: string option - - /// An optional string which is rendered less prominently after - /// . Should be used for fully - /// qualified names or file path. - Description: string option - } - -type InsertReplaceEdit = - { - /// The string to be inserted. - NewText: string - - /// The range if the insert is requested - Insert: Range - - /// The range if the replace is requested. - Replace: Range - } - -/// Defines whether the insert text in a completion item should be interpreted as -/// plain text or a snippet. -type InsertTextFormat = - /// The primary text to be inserted is treated as a plain string. - | PlainText = 1 - /// The primary text to be inserted is treated as a snippet. - /// - /// A snippet can define tab stops and placeholders with `$1`, `$2` - /// and `${3:foo}`. `$0` defines the final tab stop, it defaults to - /// the end of the snippet. Placeholders with equal identifiers are linked, - /// that is typing in one will update others too. - | Snippet = 2 - -[] -[] -type Documentation = - | String of string - | Markup of MarkupContent - -type CompletionItem = - { - /// The label of this completion item. By default - /// also the text that is inserted when selecting - /// this completion. - Label: string - - /// Additional details for the label - LabelDetails: CompletionItemLabelDetails option - - /// The kind of this completion item. Based of the kind - /// an icon is chosen by the editor. - Kind: CompletionItemKind option - - /// Tags for this completion item. - Tags: CompletionItemTag[] option - - /// A human-readable string with additional information - /// about this item, like type or symbol information. - Detail: string option - - /// A human-readable string that represents a doc-comment. - Documentation: Documentation option - - /// Indicates if this item is deprecated. - /// - /// Deprecated: Use Tags instead if supported - Deprecated: bool option - - /// Select this item when showing. - /// *Note* that only one completion item can be selected and that the - /// tool / client decides which item that is. The rule is that the *first* - /// item of those that match best is selected. - Preselect: bool option - - /// A string that should be used when comparing this item - /// with other items. When `falsy` the label is used. - SortText: string option - - /// A string that should be used when filtering a set of - /// completion items. When `falsy` the label is used. - FilterText: string option - - /// A string that should be inserted into a document when selecting - /// this completion. When `falsy` the label is used. - /// - /// The `insertText` is subject to interpretation by the client side. - /// Some tools might not take the string literally. For example - /// VS Code when code complete is requested in this example `con` - /// and a completion item with an `insertText` of `console` is provided it - /// will only insert `sole`. Therefore it is recommended to use `textEdit` instead - /// since it avoids additional client side interpretation. - /// - /// Deprecated: Use TextEdit instead - InsertText: string option - - /// The format of the insert text. The format applies to both the `insertText` property - /// and the `newText` property of a provided `textEdit`. - InsertTextFormat: InsertTextFormat option - - /// How whitespace and indentation is handled during completion item - /// insertion. If not provided the client's default value depends on the - /// `textDocument.completion.insertTextMode` client capability. - InsertTextMode: InsertTextMode option - - /// An edit which is applied to a document when selecting this completion. When an edit is provided the value of - /// `insertText` is ignored. - /// - /// *Note:* The range of the edit must be a single line range and it must contain the position at which completion - /// has been requested. - TextEdit: U2 option - - // The edit text used if the completion item is part of a CompletionList and - /// CompletionList defines an item default for the text edit range. - /// Clients will only honor this property if they opt into completion list - /// item defaults using the capability `completionList.itemDefaults`. - /// If not provided and a list's default range is provided the label - /// property is used as a text. - TextEditText: string option - - /// An optional array of additional text edits that are applied when - /// selecting this completion. Edits must not overlap with the main edit - /// nor with themselves. - AdditionalTextEdits: TextEdit[] option - - /// An optional set of characters that when pressed while this completion is active will accept it first and - /// then type that character. *Note* that all commit characters should have `length=1` and that superfluous - /// characters will be ignored. - CommitCharacters: char[] option - - /// An optional command that is executed *after* inserting this completion. *Note* that - /// additional modifications to the current document should be described with the - /// additionalTextEdits-property. - Command: Command option - - /// An data entry field that is preserved on a completion item between - /// a completion and a completion resolve request. - Data: JToken option - } - - static member Create(label: string) = - { Label = label - LabelDetails = None - Kind = None - Tags = None - Detail = None - Documentation = None - Deprecated = None - Preselect = None - SortText = None - FilterText = None - InsertText = None - InsertTextFormat = None - InsertTextMode = None - TextEdit = None - TextEditText = None - AdditionalTextEdits = None - CommitCharacters = None - Command = None - Data = None } - -type ReplaceEditRange = { Insert: Range; Replace: Range } - -type ItemDefaults = - { - /// A default commit character set. - CommitCharacters: char[] option - - /// A default edit range - EditRange: U2 option - - /// A default insert text format - InsertTextFormat: InsertTextFormat option - - /// A default insert text mode - InsertTextMode: InsertTextMode option - - /// A default data value. - Data: LSPAny option - } - -type CompletionList = - { - /// This list it not complete. Further typing should result in recomputing - /// this list. - IsIncomplete: bool - - /// In many cases the items of an actual completion result share the same - /// value for properties like `commitCharacters` or the range of a text - /// edit. A completion list can therefore define item defaults which will be - /// used if a completion item itself doesn't specify the value. - /// If a completion list specifies a default value and a completion item - /// also specifies a corresponding value the one from the item is used. - /// Servers are only allowed to return default values if the client signals - /// support for this via the `completionList.itemDefaults` capability. - ItemDefaults: ItemDefaults option - - /// The completion items. - Items: CompletionItem[] - } - -[] -[] -type DiagnosticCode = - | Number of int - | String of string - -[] -type DiagnosticSeverity = - /// Reports an error. - | Error = 1 - /// Reports a warning. - | Warning = 2 - /// Reports an information. - | Information = 3 - /// Reports a hint. - | Hint = 4 - -/// Represents a related message and source code location for a diagnostic. This should be -/// used to point to code locations that cause or related to a diagnostics, e.g when duplicating -/// a symbol in a scope. -type DiagnosticRelatedInformation = { Location: Location; Message: string } - -// Structure to capture a description for an error code. -type CodeDescription = - { - // An URI to open with more information about the diagnostic error. - Href: Uri option } - -/// Represents a diagnostic, such as a compiler error or warning. Diagnostic objects are only valid in the -/// scope of a resource. -[] -type Diagnostic = - { - /// The range at which the message applies. - Range: Range - - /// The diagnostic's severity. Can be omitted. If omitted it is up to the - /// client to interpret diagnostics as error, warning, info or hint. - Severity: DiagnosticSeverity option - - /// The diagnostic's code. Can be omitted. - Code: string option - /// An optional property to describe the error code. - CodeDescription: CodeDescription option - - /// A human-readable string describing the source of this - /// diagnostic, e.g. 'typescript' or 'super lint'. - Source: string option - - /// The diagnostic's message. - Message: string - RelatedInformation: DiagnosticRelatedInformation[] option - Tags: DiagnosticTag[] option - /// A data entry field that is preserved between a - /// `textDocument/publishDiagnostics` notification and - /// `textDocument/codeAction` request. - Data: JToken option - } - - [] - member x.DebuggerDisplay = - $"[{defaultArg x.Severity DiagnosticSeverity.Error}] ({x.Range.DebuggerDisplay}) {x.Message} ({defaultArg x.Code String.Empty})" - -type PublishDiagnosticsParams = - { - /// The URI for which diagnostic information is reported. - Uri: DocumentUri - - /// Optional the version number of the document the diagnostics are published - /// for. - Version: int option - - /// An array of diagnostic information items. - Diagnostics: Diagnostic[] - } - - -type DocumentDiagnosticParams = - { - /// The text document. - TextDocument: TextDocumentIdentifier - - /// The additional identifier provided during registration. - Identifier: string option - - /// The result id of a previous response if provided. - PreviousResultId: string option - } - -module DocumentDiagnosticReportKind = - /// A diagnostic report with a full set of problems. - let Full = "full" - /// A report indicating that the last returned report is still accurate. - let Unchanged = "unchanged" - -type FullDocumentDiagnosticReport = - { - /// A full document diagnostic report. - Kind: string - - /// An optional result id. If provided it will be sent on the next - /// diagnostic request for the same document. - ResultId: string option - - /// The actual items. - Items: Diagnostic[] - } - -type UnchangedDocumentDiagnosticReport = - { - /// A document diagnostic report indicating no changes to the last result. - /// A server can only return `unchanged` if result ids are provided. - Kind: string - - /// A result id which will be sent on the next diagnostic request for the - /// same document. - ResultId: string - } - -type RelatedFullDocumentDiagnosticReport = - { - /// A full document diagnostic report. - Kind: string - - /// An optional result id. If provided it will be sent on the next - /// diagnostic request for the same document. - ResultId: string option - - /// The actual items. - Items: Diagnostic[] - - /// Diagnostics of related documents. This information is useful in - /// programming languages where code in a file A can generate diagnostics in - /// a file B which A depends on. An example of such a language is C/C++ - /// where marco definitions in a file a.cpp and result in errors in a header - /// file b.hpp. - RelatedDocuments: Map> option - } - -type RelatedUnchangedDocumentDiagnosticReport = - { - /// A document diagnostic report indicating no changes to the last result. - /// A server can only return `unchanged` if result ids are provided. - Kind: string - - /// A result id which will be sent on the next diagnostic request for the - /// same document. - ResultId: string - - /// Diagnostics of related documents. This information is useful in - /// programming languages where code in a file A can generate diagnostics in - /// a file B which A depends on. An example of such a language is C/C++ - /// where marco definitions in a file a.cpp and result in errors in a header - /// file b.hpp. - RelatedDocuments: Map> option - } - -type DocumentDiagnosticReport = - | RelatedFullDocumentDiagnosticReport of RelatedFullDocumentDiagnosticReport - | RelatedUnchangedDocumentDiagnosticReport of RelatedUnchangedDocumentDiagnosticReport - -type PreviousResultId = - { - /// The URI for which the client knows a result id. - Uri: DocumentUri - - /// The value of the previous result id. - Value: string - } - -type WorkspaceDiagnosticParams = - { - /// The additional identifier provided during registration. - Identifier: string option - - /// The currently known diagnostic reports with their previous result ids. - PreviousResultIds: PreviousResultId[] - } - -type WorkspaceFullDocumentDiagnosticReport = - { - /// A full document diagnostic report. - Kind: string - - /// An optional result id. If provided it will be sent on the next - /// diagnostic request for the same document. - ResultId: string option - - /// The actual items. - Items: Diagnostic[] - - /// The URI for which diagnostic information is reported. - Uri: DocumentUri - - /// The version number for which the diagnostics are reported. If the - /// document is not marked as open `null` can be provided. - Version: int option - } - -type WorkspaceUnchangedDocumentDiagnosticReport = - { - /// A document diagnostic report indicating no changes to the last result. - /// A server can only return `unchanged` if result ids are provided. - Kind: string - - /// A result id which will be sent on the next diagnostic request for the - /// same document. - ResultId: string - - /// The URI for which diagnostic information is reported. - Uri: DocumentUri - - /// The version number for which the diagnostics are reported. If the - /// document is not marked as open `null` can be provided. - Version: int option - } - -type WorkspaceDocumentDiagnosticReport = - | WorkspaceFullDocumentDiagnosticReport of WorkspaceFullDocumentDiagnosticReport - | WorkspaceUnchangedDocumentDiagnosticReport of WorkspaceUnchangedDocumentDiagnosticReport - -type WorkspaceDiagnosticReport = { Items: WorkspaceDocumentDiagnosticReport[] } - - -type CodeActionDisabled = - { - /// Human readable description of why the code action is currently - /// disabled. - /// - /// This is displayed in the code actions UI. - Reason: string - } - -/// A code action represents a change that can be performed in code, e.g. to fix a problem or -/// to refactor code. -/// -/// A CodeAction must set either `edit` and/or a `command`. If both are supplied, the `edit` is applied first, then the `command` is executed. -type CodeAction = - { - - /// A short, human-readable, title for this code action. - Title: string - - /// The kind of the code action. - /// Used to filter code actions. - Kind: string option - - /// The diagnostics that this code action resolves. - Diagnostics: Diagnostic[] option - - /// Marks this as a preferred action. Preferred actions are used by the - /// `auto fix` command and can be targeted by keybindings. - /// - /// * A quick fix should be marked preferred if it properly addresses the - /// underlying error. A refactoring should be marked preferred if it is the - /// most reasonable choice of actions to take. - /// - /// * @since 3.15.0 - IsPreferred: bool option - - /// Marks that the code action cannot currently be applied. - /// - /// Clients should follow the following guidelines regarding disabled code - /// actions: - /// - /// - Disabled code actions are not shown in automatic lightbulbs code - /// action menus. - /// - /// - Disabled actions are shown as faded out in the code action menu when - /// the user request a more specific type of code action, such as - /// refactorings. - /// - /// - If the user has a keybinding that auto applies a code action and only - /// a disabled code actions are returned, the client should show the user - /// an error message with `reason` in the editor. - /// - /// @since 3.16.0 - Disabled: CodeActionDisabled option - - /// The workspace edit this code action performs. - Edit: WorkspaceEdit option - - /// A command this code action executes. If a code action - /// provides an edit and a command, first the edit is - /// executed and then the command. - Command: Command option - - /// A data entry field that is preserved on a code action between - /// a `textDocument/codeAction` and a `codeAction/resolve` request. - Data: JToken option - } - -type TextDocumentCodeActionResult = U2[] - -type RenameParams = - { - /// The document to rename. - TextDocument: TextDocumentIdentifier - - /// The position at which this request was sent. - Position: Position - - /// The new name of the symbol. If the given name is not valid the - /// request must return a **ResponseError** with an - /// appropriate message set. - NewName: string - } - - interface ITextDocumentPositionParams with - member this.TextDocument = this.TextDocument - member this.Position = this.Position - -type PrepareRenameParams = - { - /// The document to rename. - TextDocument: TextDocumentIdentifier - - /// The position at which this request was sent. - Position: Position - } - - interface ITextDocumentPositionParams with - member this.TextDocument = this.TextDocument - member this.Position = this.Position - -type DefaultBehavior = { DefaultBehavior: bool } - -type RangeWithPlaceholder = { Range: Range; Placeholder: string } - -[] -[] -type PrepareRenameResult = - /// A range of the string to rename. - | Range of Range - /// A range of the string to rename and a placeholder text of the string content to be renamed. - | RangeWithPlaceholder of RangeWithPlaceholder - /// The rename position is valid and the client should use its default behavior to compute the rename range. - | Default of DefaultBehavior - -type LinkedEditingRanges = - { - /// A list of ranges that can be renamed together. The ranges must have - /// identical length and contain identical text content. The ranges cannot - /// overlap. - Ranges: Range[] - - /// An optional word pattern (regular expression) that describes valid - /// contents for the given ranges. If no pattern is provided, the client - /// configuration's word pattern will be used. - WordPattern: string option - } - -[] -[] -type GotoResult = - | Single of Location - | Multiple of Location[] - -/// A document highlight kind. -[] -type DocumentHighlightKind = - /// A textual occurrence. - | Text = 1 - /// Read-access of a symbol, like reading a variable. - | Read = 2 - /// Write-access of a symbol, like writing to a variable. - | Write = 3 - -/// A document highlight is a range inside a text document which deserves -/// special attention. Usually a document highlight is visualized by changing -/// the background color of its range. -type DocumentHighlight = - { - /// The range this highlight applies to. - Range: Range - - /// The highlight kind, default is DocumentHighlightKind.Text. - Kind: DocumentHighlightKind option - } - -type DocumentLinkParams = - { - /// The document to provide document links for. - TextDocument: TextDocumentIdentifier - } - -/// A document link is a range in a text document that links to an internal or external resource, like another -/// text document or a web site. -type DocumentLink = - { - /// The range this link applies to. - Range: Range - - /// The uri this link points to. If missing a resolve request is sent later. - Target: DocumentUri option - - /// The tooltip text when you hover over this link. - /// If a tooltip is provided, is will be displayed in a string that includes - /// instructions on how to trigger the link, such as `{0} (ctrl + click)`. - /// The specific instructions vary depending on OS, user settings, and - /// localization. - Tooltip: string option - - /// A data entry field that is preserved on a document link between a - /// DocumentLinkRequest and a DocumentLinkResolveRequest. - Data: JToken option - } - -type DocumentColorParams = - { - /// The text document. - TextDocument: TextDocumentIdentifier - } - -/// Represents a color in RGBA space. -type Color = - { - /// The red component of this color in the range [0-1]. - Red: float - - /// The green component of this color in the range [0-1]. - Green: float - - /// The blue component of this color in the range [0-1]. - Blue: float - - /// The alpha component of this color in the range [0-1]. - Alpha: float - } - -type ColorInformation = - { - /// The range in the document where this color appears. - Range: Range - - /// The actual color value for this color range. - Color: Color - } - -type ColorPresentationParams = - { - /// The text document. - TextDocument: TextDocumentIdentifier - - /// The color information to request presentations for. - ColorInfo: Color - - /// The range where the color would be inserted. Serves as a context. - Range: Range - } - -type ColorPresentation = - { - /// The label of this color presentation. It will be shown on the color - /// picker header. By default this is also the text that is inserted when selecting - /// this color presentation. - Label: string - - /// An edit which is applied to a document when selecting - /// this presentation for the color. When `falsy` the label - /// is used. - TextEdit: TextEdit option - - /// An optional array of additional text edits that are applied when - /// selecting this color presentation. Edits must not overlap with the main edit nor with themselves. - AdditionalTextEdits: TextEdit[] option - } - -type CodeActionKind = string - -type CodeActionTriggerKind = - /// Code actions were explicitly requested by the user or by an extension. - | Invoked = 1 - /// Code actions were requested automatically. - /// This typically happens when current selection in a file changes, but can also be triggered when file content changes. - | Automatic = 2 - -/// Contains additional diagnostic information about the context in which -/// a code action is run. -type CodeActionContext = - { - /// An array of diagnostics. - Diagnostics: Diagnostic[] - /// Requested kind of actions to return. - /// Actions not of this kind are filtered out by the client before being - /// shown. So servers can omit computing them. - Only: CodeActionKind[] option - /// The reason why code actions were requested. - /// @since 3.17.0 - TriggerKind: CodeActionTriggerKind option - } - -/// Params for the CodeActionRequest -type CodeActionParams = - { - /// The document in which the command was invoked. - TextDocument: TextDocumentIdentifier - - /// The range for which the command was invoked. - Range: Range - - /// Context carrying additional information. - Context: CodeActionContext - } - -type CodeActionRegistrationOptions = - { - CodeActionKinds: CodeActionKind [] option - ResolveProvider: bool option - DocumentSelector: DocumentSelector option - } - -type CodeLensParams = - { - /// The document to request code lens for. - TextDocument: TextDocumentIdentifier - } - -/// A code lens represents a command that should be shown along with -/// source text, like the number of references, a way to run tests, etc. -/// -/// A code lens is _unresolved_ when no command is associated to it. For performance -/// reasons the creation of a code lens and resolving should be done in two stages. -type CodeLens = - { - /// The range in which this code lens is valid. Should only span a single line. - Range: Range - - /// The command this code lens represents. - Command: Command option - - /// A data entry field that is preserved on a code lens item between - /// a code lens and a code lens resolve request. - Data: JToken option - } - -/// Represents a parameter of a callable-signature. A parameter can -/// have a label and a doc-comment. -type ParameterInformation = - { - /// The label of this parameter information. - /// Either a string or an inclusive start and exclusive end offsets within - /// its containing signature label. (see SignatureInformation.label). The - /// offsets are based on a UTF-16 string representation as `Position` and - /// `Range` does. - /// *Note*: a label of type string should be a substring of its containing - /// signature label. Its intended use case is to highlight the parameter - /// label part in the `SignatureInformation.label`. - Label: U2 - - /// The human-readable doc-comment of this parameter. Will be shown - /// in the UI but can be omitted. - Documentation: Documentation option - } - -///Represents the signature of something callable. A signature -/// can have a label, like a function-name, a doc-comment, and -/// a set of parameters. -type SignatureInformation = - { - /// The label of this signature. Will be shown in - /// the UI. - Label: string - - /// The human-readable doc-comment of this signature. Will be shown - /// in the UI but can be omitted. - Documentation: Documentation option - - /// The parameters of this signature. - Parameters: ParameterInformation[] option - - /// The index of the active parameter. - /// If provided, this is used in place of `SignatureHelp.activeParameter`. - ActiveParameter: uint option - } - -/// Signature help represents the signature of something -/// callable. There can be multiple signature but only one -/// active and only one active parameter. -type SignatureHelp = - { - /// One or more signatures. - Signatures: SignatureInformation[] - - /// The active signature. If omitted or the value lies outside the - /// range of `signatures` the value defaults to zero or is ignored if - /// `signatures.length === 0`. Whenever possible implementors should - /// make an active decision about the active signature and shouldn't - /// rely on a default value. - /// In future version of the protocol this property might become - /// mandatory to better express this. - ActiveSignature: int option - - /// The active parameter of the active signature. If omitted or the value - /// lies outside the range of `signatures[activeSignature].parameters` - /// defaults to 0 if the active signature has parameters. If - /// the active signature has no parameters it is ignored. - /// In future version of the protocol this property might become - /// mandatory to better express the active parameter if the - /// active signature does have any. - ActiveParameter: uint option - } - -type SignatureHelpTriggerKind = - /// manually invoked via command - | Invoked = 1 - /// trigger by a configured trigger character - | TriggerCharacter = 2 - /// triggered by cursor movement or document content changing - | ContentChange = 3 - -type SignatureHelpContext = - { - /// action that caused signature help to be triggered - TriggerKind: SignatureHelpTriggerKind - /// character that caused signature help to be triggered. None when kind is not TriggerCharacter. - TriggerCharacter: char option - /// true if signature help was already showing when this was triggered - IsRetrigger: bool - /// the current active SignatureHelp - ActiveSignatureHelp: SignatureHelp option - - } - -type SignatureHelpParams = - { - /// the text document - TextDocument: TextDocumentIdentifier - /// the position inside the text document - Position: Position - /// Additional information about the context in which a signature help request was triggered. - Context: SignatureHelpContext option - } - - interface ITextDocumentPositionParams with - member this.TextDocument = this.TextDocument - member this.Position = this.Position - -type FoldingRangeParams = - { - /// the document to generate ranges for - TextDocument: TextDocumentIdentifier - } - -module FoldingRangeKind = - let Comment = "comment" - let Imports = "imports" - let Region = "region" - -type FoldingRange = - { - /// The zero-based line number from where the folded range starts. - StartLine: int - - /// The zero-based character offset from where the folded range starts. If not defined, defaults to the length of the start line. - StartCharacter: int option - - /// The zero-based line number where the folded range ends. - EndLine: int - - /// The zero-based character offset before the folded range ends. If not defined, defaults to the length of the end line. - EndCharacter: int option - - /// Describes the kind of the folding range such as 'comment' or 'region'. The kind - /// is used to categorize folding ranges and used by commands like 'Fold all comments'. See - /// [FoldingRangeKind](#FoldingRangeKind) for an enumeration of standardized kinds. - Kind: string option - - /// The text that the client should show when the specified range is - /// collapsed. If not defined or not supported by the client, a default will - /// be chosen by the client. - CollapsedText: string option - } - -type SelectionRangeParams = - { - /// The document to generate ranges for - TextDocument: TextDocumentIdentifier - - /// The positions inside the text document. - Positions: Position[] - } - -type SelectionRange = - { - /// The range of this selection range. - Range: Range - - /// The parent selection range containing this range. Therefore `parent.range` must contain `this.range`. - Parent: SelectionRange option - } - -type CallHierarchyPrepareParams = - { - TextDocument: TextDocumentIdentifier - - /// The position at which this request was sent. - Position: Position - } - -type HierarchyItem = - { - /// The name of this item. - Name: string - - /// The kind of this item. - Kind: SymbolKind - - /// Tags for this item. - Tags: SymbolTag[] option - - /// More detail for this item, e.g., the signature of a function. - Detail: string option - - /// The resource identifier of this item. - Uri: DocumentUri - - /// The range enclosing this symbol not including leading/trailing - /// whitespace but everything else, e.g., comments and code. - Range: Range - - /// The range that should be selected and revealed when this symbol is being - /// picked, e.g., the name of a function. Must be contained by the [`range`]. - SelectionRange: Range - - /// A data entry field that is preserved between a call hierarchy prepare - /// and incoming calls or outgoing calls requests. - Data: JToken option - } - -type CallHierarchyItem = HierarchyItem - -type CallHierarchyIncomingCallsParams = { Item: CallHierarchyItem } - -type CallHierarchyIncomingCall = - { - /// The item that makes the call. - From: CallHierarchyItem - - /// The ranges at which the calls appear. This is relative to the caller - /// denoted by [`this.From`]. - FromRanges: Range[] - } - -type CallHierarchyOutgoingCallsParams = { Item: CallHierarchyItem } - -type CallHierarchyOutgoingCall = - { - /// The item that is called - To: CallHierarchyItem - - /// The range at which this item is called. This is the range relative to - /// the caller, e.g., the item passed to `callHierarchy/outgoingCalls` - /// request. - FromRanges: Range[] - } - -type TypeHierarchyPrepareParams = - { - TextDocument: TextDocumentIdentifier - - /// The position at which this request was sent. - Position: Position - } - -type TypeHierarchyItem = HierarchyItem - -type TypeHierarchySupertypesParams = { Item: TypeHierarchyItem } - -type TypeHierarchySubtypesParams = { Item: TypeHierarchyItem } - -type SemanticTokensParams = { TextDocument: TextDocumentIdentifier } - -type SemanticTokensDeltaParams = - { - TextDocument: TextDocumentIdentifier - /// The result id of a previous response. The result Id can either point to - /// a full response or a delta response depending on what was received last. - PreviousResultId: string - } - -type SemanticTokensRangeParams = { TextDocument: TextDocumentIdentifier; Range: Range } - -type SemanticTokens = - { - /// An optional result id. If provided and clients support delta updating - /// the client will include the result id in the next semantic token request. - /// A server can then instead of computing all semantic tokens again simply - /// send a delta. - ResultId: string option - Data: uint32[] - } - -type SemanticTokensEdit = - { - /// The start offset of the edit. - Start: uint32 - - /// The count of elements to remove. - DeleteCount: uint32 - - /// The elements to insert. - Data: uint32[] option - } - -type SemanticTokensDelta = - { - ResultId: string option - - /// The semantic token edits to transform a previous result into a new result. - Edits: SemanticTokensEdit[] - } - -/// Represents information on a file/folder create. -///@since 3.16.0 -type FileCreate = - { - /// A file:// URI for the location of the file/folder being created. - Uri: string - } - -/// The parameters sent in notifications/requests for user-initiated creation of files. -/// @since 3.16.0 -type CreateFilesParams = - { - /// An array of all files/folders created in this operation. - Files: FileCreate[] - } - -/// Represents information on a file/folder rename. -/// @since 3.16.0 -type FileRename = - { - /// A file:// URI for the original location of the file/folder being renamed. - OldUri: string - /// A file:// URI for the new location of the file/folder being renamed. - NewUri: string - } - -/// The parameters sent in notifications/requests for user-initiated renames of files. -/// @since 3.16.0 -type RenameFilesParams = - { - /// An array of all files/folders renamed in this operation. When a folder is renamed, - /// only the folder will be included, and not its children. - Files: FileRename[] - } - -/// Represents information on a file/folder create. -///@since 3.16.0 -type FileDelete = - { - /// A file:// URI for the location of the file/folder being deleted. - Uri: string - } - -/// The parameters sent in notifications/requests for user-initiated deletes of files. -/// @since 3.16.0 -type DeleteFilesParams = - { - /// An array of all files/folders deleted in this operation. - Files: FileDelete[] - } - - -/// A parameter literal used in inlay hint requests. -type InlayHintParams = (*WorkDoneProgressParams &*) - { - /// The text document. - TextDocument: TextDocumentIdentifier - /// The visible document range for which inlay hints should be computed. - Range: Range - } - -/// Inlay hint kinds. -[] -type InlayHintKind = - /// An inlay hint that for a type annotation. - | Type = 1 - /// An inlay hint that is for a parameter. - | Parameter = 2 - -[] -[] -type InlayHintTooltip = - | String of string - | Markup of MarkupContent - -/// An inlay hint label part allows for interactive and composite labels -/// of inlay hints. -type InlayHintLabelPart = - { - /// The value of this label part. - Value: string - /// The tooltip text when you hover over this label part. Depending on - /// the client capability `inlayHint.resolveSupport` clients might resolve - /// this property late using the resolve request. - Tooltip: InlayHintTooltip option - /// An optional source code location that represents this - /// label part. - /// - /// The editor will use this location for the hover and for code navigation - /// features: This part will become a clickable link that resolves to the - /// definition of the symbol at the given location (not necessarily the - /// location itself), it shows the hover that shows at the given location, - /// and it shows a context menu with further code navigation commands. - /// - /// Depending on the client capability `inlayHint.resolveSupport` clients - /// might resolve this property late using the resolve request. - Location: Location option - /// An optional command for this label part. - /// - /// Depending on the client capability `inlayHint.resolveSupport` clients - /// might resolve this property late using the resolve request. - Command: Command option - } - -[] -[] -type InlayHintLabel = - | String of string - | Parts of InlayHintLabelPart[] - -/// Inlay hint information. -type InlayHint = - { - /// The position of this hint. - Position: Position - /// The label of this hint. A human readable string or an array of - /// InlayHintLabelPart label parts. - /// - /// *Note* that neither the string nor the label part can be empty. - Label: InlayHintLabel - /// he kind of this hint. Can be omitted in which case the client - /// should fall back to a reasonable default. - Kind: InlayHintKind option - /// Optional text edits that are performed when accepting this inlay hint. - /// - /// *Note* that edits are expected to change the document so that the inlay - /// hint (or its nearest variant) is now part of the document and the inlay - /// hint itself is now obsolete. - /// - /// Depending on the client capability `inlayHint.resolveSupport` clients - /// might resolve this property late using the resolve request. - TextEdits: TextEdit[] option - /// The tooltip text when you hover over this item. - /// - /// Depending on the client capability `inlayHint.resolveSupport` clients - /// might resolve this property late using the resolve request. - Tooltip: InlayHintTooltip option - /// Render padding before the hint. - /// - /// Note: Padding should use the editor's background color, not the - /// background color of the hint itself. That means padding can be used - /// to visually align/separate an inlay hint. - PaddingLeft: bool option - /// Render padding after the hint. - /// - /// Note: Padding should use the editor's background color, not the - /// background color of the hint itself. That means padding can be used - /// to visually align/separate an inlay hint. - PaddingRight: bool option - - /// A data entry field that is preserved on a inlay hint between - /// a `textDocument/inlayHint` and a `inlayHint/resolve` request. - Data: LSPAny option - } - -/// InlineValue Context -type InlineValueContext = - { - /// The stack frame (as a DAP Id) where the execution has stopped. - FrameId: int - - /// The document range where execution has stopped. - /// Typically the end position of the range denotes the line where the inline values are shown. - StoppedLocation: Range - } - -/// A parameter literal used in inline value requests. -type InlineValueParams = (*WorkDoneProgressParams &*) - { - /// The text document. - TextDocument: TextDocumentIdentifier - /// The visible document range for which inline values should be computed. - Range: Range - /// Additional information about the context in which inline values were requested - Context: InlineValueContext - } - -/// Provide inline value as text. -type InlineValueText = - { - /// The document range for which the inline value applies. - Range: Range - /// The text of the inline value. - Text: String - } - -type InlineValueVariableLookup = - { - /// The document range for which the inline value applies. The range is used - /// to extract the variable name from the underlying document. - Range: Range - - /// If specified the name of the variable to look up. - VariableName: string option - - /// How to perform the lookup. - CaseSensitiveLookup: bool - } - -type InlineValueEvaluatableExpression = - { - /// The document range for which the inline value applies. The range is used - /// to extract the evaluatable expression from the underlying document. - Range: Range - - /// If specified the expression overrides the extracted expression. - Expression: string option - } - -[] -[] -type InlineValue = - | InlineValueText of InlineValueText - | InlineValueVariableLookup of InlineValueVariableLookup - | InlineValueEvaluatableExpression of InlineValueEvaluatableExpression - - -module UniquenessLevel = - /// The moniker is only unique inside a document - let Document = "document" - /// The moniker is unique inside a project for which a dump got created - let Project = "project" - /// The moniker is unique inside the group to which a project belongs - let Group = "group" - /// The moniker is unique inside the moniker scheme. - let Scheme = "scheme" - /// The moniker is globally unique - let Global = "global" - -module MonikerKind = - /// The moniker represent a symbol that is imported into a project - let Import = "import" - /// The moniker represents a symbol that is exported from a project - let Export = "export" - - /// The moniker represents a symbol that is local to a project (e.g. a local - /// variable of a function, a class not visible outside the project, ...) - let Local = "local" - -type Moniker = - { - /// The scheme of the moniker. For example tsc or .Net - Scheme: string - - /// The identifier of the moniker. The value is opaque in LSIF however schema owners are allowed - /// to define the structure if they want. - Identifier: string - - /// The scope in which the moniker is unique - Unique: string - - /// The moniker kind if known. - Kind: string option - } - - -type ProgressToken = U2 - -type WorkDoneProgressCreateParams = - { - ///The token to be used to report progress. - token: ProgressToken - } - -/// The base protocol offers also support to report progress in a generic fashion. -/// This mechanism can be used to report any kind of progress including work done progress -/// (usually used to report progress in the user interface using a progress bar) and partial -/// result progress to support streaming of results. -type ProgressParams<'T> = - { - /// The progress token provided by the client or server. - token: ProgressToken - /// The progress data. - value: 'T - } - -type WorkDoneProgressKind = - | Begin - | Report - | End - - override x.ToString() = - match x with - | Begin -> "begin" - | Report -> "report" - | End -> "end" - -type WorkDoneProgressEnd = - { - /// WorkDoneProgressKind.End - kind: string - /// Optional, a final message indicating to for example indicate the outcome of the operation. - message: string option - } - - static member Create(?message) = { kind = WorkDoneProgressKind.End.ToString(); message = message } - -type WorkDoneProgressBegin = - { - /// WorkDoneProgressKind.Begin - kind: string - - /// Mandatory title of the progress operation. Used to briefly inform about - /// the kind of operation being performed. - /// - /// Examples: "Indexing" or "Linking dependencies". - title: string option - /// Controls if a cancel button should show to allow the user to cancel the - /// long running operation. Clients that don't support cancellation are allowed - /// to ignore the setting. - cancellable: bool option - /// Optional, more detailed associated progress message. Contains - /// complementary information to the `title`. - /// - /// Examples: "3/25 files", "project/src/module2", "node_modules/some_dep". - /// If unset, the previous progress message (if any) is still valid. - message: string option - /// Optional progress percentage to display (value 100 is considered 100%). - /// If not provided infinite progress is assumed and clients are allowed - /// to ignore the `percentage` value in subsequent in report notifications. - /// - /// The value should be steadily rising. Clients are free to ignore values - /// that are not following this rule. The value range is [0, 100]. - percentage: uint option - } - - static member Create(title, ?cancellable, ?message, ?percentage) = - { kind = WorkDoneProgressKind.Begin.ToString() - title = Some title - cancellable = cancellable - message = message - percentage = percentage } - -type WorkDoneProgressReport = - { - /// WorkDoneProgressKind.Report - kind: string - /// Controls enablement state of a cancel button. - /// - /// Clients that don't support cancellation or don't support controlling the button's - /// enablement state are allowed to ignore the property. - cancellable: bool option - /// Optional, more detailed associated progress message. Contains - /// complementary information to the `title`. - /// - /// Examples: "3/25 files", "project/src/module2", "node_modules/some_dep". - /// If unset, the previous progress message (if any) is still valid. - message: string option - /// Optional progress percentage to display (value 100 is considered 100%). - /// If not provided infinite progress is assumed and clients are allowed - /// to ignore the `percentage` value in subsequent in report notifications. - /// - /// The value should be steadily rising. Clients are free to ignore values - /// that are not following this rule. The value range is [0, 100]. - percentage: uint option - } - - static member Create(?cancellable, ?message, ?percentage) = - { kind = WorkDoneProgressKind.Report.ToString() - cancellable = cancellable - message = message - percentage = percentage } - -/// The token to be used to report progress. -type WorkDoneProgressCancelParams = { token: ProgressToken } + let requestCancelled<'a> : AsyncLspResult<'a> = async.Return(Result.Error(JsonRpc.Error.RequestCancelled)) diff --git a/tests/Benchmarks.fs b/tests/Benchmarks.fs index abe6d86..76679c9 100644 --- a/tests/Benchmarks.fs +++ b/tests/Benchmarks.fs @@ -258,19 +258,19 @@ module Example = let gen (rand: Random) (depth: int) = { BoolString = if rand.NextBool() then - U2.First true + U2.C1 true else - U2.Second $"U2 {depth}" + U2.C2 $"U2 {depth}" StringInt = if rand.NextBool() then - U2.First $"U2 {depth}" + U2.C1 $"U2 {depth}" else - U2.Second(42000 + depth) + U2.C2(42000 + depth) BoolErasedUnionData = if rand.NextBool() then - U2.First true + U2.C1 true else - U2.Second(ErasedUnionDataHolder.gen rand (depth - 1)) } + U2.C2(ErasedUnionDataHolder.gen rand (depth - 1)) } [] type MyEnum = @@ -387,8 +387,10 @@ type MultipleTypesBenchmarks() = RootPath = Some "/" RootUri = Some "file://..." InitializationOptions = None + WorkDoneToken = None + Trace = Some TraceValues.Off Capabilities = - Some + { Workspace = Some { ApplyEdit = Some true @@ -419,7 +421,10 @@ type MultipleTypesBenchmarks() = WorkspaceFolders = None Configuration = None FileOperations = None - Diagnostics = None } + Diagnostics = None + + } + NotebookDocument = None TextDocument = Some { Synchronization = @@ -439,22 +444,24 @@ type MultipleTypesBenchmarks() = Hover = Some { DynamicRegistration = Some true - ContentFormat = Some [| "markup"; "plaintext" |] } + ContentFormat = Some [| MarkupKind.PlainText; MarkupKind.Markdown |] } SignatureHelp = Some { DynamicRegistration = Some true SignatureInformation = Some - { DocumentationFormat = None - ParameterInformation = None - ActiveParameterSupport = None } + { DocumentationFormat = None + ParameterInformation = None + ActiveParameterSupport = None } ContextSupport = None } Declaration = Some { DynamicRegistration = Some false; LinkSupport = Some false } References = Some { DynamicRegistration = Some false } DocumentHighlight = Some { DynamicRegistration = None } DocumentSymbol = None Formatting = Some { DynamicRegistration = Some true } - RangeFormatting = Some { DynamicRegistration = Some true } + RangeFormatting = Some { + DynamicRegistration = Some true + } OnTypeFormatting = None Definition = Some { DynamicRegistration = Some false; LinkSupport = Some false } TypeDefinition = Some { DynamicRegistration = Some false; LinkSupport = Some false } @@ -464,7 +471,7 @@ type MultipleTypesBenchmarks() = { DynamicRegistration = Some true CodeActionLiteralSupport = Some - { CodeActionKind = + { CodeActionKind = { ValueSet = [| "foo"; "bar"; "baz"; "alpha"; "beta"; "gamma"; "delta"; "x"; "y"; "z" |] } } IsPreferredSupport = Some true DisabledSupport = Some false @@ -488,7 +495,7 @@ type MultipleTypesBenchmarks() = SemanticTokens = Some { DynamicRegistration = Some false - Requests = { Range = Some true; Full = Some(U2.Second { Delta = Some true }) } + Requests = { Range = Some (U2.C1 true); Full = Some(U2.C2 { Delta = Some true }) } TokenTypes = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Proin tortor purus platea sit eu id nisi litora libero. Neque vulputate consequat ac amet augue blandit maximus aliquet congue. Pharetra vestibulum posuere ornare faucibus fusce dictumst orci aenean eu facilisis ut volutpat commodo senectus purus himenaeos fames primis convallis nisi." |> fun s -> s.Split(' ') @@ -511,7 +518,6 @@ type MultipleTypesBenchmarks() = General = None Experimental = None Window = None } - trace = None WorkspaceFolders = Some [| { Uri = "..."; Name = "foo" } @@ -521,19 +527,19 @@ type MultipleTypesBenchmarks() = let inlayHint: InlayHint = { Label = - InlayHintLabel.Parts + U2.C2 [| { InlayHintLabelPart.Value = "1st label" - Tooltip = Some(InlayHintTooltip.String "1st label tooltip") - Location = Some { Uri = "1st"; Range = mkRange' (1, 2) (3, 4) } + Tooltip = Some(U2.C1 "1st label tooltip") + Location = Some { Uri = "1st"; Range = mkRange' (1u, 2u) (3u, 4u) } Command = None } { Value = "2nd label" - Tooltip = Some(InlayHintTooltip.String "1st label tooltip") - Location = Some { Uri = "2nd"; Range = mkRange' (5, 8) (10, 9) } + Tooltip = Some(U2.C1 "1st label tooltip") + Location = Some { Uri = "2nd"; Range = mkRange' (5u, 8u) (10u, 9u) } Command = Some { Title = "2nd command"; Command = "foo"; Arguments = None } } { InlayHintLabelPart.Value = "3rd label" Tooltip = Some( - InlayHintTooltip.Markup + U2.C2 { Kind = MarkupKind.Markdown Value = """ @@ -543,15 +549,15 @@ type MultipleTypesBenchmarks() = * List 2 """ } ) - Location = Some { Uri = "3rd"; Range = mkRange' (1, 2) (3, 4) } + Location = Some { Uri = "3rd"; Range = mkRange' (1u, 2u) (3u, 4u) } Command = None } |] - Position = { Line = 5; Character = 10 } + Position = { Line = 5u; Character = 10u } Kind = Some InlayHintKind.Type TextEdits = Some - [| { Range = mkRange' (5, 10) (6, 5); NewText = "foo bar" } - { Range = mkRange' (5, 0) (5, 2); NewText = "baz" } |] - Tooltip = Some(InlayHintTooltip.Markup { Kind = MarkupKind.PlainText; Value = "some tooltip" }) + [| { Range = mkRange' (5u, 10u) (6u, 5u); NewText = "foo bar" } + { Range = mkRange' (5u, 0u) (5u, 2u); NewText = "baz" } |] + Tooltip = Some(U2.C2 { Kind = MarkupKind.PlainText; Value = "some tooltip" }) PaddingLeft = Some true PaddingRight = Some false Data = Some(JToken.FromObject "some data") } diff --git a/tests/Ionide.LanguageServerProtocol.Tests.fsproj b/tests/Ionide.LanguageServerProtocol.Tests.fsproj index b90f3e6..ad46e5f 100644 --- a/tests/Ionide.LanguageServerProtocol.Tests.fsproj +++ b/tests/Ionide.LanguageServerProtocol.Tests.fsproj @@ -1,49 +1,36 @@ - - - - Exe - net6.0 - false - - - - - - - - - - - - - - - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - - - - - - - + + + + Exe + net6.0 + false + + + + + + + + + + + + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + + \ No newline at end of file diff --git a/tests/Shotgun.fs b/tests/Shotgun.fs index 74a899f..272976d 100644 --- a/tests/Shotgun.fs +++ b/tests/Shotgun.fs @@ -38,6 +38,18 @@ type Gens = |> Gen.constant |> Arb.fromGen + static member CreateFile() : Arbitrary = + let create annotationId uri options : CreateFile = { AnnotationId = annotationId; Uri = uri; Options = options ; Kind = "create" } + Gen.map3 create Arb.generate Arb.generate Arb.generate |> Arb.fromGen + + static member RenameFile() : Arbitrary = + let create annotationId oldUri newUri options : RenameFile = { AnnotationId = annotationId; OldUri = oldUri; NewUri = newUri; Options = options ; Kind = "rename" } + Gen.map4 create Arb.generate Arb.generate Arb.generate Arb.generate |> Arb.fromGen + + static member DeleteFile() : Arbitrary = + let create annotationId uri options : DeleteFile = { AnnotationId = annotationId; Uri = uri; Options = options ; Kind = "delete" } + Gen.map3 create Arb.generate Arb.generate Arb.generate |> Arb.fromGen + static member DocumentSymbol() : Arbitrary = // DocumentSymbol is recursive -> Stack overflow when default generation // https://fscheck.github.io/FsCheck/TestData.html#Generating-recursive-data-types @@ -108,10 +120,15 @@ let tests = let abbrevTys = [| nameof DocumentUri, typeof nameof DocumentSelector, typeof - nameof TextDocumentCodeActionResult, typeof |] + nameof TextDocumentCodeActionResult, typeof + + |] let tys = - let shouldTestType (t: Type) = Utils.isLspType [ not << Lsp.Is.Generic; not << Lsp.Is.Nested ] t + let shouldTestType (t: Type) = + Utils.isLspType [ not << Lsp.Is.Generic; not << Lsp.Is.Nested ] t + && t.Name = "ApplyWorkspaceEditParams" + let example = typeof let ass = example.Assembly diff --git a/tests/Tests.fs b/tests/Tests.fs index 44dfb21..0de2115 100644 --- a/tests/Tests.fs +++ b/tests/Tests.fs @@ -493,52 +493,52 @@ let private serializationTests = "U2" [ testCase "can (de)serialize U2.First" <| fun _ -> - let input: U2 = U2.First 42 + let input: U2 = U2.C1 42 testThereAndBackAgain input testCase "can (de)serialize U2.Second" <| fun _ -> - let input: U2 = U2.Second "foo" + let input: U2 = U2.C2 "foo" testThereAndBackAgain input testCase "deserialize to first type match" <| fun _ -> // Cannot distinguish between same type -> pick first - let input: U2 = U2.Second 42 + let input: U2 = U2.C2 42 let output = thereAndBackAgain input Expect.notEqual output input "First matching type gets matched" testCase "deserialize Second int to first float" <| fun _ -> // Cannot distinguish between float and int - let input: U2 = U2.Second 42 + let input: U2 = U2.C2 42 let output = thereAndBackAgain input Expect.notEqual output input "First matching type gets matched" testCase "can (de)serialize Record1 in U2" <| fun _ -> - let input: U2 = U2.First { Record1.Name = "foo"; Value = 42 } + let input: U2 = U2.C1 { Record1.Name = "foo"; Value = 42 } testThereAndBackAgain input testCase "can (de)serialize Record1 in U2" <| fun _ -> - let input: U2 = U2.Second { Record1.Name = "foo"; Value = 42 } + let input: U2 = U2.C2 { Record1.Name = "foo"; Value = 42 } testThereAndBackAgain input testCase "can (de)serialize Record1 in U2" <| fun _ -> - let input: U2 = U2.First { Record1.Name = "foo"; Value = 42 } + let input: U2 = U2.C1 { Record1.Name = "foo"; Value = 42 } testThereAndBackAgain input testCase "can deserialize to correct record" <| fun _ -> // Note: only possible because Records aren't compatible with each other. // If Record2.Position optional -> gets deserialized to `Record2` because first match - let input: U2 = U2.Second { Record1.Name = "foo"; Value = 42 } + let input: U2 = U2.C2 { Record1.Name = "foo"; Value = 42 } testThereAndBackAgain input testList "optional" [ testCase "doesn't emit optional missing member" <| fun _ -> let input: U2 = - U2.Second { OneOptional.RequiredName = "foo"; OptionalValue = None } + U2.C2 { OneOptional.RequiredName = "foo"; OptionalValue = None } let json = serialize input :?> JObject Expect.hasLength (json.Properties()) 1 "There should be just one property" @@ -548,13 +548,13 @@ let private serializationTests = testCase "can deserialize with optional missing member" <| fun _ -> let input: U2 = - U2.Second { OneOptional.RequiredName = "foo"; OptionalValue = None } + U2.C2 { OneOptional.RequiredName = "foo"; OptionalValue = None } testThereAndBackAgain input testCase "can deserialize with optional existing member" <| fun _ -> let input: U2 = - U2.Second { OneOptional.RequiredName = "foo"; OptionalValue = Some 42 } + U2.C2 { OneOptional.RequiredName = "foo"; OptionalValue = Some 42 } testThereAndBackAgain input testCase "fails with missing required value" @@ -571,59 +571,59 @@ let private serializationTests = "string vs int" [ testCase "can deserialize int to U2" <| fun _ -> - let input: U2 = U2.First 42 + let input: U2 = U2.C1 42 testThereAndBackAgain input testCase "can deserialize string to U2" <| fun _ -> - let input: U2 = U2.Second "foo" + let input: U2 = U2.C2 "foo" testThereAndBackAgain input testCase "can deserialize 42 string to U2" <| fun _ -> - let input: U2 = U2.Second "42" + let input: U2 = U2.C2 "42" testThereAndBackAgain input testCase "can deserialize int to U2" <| fun _ -> - let input: U2 = U2.Second 42 + let input: U2 = U2.C2 42 testThereAndBackAgain input testCase "can deserialize string to U2" <| fun _ -> - let input: U2 = U2.First "foo" + let input: U2 = U2.C1 "foo" testThereAndBackAgain input testCase "can deserialize 42 string to U2" <| fun _ -> - let input: U2 = U2.First "42" + let input: U2 = U2.C1 "42" testThereAndBackAgain input ] testList "string vs bool" [ testCase "can deserialize bool to U2" <| fun _ -> - let input: U2 = U2.First true + let input: U2 = U2.C1 true testThereAndBackAgain input testCase "can deserialize string to U2" <| fun _ -> - let input: U2 = U2.Second "foo" + let input: U2 = U2.C2 "foo" testThereAndBackAgain input testCase "can deserialize true string to U2" <| fun _ -> - let input: U2 = U2.Second "true" + let input: U2 = U2.C2 "true" testThereAndBackAgain input testCase "can deserialize bool true to U2" <| fun _ -> - let input: U2 = U2.Second true + let input: U2 = U2.C2 true testThereAndBackAgain input testCase "can deserialize bool false to U2" <| fun _ -> - let input: U2 = U2.Second false + let input: U2 = U2.C2 false testThereAndBackAgain input testCase "can deserialize string to U2" <| fun _ -> - let input: U2 = U2.First "foo" + let input: U2 = U2.C1 "foo" testThereAndBackAgain input testCase "can deserialize true string to U2" <| fun _ -> - let input: U2 = U2.First "true" + let input: U2 = U2.C1 "true" testThereAndBackAgain input ] ] testList @@ -748,8 +748,8 @@ let private serializationTests = testCase "can (de)serialize minimal InlayHint" <| fun _ -> let theInlayHint: InlayHint = - { Label = InlayHintLabel.String "test" - Position = { Line = 0; Character = 0 } + { Label = U2.C1 "test" + Position = { Line = 0u; Character = 0u } Kind = None TextEdits = None Tooltip = None @@ -761,16 +761,16 @@ let private serializationTests = testCase "can roundtrip InlayHint with all fields (simple)" <| fun _ -> let theInlayHint: InlayHint = - { Label = InlayHintLabel.String "test" - Position = { Line = 5; Character = 10 } + { Label = U2.C1 "test" + Position = { Line = 5u; Character = 10u } Kind = Some InlayHintKind.Parameter TextEdits = Some - [| { Range = { Start = { Line = 5; Character = 10 }; End = { Line = 6; Character = 5 } } + [| { Range = { Start = { Line = 5u; Character = 10u }; End = { Line = 6u; Character = 5u } } NewText = "foo bar" } - { Range = { Start = { Line = 4; Character = 0 }; End = { Line = 5; Character = 2 } } + { Range = { Start = { Line = 4u; Character = 0u }; End = { Line = 5u; Character = 2u } } NewText = "baz" } |] - Tooltip = Some(InlayHintTooltip.String "tooltipping") + Tooltip = Some(U2.C1 "tooltipping") PaddingLeft = Some true PaddingRight = Some false Data = Some(JToken.FromObject "some data") } @@ -782,11 +782,11 @@ let private serializationTests = // -> Expecto equal check fails even when same content in complex JToken let data = { InlayHintData.TextDocument = { Uri = "..." } - Range = { Start = { Line = 5; Character = 7 }; End = { Line = 5; Character = 10 } } } + Range = { Start = { Line = 5u; Character = 7u }; End = { Line = 5u; Character = 10u } } } let theInlayHint: InlayHint = - { Label = InlayHintLabel.String "test" - Position = { Line = 0; Character = 0 } + { Label = U2.C1 "test" + Position = { Line = 0u; Character = 0u } Kind = None TextEdits = None Tooltip = None @@ -805,19 +805,19 @@ let private serializationTests = <| fun _ -> let theInlayHint: InlayHint = { Label = - InlayHintLabel.Parts + U2.C2 [| { InlayHintLabelPart.Value = "1st label" - Tooltip = Some(InlayHintTooltip.String "1st label tooltip") - Location = Some { Uri = "1st"; Range = mkRange' (1, 2) (3, 4) } + Tooltip = Some(U2.C1 "1st label tooltip") + Location = Some { Uri = "1st"; Range = mkRange' (1u, 2u) (3u, 4u) } Command = None } { Value = "2nd label" - Tooltip = Some(InlayHintTooltip.String "1st label tooltip") - Location = Some { Uri = "2nd"; Range = mkRange' (5, 8) (10, 9) } + Tooltip = Some(U2.C1 "1st label tooltip") + Location = Some { Uri = "2nd"; Range = mkRange' (5u, 8u) (10u, 9u) } Command = Some { Title = "2nd command"; Command = "foo"; Arguments = None } } { InlayHintLabelPart.Value = "3rd label" Tooltip = Some( - InlayHintTooltip.Markup + U2.C2 { Kind = MarkupKind.Markdown Value = """ @@ -827,15 +827,15 @@ let private serializationTests = * List 2 """ } ) - Location = Some { Uri = "3rd"; Range = mkRange' (1, 2) (3, 4) } + Location = Some { Uri = "3rd"; Range = mkRange' (1u, 2u) (3u, 4u) } Command = None } |] - Position = { Line = 5; Character = 10 } + Position = { Line = 5u; Character = 10u } Kind = Some InlayHintKind.Type TextEdits = Some - [| { Range = mkRange' (5, 10) (6, 5); NewText = "foo bar" } - { Range = mkRange' (5, 0) (5, 2); NewText = "baz" } |] - Tooltip = Some(InlayHintTooltip.Markup { Kind = MarkupKind.PlainText; Value = "some tooltip" }) + [| { Range = mkRange' (5u, 10u) (6u, 5u); NewText = "foo bar" } + { Range = mkRange' (5u, 0u) (5u, 2u); NewText = "baz" } |] + Tooltip = Some(U2.C2 { Kind = MarkupKind.PlainText; Value = "some tooltip" }) PaddingLeft = Some true PaddingRight = Some false Data = Some(JToken.FromObject "some data") } @@ -851,24 +851,24 @@ let private serializationTests = testCase "can roundtrip InlineValue with all fields (simple)" <| fun _ -> let theInlineValue: InlineValue = - { InlineValueText.Range = { Start = { Line = 5; Character = 7 }; End = { Line = 5; Character = 10 } } + { InlineValueText.Range = { Start = { Line = 5u; Character = 7u }; End = { Line = 5u; Character = 10u } } Text = "test" } - |> InlineValue.InlineValueText + |> U3.C1 testThereAndBackAgain theInlineValue ] testList - (nameof HierarchyItem) + (nameof TypeHierarchyItem) [ testCase "can roundtrip HierarchyItem with all fields (simple)" <| fun _ -> - let item: HierarchyItem = + let item: TypeHierarchyItem = { Name = "test" Kind = SymbolKind.Function Tags = None Detail = None Uri = "..." - Range = mkRange' (1, 2) (3, 4) - SelectionRange = mkRange' (1, 2) (1, 4) + Range = mkRange' (1u, 2u) (3u, 4u) + SelectionRange = mkRange' (1u, 2u) (1u, 4u) Data = None } testThereAndBackAgain item ] diff --git a/tests/Utils.fs b/tests/Utils.fs index 8852bcb..5ca1feb 100644 --- a/tests/Utils.fs +++ b/tests/Utils.fs @@ -21,7 +21,7 @@ module Lsp = let internal path = let name = example.FullName - let i = name.IndexOf '+' + let i = name.IndexOf ".TextDocumentIdentifier" name.Substring(0, i + 1) module Is = @@ -232,12 +232,12 @@ let tests = testCase "MarkedString.String is lsp" <| fun _ -> - let o = MarkedString.String "foo" + let o = U2.C1 "foo" let isLsp = o.GetType() |> isLspType [] Expect.isTrue isLsp "MarkedString.String is lsp" testCase "MarkedString.String isn't direct lsp" <| fun _ -> - let o = MarkedString.String "foo" + let o = U2.C1 "foo" let isLsp = o.GetType() |> isLspType [ not << Lsp.Is.Nested ] Expect.isFalse isLsp "MarkedString.String is not direct lsp" @@ -289,8 +289,8 @@ let tests = testCase "can convert in U2" <| fun _ -> let extData = createWithExtensionData () - let actual: U2 = U2.Second extData - let expected: U2 = U2.Second { extData with AdditionalData = dict } + let actual: U2 = U2.C2 extData + let expected: U2 = U2.C2 { extData with AdditionalData = dict } testConvert actual expected testCase "can convert in tuple" diff --git a/tools/MetaModelGenerator/GenerateClientServer.fs b/tools/MetaModelGenerator/GenerateClientServer.fs new file mode 100644 index 0000000..b6a6af6 --- /dev/null +++ b/tools/MetaModelGenerator/GenerateClientServer.fs @@ -0,0 +1,7 @@ +namespace MetaModelGenerator + +module GenerateClientServer = + + let generate () = + + () \ No newline at end of file diff --git a/tools/MetaModelGenerator/GenerateTypes.fs b/tools/MetaModelGenerator/GenerateTypes.fs new file mode 100644 index 0000000..564b465 --- /dev/null +++ b/tools/MetaModelGenerator/GenerateTypes.fs @@ -0,0 +1,999 @@ +namespace MetaModelGenerator + +module GenerateTypes = + + open System.Runtime.CompilerServices + + + open System + open Fantomas.Core + open Fantomas.Core.SyntaxOak + + open Fabulous.AST + + open type Fabulous.AST.Ast + + open System.IO + open Newtonsoft.Json + open Fantomas.FCS.Syntax + open Fabulous.AST.StackAllocatedCollections + open Newtonsoft.Json.Linq + + let getIdent (x: IdentifierOrDot list) = + x + |> List.map ( + function + | IdentifierOrDot.Ident i -> i.Text + | _ -> "" + ) + |> String.concat "" + + type ModuleOrNamespaceExtensions = + /// Allows Anonymous Module components to be yielded directly into a Module + /// Useful since there's no common holder of declarations or generic WidgetBuilder than can be used + /// when yielding different types of declarations + [] + static member inline Yield(_: CollectionBuilder<'parent, ModuleDecl>, x: WidgetBuilder) = + let node = Gen.mkOak x + + let ws = + node.Declarations + |> List.map (fun x -> Ast.EscapeHatch(x).Compile()) + |> List.toArray + |> MutStackArray1.fromArray + + { Widgets = ws } + + let JToken = LongIdent(nameof JToken) + + let createOption (t: WidgetBuilder) = Ast.OptionPostfix t + + let createDictionary (types: WidgetBuilder list) = AppPrefix(LongIdent(nameof Map), types) + + let createErasedUnion (types: WidgetBuilder array) = + if types.Length > 1 then + let duType = LongIdent $"U%d{types.Length}" + AppPrefix(duType, (Array.toList types)) + else + types.[0] + + let isNullableType (t: MetaModel.Type) = + match t with + | MetaModel.Type.BaseType { Name = MetaModel.BaseTypes.Null } -> true + | _ -> false + + module DebuggerDisplay = + let range_debuggerDisplay (r: WidgetBuilder) = + r.attribute(Attribute("DebuggerDisplay(\"{DebuggerDisplay}\")")).members () { + Property("x.DebuggerDisplay", "$\"{x.Start.DebuggerDisplay}-{x.End.DebuggerDisplay}\"") + .attributes ( + [ + Attribute("DebuggerBrowsable(DebuggerBrowsableState.Never)") + Attribute("JsonIgnore") + ] + ) + } + + let position_debuggerDisplay (r: WidgetBuilder) = + r.attribute(Attribute("DebuggerDisplay(\"{DebuggerDisplay}\")")).members () { + Property("x.DebuggerDisplay", "$\"({x.Line},{x.Character})\"") + .attributes ( + [ + Attribute("DebuggerBrowsable(DebuggerBrowsableState.Never)") + Attribute("JsonIgnore") + ] + ) + } + + let diagnostic_debuggerDisplay (r: WidgetBuilder) = + r.attribute(Attribute("DebuggerDisplay(\"{DebuggerDisplay}\")")).members () { + Property( + "x.DebuggerDisplay", + "$\"[{defaultArg x.Severity DiagnosticSeverity.Error}] ({x.Range.DebuggerDisplay}) {x.Message} ({Option.map string x.Code |> Option.defaultValue String.Empty})\"" + ) + .attributes ( + [ + Attribute("DebuggerBrowsable(DebuggerBrowsableState.Never)") + Attribute("JsonIgnore") + ] + ) + } + + /// A set of records we want to configure custom DebuggerDisplay attributes for + let debuggerDisplays = + Map [ + "Range", range_debuggerDisplay + "Position", position_debuggerDisplay + "Diagnostic", diagnostic_debuggerDisplay + ] + + type FieldInformation = { + Name: string + TypeInfo: WidgetBuilder + StructuredDocs: StructuredDocs option + Attribute: WidgetBuilder option + /// Typescript uses Anonymous Records, while F# has them they're not that flexible so we generate named records for them + NamedAnonymousRecords: WidgetBuilder list + } + + /// Handles structures that share all the same properties/fields but the only difference is one is optional + /// + /// For instance, there may be a union that defines `{ First: string; Last? : string} | {First?: string; Last : string}` + /// so that one of the fields are always populated. This is however hard to deserialize in F# so we want to create a + /// singular type with all properties as optional, such like: `{First?: string; Last?: string}` + let handleSameShapeStructuredUnions path createField (ts: MetaModel.Type array) = + if + ts + |> Array.forall (fun t -> t.isStructureLiteralType) + then + let ts = + ts + |> Array.map (fun t -> + match t with + | MetaModel.Type.StructureLiteralType s -> s.Value + | _ -> failwithf "Expected StructureLiteralType %A" t + ) + + let allProperties = + ts + |> Array.collect (fun s -> s.PropertiesSafe) + |> Array.groupBy (fun p -> p.Name) + + if + allProperties + |> Array.forall (fun (_, props) -> + let (_, first) = allProperties.[0] + props.Length = first.Length + ) + then + let fields: (string * WidgetBuilder<_> * _ * _ list) list = + allProperties + |> Array.map (fun (name, props) -> + let prop = + props + |> Array.tryFind (fun x -> x.IsOptional) // Prefer optional properties + |> Option.defaultValue (props.[0]) + + let fi = + createField + (path + @ [ prop.NameAsPascalCase ]) + prop.Type + prop + + prop.NameAsPascalCase, fi.TypeInfo, prop.StructuredDocs, fi.NamedAnonymousRecords + ) + |> Array.toList + + let namedAnonRecs = + fields + |> Seq.collect (fun (a, b, _, d) -> d) + |> Seq.toList + + let fields = + fields + |> List.map (fun (n, f, docs, _) -> n, f, docs) + + let (fieldTy, record) = + let name = String.concat "" path + + LongIdent name, + Record(name) { + for (n, f, docs) in fields do + let f = Field(n, f) + + docs + |> Option.mapOrDefault f f.xmlDocs + } + + Some( + fieldTy, + record + :: namedAnonRecs + ) + else + None + else + None + + + let rec createField path (currentType: MetaModel.Type) (currentProperty: MetaModel.Property) : FieldInformation = + try + let rec getType + path + (currentType: MetaModel.Type) + : WidgetBuilder * WidgetBuilder option * _ list = + match currentType with + | MetaModel.Type.ReferenceType r -> + let name = r.Name + LongIdent name, None, [] + + | MetaModel.Type.BaseType b -> + let name = b.Name.ToDotNetType() + LongIdent name, None, [] + + | MetaModel.Type.OrType o -> + + match handleSameShapeStructuredUnions path (createField) o.Items with + | Some(x: WidgetBuilder, namedAnonRecs) -> x, None, namedAnonRecs + | None -> + + // TS types can have optional properties (myKey?: string) + // and unions with null (string | null) + // we need to handle both cases + let isOptional, items = + if Array.exists isNullableType o.Items then + true, + o.Items + |> Array.filter (fun x -> not (isNullableType x)) + else + false, o.Items + + let ts = + items + |> Array.mapi (fun i -> + getType ( + path + @ [ $"C{i + 1}" ] + ) + ) + + let namedAnonRecs = + ts + |> Seq.collect (fun (a, b, c) -> c) + |> Seq.toList + + let ts = + ts + |> Array.map (fun (a, b, c) -> a) + // if this is already marked as Optional in the schema, ignore the union case + // as we'll wrap it in an option type near the end + if + isOptional + && not currentProperty.IsOptional + then + createOption (createErasedUnion ts), + Some(Attribute "JsonProperty(NullValueHandling = NullValueHandling.Include)"), + namedAnonRecs + else + createErasedUnion ts, None, namedAnonRecs + + | MetaModel.Type.ArrayType a -> + let (t, _, namedAnonRecs) = getType path a.Element + Array(t, 1), None, namedAnonRecs + | MetaModel.Type.StructureLiteralType l -> + if + l.Value.PropertiesSafe + |> Array.isEmpty + then + JToken, None, [] + else + let ts = + l.Value.PropertiesSafe + |> Array.map (fun p -> + let fi = + createField + (path + @ [ p.NameAsPascalCase ]) + p.Type + p + + { + Name = fi.Name + TypeInfo = fi.TypeInfo + Attribute = None + StructuredDocs = p.StructuredDocs + NamedAnonymousRecords = fi.NamedAnonymousRecords + } + ) + |> Array.toList + + let fieldTy, record = + let fields = + ts + |> List.map (fun fi -> + let f = Field(fi.Name, fi.TypeInfo) + + fi.StructuredDocs + |> Option.mapOrDefault f f.xmlDocs + ) + + let name = String.concat "" path + + let r = + Record(name) { + for f in fields do + f + } + + let r = + l.Value.StructuredDocs + |> Option.mapOrDefault r r.xmlDocs + + LongIdent name, r + + let namedAnonRecs = + ts + |> List.collect (fun fi -> fi.NamedAnonymousRecords) + + fieldTy, + None, + record + :: namedAnonRecs + + | MetaModel.Type.MapType m -> + let key = + match m.Key with + | MetaModel.MapKeyType.Base b -> + b.Name.ToDotNetType() + |> LongIdent + | MetaModel.MapKeyType.ReferenceType r -> LongIdent(r.Name) + + let (value, _, namedAnonRecs) = getType path m.Value + + createDictionary [ + key + value + ], + None, + namedAnonRecs + + | MetaModel.Type.StringLiteralType t -> + LongIdent("string"), Some(Attribute($"UnionKindAttribute(\"{t.Value}\")")), [] + | MetaModel.Type.TupleType t -> + + let ts = + t.Items + |> Array.mapi (fun i -> + getType ( + path + @ [ $"T{i + 1}" ] + ) + ) + |> Array.toList + + let tuple = + ts + |> List.map (fun (a, b, c) -> a) + |> Tuple + + let namedAnonRecs = + ts + |> List.collect (fun (a, b, c) -> c) + + tuple, None, namedAnonRecs + + | _ -> failwithf $"todo Property %A{currentType}" + + let (t, attribute, namedAnonRecs) = getType path currentType + let t = if currentProperty.IsOptional then createOption t else t + let name = currentProperty.NameAsPascalCase + + { + Name = name + TypeInfo = t + Attribute = attribute + StructuredDocs = currentProperty.StructuredDocs + NamedAnonymousRecords = namedAnonRecs + } + with e -> + raise + <| Exception(sprintf "createField on %A " currentProperty, e) + + + let isUnitStructure (structure: MetaModel.Structure) = + + let isEmptyExtends = + structure.Extends + |> Option.Array.isEmpty + + let isEmptyMixins = + structure.Mixins + |> Option.Array.isEmpty + + let isEmptyProperties = + structure.Properties + |> Option.Array.isEmpty + + isEmptyExtends + && isEmptyMixins + && isEmptyProperties + + //HACK: need to add these since it's a mixin but really should be an interface + let extensionsButNotReally = [ + "WorkDoneProgressParams" + "WorkDoneProgressOptions" + "PartialResultParams" + ] + + /// Scans all structures for use as an interface and generates the interfaces + let createInterfaceStructures (structure: MetaModel.Structure array) (model: MetaModel.MetaModel) = + // Scan and find all interfaces + let interfaceStructures = + structure + |> Array.collect (fun s -> + s.ExtendsSafe + |> Array.map (fun e -> + match e with + | MetaModel.Type.ReferenceType r -> + match + model.StructuresSafe + |> Array.tryFind (fun s -> s.Name = r.Name) + with + | Some s -> s + | None -> failwithf "Could not find structure %s" r.Name + | _ -> failwithf "todo Extends %A" e + ) + ) + |> Array.distinctBy (fun x -> x.Name) + + //HACK: need to add additional types since it's a mixin but really should be an interface + |> Array.append [| + yield! + model.StructuresSafe + |> Array.filter (fun s -> + extensionsButNotReally + |> List.contains s.Name + ) + |] + + interfaceStructures + |> Array.map (fun s -> + let widget = + Interface($"I{s.Name}") { + let properties = s.PropertiesSafe + + for p in properties do + let fi = + createField + [ + s.Name + p.NameAsPascalCase + ] + p.Type + p + + let ap = AbstractProperty(fi.Name, fi.TypeInfo) + + yield + fi.StructuredDocs + |> Option.mapOrDefault ap ap.xmlDocs + + // MetaModel is incorrect we need to use Mixin instead of extends + for e in s.MixinsSafe do + match e with + | MetaModel.Type.ReferenceType r -> yield Inherit($"I{r.Name}") + | _ -> () + } + + let widget = + s.StructuredDocs + |> Option.mapOrDefault widget widget.xmlDocs + + s, widget + ) + + + /// Creates Record types based on a given Structure + let createStructure + (structure: MetaModel.Structure) + (interfaceStructures: MetaModel.Structure array) + (model: MetaModel.MetaModel) + = + + // deduplicate any by name choose the heaviest weighted one + let maxByWeight groupBy (xs: ('T * int) list) = + xs + |> List.groupBy (fun (i, _) -> groupBy i) + |> List.map ( + snd + >> List.maxBy snd + >> fst + ) + + let rec expandFields (structure: MetaModel.Structure) : list = + [ + + for e in structure.ExtendsSafe do + match e with + | MetaModel.Type.ReferenceType r -> + match + model.StructuresSafe + |> Array.tryFind (fun s -> s.Name = r.Name) + with + | Some s -> + for info in expandFields s do + { + Name = info.Name + TypeInfo = info.TypeInfo + StructuredDocs = info.StructuredDocs + Attribute = info.Attribute + NamedAnonymousRecords = info.NamedAnonymousRecords + }, + 10 + | None -> failwithf "Could not find structure %s" r.Name + | _ -> failwithf "todo Extends %A" e + + // Mixins are inlined fields + for m in structure.MixinsSafe do + match m with + | MetaModel.Type.ReferenceType r -> + match + model.StructuresSafe + |> Array.tryFind (fun s -> s.Name = r.Name) + with + | Some s -> + for p in s.PropertiesSafe do + let fi = + createField + [ + s.Name + p.NameAsPascalCase + ] + p.Type + p + + { + Name = fi.Name + TypeInfo = fi.TypeInfo + StructuredDocs = fi.StructuredDocs + Attribute = fi.Attribute + NamedAnonymousRecords = fi.NamedAnonymousRecords + }, + 1 + + | None -> failwithf "Could not find structure %s" r.Name + | _ -> failwithf "todo Mixins %A" m + + for p in structure.PropertiesSafe do + let fi = + createField + [ + structure.Name + p.NameAsPascalCase + ] + p.Type + p + + { + Name = fi.Name + TypeInfo = fi.TypeInfo + StructuredDocs = fi.StructuredDocs + Attribute = fi.Attribute + NamedAnonymousRecords = fi.NamedAnonymousRecords + }, + 100 + + ] + |> maxByWeight (fun fi -> fi.Name) + + let rec implementInterface (structure: MetaModel.Structure) = [| + + + // Implement interface + yield! + interfaceStructures + |> Array.tryFind (fun s -> s.Name = structure.Name) + |> Option.map (fun s -> + let interfaceName = Ast.LongIdent($"I{s.Name}") + + InterfaceMember(interfaceName) { + for p in s.PropertiesSafe do + let name = Constant($"x.{p.NameAsPascalCase}") + let outp = Property(ConstantPat(name), ConstantExpr(name)) + + p.StructuredDocs + |> Option.mapOrDefault outp outp.xmlDocs + } + + ) + |> Option.toArray + + for e in structure.ExtendsSafe do + match e with + | MetaModel.Type.ReferenceType r -> + yield! + interfaceStructures + |> Array.tryFind (fun s -> s.Name = r.Name) + |> Option.map implementInterface + |> Option.Array.toArray + | _ -> () + + // hack mixin with `extensionsButNotReally` + for m in structure.MixinsSafe do + match m with + | MetaModel.Type.ReferenceType r -> + yield! + interfaceStructures + |> Array.tryFind (fun s -> s.Name = r.Name) + |> Option.map implementInterface + |> Option.Array.toArray + | _ -> () + |] + + + try + let recordFields = expandFields structure + + let namedAnonymousRecords = + recordFields + |> List.collect (fun fi -> fi.NamedAnonymousRecords) + + [ + yield! namedAnonymousRecords + Record(structure.Name) { + yield! + recordFields + |> List.map (fun fi -> + + + let f = Field(fi.Name, fi.TypeInfo) + + let f = + fi.StructuredDocs + |> Option.mapOrDefault f f.xmlDocs + + let f = + fi.Attribute + |> Option.mapOrDefault f f.attribute + + f + + ) + } + |> fun r -> + + let r = + structure.StructuredDocs + |> Option.mapOrDefault r r.xmlDocs + + let r = + DebuggerDisplay.debuggerDisplays + |> Map.tryFind structure.Name + |> Option.mapOrDefault r (fun f -> f r) + + match implementInterface structure with + | [||] -> r + | interfaces -> + r.members () { + for i in interfaces do + i + } + ] + + with e -> + raise + <| Exception(sprintf "createStructure on %A" structure, e) + + /// Creates F# Type Aliases or Records based on a TypeAlias + let createTypeAlias (alias: MetaModel.TypeAlias) = + let rec getType path (t: MetaModel.Type) = + if alias.Name = "LSPAny" then + JToken, [] + else + match t with + | MetaModel.Type.ReferenceType r -> LongIdent r.Name, [] + | MetaModel.Type.BaseType b -> LongIdent(b.Name.ToDotNetType()), [] + | MetaModel.Type.OrType o -> + match handleSameShapeStructuredUnions path (createField) o.Items with + | Some(x, namedAnonRecs) -> x, namedAnonRecs + | None -> + + let types = + o.Items + |> Array.mapi (fun i item -> + getType + (path + @ [ $"C{i + 1}" ]) + item + ) + + let types2 = + types + |> Array.map fst + + let namedAnonRecs = + types + |> Seq.collect snd + + let x = + types2 + |> createErasedUnion + + x, Seq.toList namedAnonRecs + | MetaModel.Type.ArrayType a -> + let (types, namedAnonRecs) = getType path a.Element + Array(types, 1), namedAnonRecs + | MetaModel.Type.StructureLiteralType l when Proposed.checkProposed l.Value -> + if + l.Value.PropertiesSafe + |> Array.isEmpty + then + JToken, [] + else + let ts = + l.Value.PropertiesSafe + |> Array.map (fun p -> + let fi = createField [ alias.Name ] p.Type p + fi.Name, fi.TypeInfo, p.StructuredDocs + ) + |> Array.toList + + let name = + path + |> String.concat "" + + LongIdent(name), + [ + let r = + Record(name) { + for (n, t, docs) in ts do + let f = Field(n, t) + + docs + |> Option.mapOrDefault f f.xmlDocs + } + + l.Value.StructuredDocs + |> Option.mapOrDefault r r.xmlDocs + ] + + | MetaModel.Type.MapType m -> + let key = + match m.Key with + | MetaModel.MapKeyType.Base b -> + b.Name.ToDotNetType() + |> LongIdent + | MetaModel.MapKeyType.ReferenceType r -> + r.Name + |> LongIdent + + let (value, namedAnonRecs) = getType path m.Value + + createDictionary [ + key + value + ], + namedAnonRecs + + | MetaModel.Type.StringLiteralType t -> String(), [] + | MetaModel.Type.TupleType t -> + let types = + + t.Items + |> Array.mapi (fun i item -> + getType + (path + @ [ "$T{i+1}" ]) + item + ) + + let namedAnonRecs = + types + |> Seq.collect snd + |> Seq.toList + + let tuple = + types + |> Array.map fst + |> Array.toList + |> Tuple + + tuple, namedAnonRecs + + | _ -> failwithf "todo Property %A" t + + let (types: WidgetBuilder, namedAnonRecs) = getType [ alias.Name ] alias.Type + + let (|AliasIsSameAsRecordName|_|) (alias: WidgetBuilder, namedAnonRecs) = + let typeAlias = Gen.mkOak alias + + let nestedRecord = + namedAnonRecs + |> Seq.tryExactlyOne + + match typeAlias, Option.map Gen.mkOak nestedRecord with + | Type.LongIdent i, Some r when (getIdent i.Content) = getIdent ((r :> ITypeDefn).TypeName.Identifier.Content) -> + nestedRecord + | _ -> None + + let abbrev = + match types, namedAnonRecs with + | AliasIsSameAsRecordName r -> + // If the record being emitted is the same as the type alias, ignore the type alias and just emit the record + AnonymousModule() { + alias.StructuredDocs + |> Option.mapOrDefault r r.xmlDocs + } + | _ -> + AnonymousModule() { + let abbrev = Abbrev(alias.Name, types) + + let abbrev = + alias.StructuredDocs + |> Option.mapOrDefault abbrev abbrev.xmlDocs + + abbrev + + for o in namedAnonRecs do + o + } + + AnonymousModule() { + + abbrev + + } + + + /// Creates Open or Closed Enums based on an Enumeration + let createEnumeration (enumeration: MetaModel.Enumeration) = + AnonymousModule() { + match enumeration.Type.Name with + | MetaModel.EnumerationTypeNameValues.String when enumeration.SupportsCustomValues = Some true -> + // This creates an "Open" enum. Essentially these are strings well known string values but allows for custom values + + let ab = Abbrev(enumeration.Name, "string") + + enumeration.StructuredDocs + |> Option.mapOrDefault ab ab.xmlDocs + + NestedModule(enumeration.Name) { + for v in enumeration.ValuesSafe do + let name = PrettyNaming.NormalizeIdentifierBackticks v.Name + let l = Value(ConstantPat(Constant(name)), ConstantExpr(String(v.Value))).attribute (Attribute "Literal") + let l = l.returnType (LongIdent enumeration.Name) + + v.StructuredDocs + |> Option.mapOrDefault l l.xmlDocs + + } + + + | MetaModel.EnumerationTypeNameValues.String -> + // Otherwise generate a normal F# closed enum with "string" values + let enum = + Enum enumeration.Name { + for i, v in + enumeration.ValuesSafe + |> Array.mapi (fun i x -> i, x) do + let case = EnumCase(v.Name, string i) + + let case = case.attribute (Attribute($"EnumMember(Value = \"{v.Value}\")")) + + v.StructuredDocs + |> Option.mapOrDefault case case.xmlDocs + } + + let enum = + enumeration.StructuredDocs + |> Option.mapOrDefault enum enum.xmlDocs + + enum.attribute (Attribute("JsonConverter(typeof)")) + + | MetaModel.EnumerationTypeNameValues.Integer + | MetaModel.EnumerationTypeNameValues.Uinteger -> // Create enums with number values + let enum = + Enum enumeration.Name { + for v in enumeration.ValuesSafe do + let case = EnumCase(String.toPascalCase v.Name, v.Value) + + v.StructuredDocs + |> Option.mapOrDefault case case.xmlDocs + } + + enumeration.StructuredDocs + |> Option.mapOrDefault enum enum.xmlDocs + | _ -> failwithf "todo Enumeration %A" enumeration + } + + + /// The main entry point to generating types from a metaModel.json file + let generateType (parsedMetaModel : MetaModel.MetaModel) outputPath = + async { + let documentUriDocs = + """ +URI's are transferred as strings. The URI's format is defined in https://tools.ietf.org/html/rfc3986 + +See: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#uri +""" + + let regexpDocs = + """ +Regular expressions are transferred as strings. + +See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#regExp +""" + + printfn "Generating Types" + + let oak = + Ast.Oak() { + Namespace("Ionide.LanguageServerProtocol.Types") { + // open namespaces we know we'll need + Open("System") + Open("System.Runtime.Serialization") + Open("System.Diagnostics") + Open("Newtonsoft.Json") + Open("Newtonsoft.Json.Linq") + + // Simple aliases for types that are not in dotnet + Abbrev("URI", "string") + .xmlDocs ( + documentUriDocs + |> StructuredDocs.parse + ) + + Abbrev("DocumentUri", "string") + .xmlDocs ( + documentUriDocs + |> StructuredDocs.parse + ) + + Abbrev("RegExp", "string") + .xmlDocs ( + regexpDocs + |> StructuredDocs.parse + ) + + // Generate Interfaces + let structures = parsedMetaModel.StructuresSafe + + let (knownInterfaces, interfaceWidgets) = + createInterfaceStructures structures parsedMetaModel + |> Array.unzip + + + for w in interfaceWidgets do + w + + let records = ResizeArray<_>() + + for s in structures do + if isUnitStructure s then + Abbrev(s.Name, "unit") + else + createStructure s knownInterfaces parsedMetaModel + |> List.map (fun r -> + + let name = + let x = Gen.mkOak r :> ITypeDefn + + x.TypeName.Identifier.Content + |> getIdent + + + name, r + ) + |> records.AddRange + + for r in + records + |> Seq.distinctBy fst + |> Seq.map snd do + r + // Generate Type Aliases + for t in parsedMetaModel.TypeAliasesSafe do + createTypeAlias t + + // Generate Enumerations + for e in parsedMetaModel.EnumerationsSafe do + createEnumeration e + } + |> fun x -> x.toRecursive () + } + + + printfn "Writing to %s" outputPath + let writeToFile path contents = File.WriteAllTextAsync(path, contents) + + let! formattedText = + oak + |> Gen.mkOak + |> CodeFormatter.FormatOakAsync + + do! + formattedText + |> writeToFile outputPath + |> Async.AwaitTask + } \ No newline at end of file diff --git a/tools/MetaModelGenerator/MetaModel.fs b/tools/MetaModelGenerator/MetaModel.fs new file mode 100644 index 0000000..9ed8934 --- /dev/null +++ b/tools/MetaModelGenerator/MetaModel.fs @@ -0,0 +1,479 @@ +namespace MetaModelGenerator + + +type StructuredDocs = string list + +module StructuredDocs = + let parse (s: string) = + s.Trim('\n').Split([| '\n' |]) + |> Array.toList + +module Proposed = + let skipProposed = true + + let inline checkProposed x = + if skipProposed then + (^a: (member Proposed: bool option) x) + <> Some true + else + true + +module Preconverts = + open Newtonsoft.Json + open Newtonsoft.Json.Linq + + type SingleOrArrayConverter<'T>() = + inherit JsonConverter() + + override x.CanConvert(tobject: System.Type) = tobject = typeof<'T array> + + override _.WriteJson(writer: JsonWriter, value, serializer: JsonSerializer) : unit = + failwith "Should never be writing this structure, it comes from Microsoft LSP Spec" + + override _.ReadJson(reader: JsonReader, objectType: System.Type, existingValue: obj, serializer: JsonSerializer) = + let token = JToken.Load reader + + match token.Type with + | JTokenType.Array -> serializer.Deserialize(reader, objectType) + | JTokenType.Null -> null + | _ -> Some [| token.ToObject<'T>(serializer) |] + +module rec MetaModel = + open System + open Newtonsoft.Json.Linq + open Newtonsoft.Json + open Ionide.LanguageServerProtocol + + type MetaData = { Version: string } + + /// Indicates in which direction a message is sent in the protocol. + [)>] + type MessageDirection = + | ClientToServer = 0 + | ServerToClient = 1 + | Both = 2 + + /// Represents a LSP request + type Request = { + /// Whether the request is deprecated or not. If deprecated the property contains the deprecation message." + Deprecated: string option + /// An optional documentation; + Documentation: string option + /// An optional error data type. + ErrorData: Type option + /// The direction in which this request is sent in the protocol. + MessageDirection: MessageDirection + /// The request's method name. + Method: string + /// The parameter type(s) if any. + [>)>] + Params: Type array option + /// Optional partial result type if the request supports partial result reporting. + PartialResult: Type option + /// Whether this is a proposed feature. If omitted the feature is final.", + Proposed: bool option + /// Optional a dynamic registration method if it different from the request's method." + RegistrationMethod: string option + /// Optional registration options if the request supports dynamic registration." + RegistrationOptions: Type option + /// The result type. + Result: Type + /// Since when (release number) this request is available. Is undefined if not known.", + Since: string option + } with + + member x.ParamsSafe = + x.Params + |> Option.Array.toArray + + /// Represents a LSP notification + type Notification = { + + /// Whether the notification is deprecated or not. If deprecated the property contains the deprecation message." + Deprecated: string option + /// An optional documentation; + Documentation: string option + /// The direction in which this notification is sent in the protocol. + MessageDirection: MessageDirection + /// The request's method name. + Method: string + /// The parameter type(s) if any. + [>)>] + Params: Type array option + /// Whether this is a proposed feature. If omitted the notification is final.", + Proposed: bool option + /// Optional a dynamic registration method if it different from the request's method." + RegistrationMethod: string option + /// Optional registration options if the notification supports dynamic registration." + RegistrationOptions: Type option + /// Since when (release number) this notification is available. Is undefined if not known.", + Since: string option + } with + + member x.ParamsSafe = + x.Params + |> Option.Array.toArray + + [] + type BaseTypes = + | Uri + | DocumentUri + | Integer + | Uinteger + | Decimal + | RegExp + | String + | Boolean + | Null + + static member Parse(s: string) = + match s with + | "URI" -> Uri + | "DocumentUri" -> DocumentUri + | "integer" -> Integer + | "uinteger" -> Uinteger + | "decimal" -> Decimal + | "RegExp" -> RegExp + | "string" -> String + | "boolean" -> Boolean + | "null" -> Null + | _ -> failwithf "Unknown base type: %s" s + + member x.ToDotNetType() = + match x with + | Uri -> "URI" + | DocumentUri -> "DocumentUri" + | Integer -> "int32" + | Uinteger -> "uint32" + | Decimal -> "decimal" + | RegExp -> "RegExp" + | String -> "string" + | Boolean -> "bool" + | Null -> "null" + + [] + let BaseTypeConst = "base" + + type BaseType = { Kind: string; Name: BaseTypes } + + [] + let ReferenceTypeConst = "reference" + + type ReferenceType = { Kind: string; Name: string } + + [] + let ArrayTypeConst = "array" + + type ArrayType = { Kind: string; Element: Type } + + [] + let MapTypeConst = "map" + + type MapType = { Kind: string; Key: MapKeyType; Value: Type } + + [] + type MapKeyNameEnum = + | Uri + | DocumentUri + | String + | Integer + + static member Parse(s: string) = + match s with + | "URI" -> Uri + | "DocumentUri" -> DocumentUri + | "string" -> String + | "integer" -> Integer + | _ -> failwithf "Unknown map key name: %s" s + + member x.ToDotNetType() = + match x with + | Uri -> "URI" + | DocumentUri -> "DocumentUri" + | String -> "string" + | Integer -> "int32" + + [] + type MapKeyType = + | ReferenceType of ReferenceType + | Base of {| Kind: string; Name: MapKeyNameEnum |} + + [] + let AndTypeConst = "and" + + type AndType = { Kind: string; Items: Type array } + + [] + let OrTypeConst = "or" + + type OrType = { Kind: string; Items: Type array } + + [] + let TupleTypeConst = "tuple" + + type TupleType = { Kind: string; Items: Type array } + + type Property = { + Deprecated: string option + Documentation: string option + Name: string + Optional: bool option + Proposed: bool option + Required: bool option + Since: string option + Type: Type + } with + + member x.IsOptional = + x.Optional + |> Option.defaultValue false + + member x.NameAsPascalCase = String.toPascalCase x.Name + + member x.StructuredDocs = + x.Documentation + |> Option.map StructuredDocs.parse + + + [] + let StructureTypeLiteral = "literal" + + type StructureLiteral = { + Deprecated: string option + Documentation: string option + Properties: Property array + Proposed: bool option + Since: string option + } with + + member x.StructuredDocs = + x.Documentation + |> Option.map StructuredDocs.parse + + member x.PropertiesSafe = + x.Properties + |> Array.filter Proposed.checkProposed + + type StructureLiteralType = { Kind: string; Value: StructureLiteral } + + [] + let StringLiteralTypeConst = "stringLiteral" + + type StringLiteralType = { Kind: string; Value: string } + + [] + let IntegerLiteralTypeConst = "integerLiteral" + + type IntegerLiteralType = { Kind: string; Value: decimal } + + [] + let BooleanLiteralTypeConst = "booleanLiteral" + + type BooleanLiteralType = { Kind: string; Value: bool } + + [] + type Type = + | BaseType of BaseType + | ReferenceType of ReferenceType + | ArrayType of ArrayType + | MapType of MapType + | AndType of AndType + | OrType of OrType + | TupleType of TupleType + | StructureLiteralType of StructureLiteralType + | StringLiteralType of StringLiteralType + | IntegerLiteralType of IntegerLiteralType + | BooleanLiteralType of BooleanLiteralType + + member x.isStructureLiteralType = + match x with + | StructureLiteralType _ -> true + | _ -> false + + + type Structure = { + Deprecated: string option + Documentation: string option + Extends: Type array option + Mixins: Type array option + Name: string + Properties: Property array option + Proposed: bool option + Since: string option + } with + + member x.ExtendsSafe = Option.Array.toArray x.Extends + member x.MixinsSafe = Option.Array.toArray x.Mixins + + member x.PropertiesSafe = + Option.Array.toArray x.Properties + |> Seq.filter Proposed.checkProposed + + member x.StructuredDocs = + x.Documentation + |> Option.map StructuredDocs.parse + + type TypeAlias = { + Deprecated: string option + Documentation: string option + Name: string + Proposed: bool option + Since: string option + Type: Type + } with + + member x.StructuredDocs = + x.Documentation + |> Option.map StructuredDocs.parse + + [)>] + type EnumerationTypeNameValues = + | String = 0 + | Integer = 1 + | Uinteger = 2 + + type EnumerationType = { Kind: string; Name: EnumerationTypeNameValues } + + type EnumerationEntry = { + Deprecated: string option + Documentation: string option + + Name: string + Proposed: bool option + Since: string option + Value: string + } with + + member x.StructuredDocs = + x.Documentation + |> Option.map StructuredDocs.parse + + type Enumeration = { + Deprecated: string option + Documentation: string option + Name: string + Proposed: bool option + Since: string option + SupportsCustomValues: bool option + Type: EnumerationType + Values: EnumerationEntry array + } with + + member x.StructuredDocs = + x.Documentation + |> Option.map StructuredDocs.parse + + member x.ValuesSafe = + x.Values + |> Array.filter Proposed.checkProposed + + type MetaModel = { + MetaData: MetaData + Requests: Request array + Notifications: Notification array + Structures: Structure array + TypeAliases: TypeAlias array + Enumerations: Enumeration array + } with + + member x.StructuresSafe = + x.Structures + |> Array.filter Proposed.checkProposed + + member x.TypeAliasesSafe = + x.TypeAliases + |> Array.filter Proposed.checkProposed + + member x.EnumerationsSafe = + x.Enumerations + |> Array.filter Proposed.checkProposed + + module Converters = + + type MapKeyTypeConverter() = + inherit JsonConverter() + + override _.WriteJson(writer: JsonWriter, value: MapKeyType, serializer: JsonSerializer) : unit = + failwith "Should never be writing this structure, it comes from Microsoft LSP Spec" + + override _.ReadJson + ( + reader: JsonReader, + objectType: System.Type, + existingValue: MapKeyType, + hasExistingValue, + serializer: JsonSerializer + ) = + let jobj = JObject.Load(reader) + let kind = jobj.["kind"].Value() + + match kind with + | ReferenceTypeConst -> + let name = jobj.["name"].Value() + MapKeyType.ReferenceType { Kind = kind; Name = name } + | "base" -> + let name = jobj.["name"].Value() + MapKeyType.Base {| Kind = kind; Name = MapKeyNameEnum.Parse name |} + | _ -> failwithf "Unknown map key type: %s" kind + + type TypeConverter() = + inherit JsonConverter() + + override _.WriteJson(writer: JsonWriter, value: MetaModel.Type, serializer: JsonSerializer) : unit = + failwith "Should never be writing this structure, it comes from Microsoft LSP Spec" + + override _.ReadJson + ( + reader: JsonReader, + objectType: System.Type, + existingValue: Type, + hasExistingValue, + serializer: JsonSerializer + ) = + let jobj = JObject.Load(reader) + let kind = jobj.["kind"].Value() + + match kind with + | BaseTypeConst -> + let name = jobj.["name"].Value() + Type.BaseType { Kind = kind; Name = BaseTypes.Parse name } + | ReferenceTypeConst -> + let name = jobj.["name"].Value() + Type.ReferenceType { Kind = kind; Name = name } + | ArrayTypeConst -> + let element = jobj.["element"].ToObject(serializer) + Type.ArrayType { Kind = kind; Element = element } + | MapTypeConst -> + let key = jobj.["key"].ToObject(serializer) + let value = jobj.["value"].ToObject(serializer) + Type.MapType { Kind = kind; Key = key; Value = value } + | AndTypeConst -> + let items = jobj.["items"].ToObject(serializer) + Type.AndType { Kind = kind; Items = items } + | OrTypeConst -> + let items = jobj.["items"].ToObject(serializer) + Type.OrType { Kind = kind; Items = items } + | TupleTypeConst -> + let items = jobj.["items"].ToObject(serializer) + Type.TupleType { Kind = kind; Items = items } + | StructureTypeLiteral -> + let value = jobj.["value"].ToObject(serializer) + Type.StructureLiteralType { Kind = kind; Value = value } + | StringLiteralTypeConst -> + let value = jobj.["value"].Value() + Type.StringLiteralType { Kind = kind; Value = value } + | IntegerLiteralTypeConst -> + let value = jobj.["value"].Value() + Type.IntegerLiteralType { Kind = kind; Value = value } + | BooleanLiteralTypeConst -> + let value = jobj.["value"].Value() + Type.BooleanLiteralType { Kind = kind; Value = value } + | _ -> failwithf "Unknown type kind: %s" kind + + + let metaModelSerializerSettings = + let settings = JsonSerializerSettings() + settings.Converters.Add(Converters.TypeConverter() :> JsonConverter) + settings.Converters.Add(Converters.MapKeyTypeConverter() :> JsonConverter) + settings.Converters.Add(JsonUtils.OptionConverter() :> JsonConverter) + settings \ No newline at end of file diff --git a/tools/MetaModelGenerator/MetaModelGenerator.fsproj b/tools/MetaModelGenerator/MetaModelGenerator.fsproj new file mode 100644 index 0000000..83faa13 --- /dev/null +++ b/tools/MetaModelGenerator/MetaModelGenerator.fsproj @@ -0,0 +1,19 @@ + + + Exe + net8.0 + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/MetaModelGenerator/PrimitiveExtensions.fs b/tools/MetaModelGenerator/PrimitiveExtensions.fs new file mode 100644 index 0000000..4d64968 --- /dev/null +++ b/tools/MetaModelGenerator/PrimitiveExtensions.fs @@ -0,0 +1,40 @@ +namespace MetaModelGenerator + +module Option = + module Array = + /// Returns true if the given array is empty or None + let isEmpty (x: 'a array option) = + match x with + | None -> true + | Some x -> Array.isEmpty x + + /// Returns empty array if None, otherwise the array + let toArray (x: 'a array option) = Option.defaultValue [||] x + + let mapOrDefault def f o = + match o with + | Some o -> f o + | None -> def + +module String = + open System + + let toPascalCase (s: string) = + s.[0] + |> Char.ToUpper + |> fun c -> + c.ToString() + + s.Substring(1) + +module Array = + /// Places separator between each element of items + let intersperse (separator: 'a) (items: 'a array) : 'a array = [| + let mutable notFirst = false + + for element in items do + if notFirst then + yield separator + + yield element + notFirst <- true + |] \ No newline at end of file diff --git a/tools/MetaModelGenerator/Program.fs b/tools/MetaModelGenerator/Program.fs new file mode 100644 index 0000000..9654a99 --- /dev/null +++ b/tools/MetaModelGenerator/Program.fs @@ -0,0 +1,101 @@ +namespace MetaModelGenerator + +module Main = + open Argu + open System + open Newtonsoft.Json + open System.IO + + type TypeArgs = + | MetaModelPath of string + | OutputFilePath of string + interface IArgParserTemplate with + member this.Usage: string = + match this with + | MetaModelPath _ -> "The path to metaModel.json. See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#metaModel" + | OutputFilePath _ -> "The path to the output file. Should end with .fs" + + type ClientServerArgs = + | MetaModelPath of string + | OutputFilePath of string + interface IArgParserTemplate with + member this.Usage: string = + match this with + | MetaModelPath _ -> "The path to metaModel.json. See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#metaModel" + | OutputFilePath _ -> "The path to the output file. Should end with .fs" + + type CommandArgs = + | [] Types of ParseResults + // | [] ClientServer of ParseResults + interface IArgParserTemplate with + member this.Usage = + match this with + | Types _ -> "Generates Types from metaModel.json." + // | ClientServer _ -> "Generates Client/Server" + let readMetaModel metamodelPath = async { + + printfn "Reading in %s" metamodelPath + + let! metaModel = + File.ReadAllTextAsync(metamodelPath) + |> Async.AwaitTask + + printfn "Deserializing metaModel" + + let parsedMetaModel = + JsonConvert.DeserializeObject(metaModel, MetaModel.metaModelSerializerSettings) + + return parsedMetaModel + } + + + [] + let main argv = + + let errorHandler = ProcessExiter(colorizer = function ErrorCode.HelpText -> None | _ -> Some ConsoleColor.Red) + let parser = ArgumentParser.Create(programName = "MetaModelGenerator", errorHandler = errorHandler) + + let results = parser.ParseCommandLine argv + match results.GetSubCommand() with + | Types r -> + let metaModelPath = r.GetResult <@ TypeArgs.MetaModelPath @> + let OutputFilePath = r.GetResult <@ TypeArgs.OutputFilePath @> + let metaModel = readMetaModel metaModelPath |> Async.RunSynchronously + GenerateTypes.generateType metaModel OutputFilePath |> Async.RunSynchronously + + // | ClientServer r -> + + // let metaModelPath = r.GetResult <@ ClientServerArgs.MetaModelPath @> + // let OutputFilePath = r.GetResult <@ ClientServerArgs.OutputFilePath @> + // let metaModel = readMetaModel metaModelPath |> Async.RunSynchronously + + // let requests = + // metaModel.Requests + // |> Array.groupBy(fun x ->x.MessageDirection) + // |> Map + // let notifications = + // metaModel.Notifications + // |> Array.groupBy(fun x -> x.MessageDirection) + // |> Map + + // printfn "Server: " + // printfn " Requests: " + // for request in requests.[MetaModel.MessageDirection.ClientToServer] do + // printfn " - %s %A " request.Method request.ParamsSafe + // printfn " Notifications: " + // for request in notifications.[MetaModel.MessageDirection.ClientToServer] |> Array.append notifications.[MetaModel.MessageDirection.Both] do + // printfn " - %s %A" request.Method request.ParamsSafe + // () + // printfn "" + + + // printfn "Client: " + // printfn " Requests: " + // for request in requests.[MetaModel.MessageDirection.ServerToClient] do + // printfn " - %s %A " request.Method request.ParamsSafe + // printfn " Notifications: " + // for request in notifications.[MetaModel.MessageDirection.ServerToClient] |> Array.append notifications.[MetaModel.MessageDirection.Both] do + // printfn " - %s %A" request.Method request.ParamsSafe + // () + + 0 \ No newline at end of file