Skip to content

Instantly share code, notes, and snippets.

@bollwyvl
Last active May 29, 2026 09:52
Show Gist options
  • Select an option

  • Save bollwyvl/7a128978b8ae89ab02bbd5b84d07a4b7 to your computer and use it in GitHub Desktop.

Select an option

Save bollwyvl/7a128978b8ae89ab02bbd5b84d07a4b7 to your computer and use it in GitHub Desktop.
Towards a JSON Schema for the Language Server Protocol
name: lsp-json-schema
channels:
- conda-forge
dependencies:
- black
- git
- hypothesis
- hypothesis-jsonschema
- importnb
- ipywidgets
- isort
- jupyterlab ==1.1.4
- mypy
- nodejs
- pandas
- pip
- pyemojify
- pytest
- python >=3.7,<3.8.0a0
- python-language-server
- pyyaml
- pip:
- pyls-black
- pyls-isort
- pyls-mypy
{
"$ref": "#/definitions/_AnyFeature",
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"ApplyWorkspaceEditParams": {
"additionalProperties": false,
"description": "The parameters passed via a apply workspace edit request.",
"properties": {
"edit": {
"$ref": "#/definitions/WorkspaceEdit",
"description": "The edits to apply."
},
"label": {
"description": "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.",
"type": "string"
}
},
"required": [
"edit"
],
"type": "object"
},
"ApplyWorkspaceEditResponse": {
"additionalProperties": false,
"description": "A response returned from the apply workspace edit request.",
"properties": {
"applied": {
"description": "Indicates whether the edit was applied or not.",
"type": "boolean"
},
"failedChange": {
"description": "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.",
"type": "number"
},
"failureReason": {
"description": "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.",
"type": "string"
}
},
"required": [
"applied"
],
"type": "object"
},
"CancelParams": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id to cancel.",
"type": [
"number",
"string"
]
}
},
"required": [
"id"
],
"type": "object"
},
"ClientCapabilities": {
"additionalProperties": false,
"properties": {
"dynamicRegistration": {
"description": "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.",
"type": "boolean"
},
"experimental": {
"description": "Experimental client capabilities."
},
"textDocument": {
"$ref": "#/definitions/TextDocumentClientCapabilities",
"description": "Text document specific client capabilities."
},
"window": {
"description": "Window specific client capabilities.",
"type": "object"
},
"workspace": {
"$ref": "#/definitions/WorkspaceClientCapabilities",
"additionalProperties": false,
"description": "Workspace specific client capabilities.",
"properties": {
"configuration": {
"description": "The client supports `workspace/configuration` requests.",
"type": "boolean"
},
"workspaceFolders": {
"description": "The client has support for workspace folders",
"type": "boolean"
}
},
"type": "object"
}
},
"type": "object"
},
"CodeAction": {
"additionalProperties": false,
"description": "A code action represents a change that can be performed in code, e.g. to fix a problem or\r\nto refactor code.\r\n\r\nA CodeAction must set either `edit` and/or a `command`. If both are supplied, the `edit` is applied first, then the `command` is executed.",
"properties": {
"command": {
"$ref": "#/definitions/Command",
"description": "A command this code action executes. If a code action\r\nprovides a edit and a command, first the edit is\r\nexecuted and then the command."
},
"diagnostics": {
"description": "The diagnostics that this code action resolves.",
"items": {
"$ref": "#/definitions/Diagnostic"
},
"type": "array"
},
"edit": {
"$ref": "#/definitions/WorkspaceEdit",
"description": "The workspace edit this code action performs."
},
"isPreferred": {
"description": "Marks this as a preferred action. Preferred actions are used by the `auto fix` command and can be targeted\r\nby keybindings.\r\n\r\nA quick fix should be marked preferred if it properly addresses the underlying error.\r\nA refactoring should be marked preferred if it is the most reasonable choice of actions to take.",
"type": "boolean"
},
"kind": {
"$ref": "#/definitions/CodeActionKind",
"description": "The kind of the code action.\r\n\r\nUsed to filter code actions."
},
"title": {
"description": "A short, human-readable, title for this code action.",
"type": "string"
}
},
"required": [
"title"
],
"type": "object"
},
"CodeActionClientCapabilities": {
"additionalProperties": false,
"description": "The Client Capabilities of a [CodeActionRequest](#CodeActionRequest).",
"properties": {
"codeActionLiteralSupport": {
"additionalProperties": false,
"description": "The client support code action literals as a valid\nresponse of the `textDocument/codeAction` request.",
"properties": {
"codeActionKind": {
"additionalProperties": false,
"description": "The code action kind is support with the following value\nset.",
"properties": {
"valueSet": {
"description": "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.",
"items": {
"$ref": "#/definitions/CodeActionKind"
},
"type": "array"
}
},
"required": [
"valueSet"
],
"type": "object"
}
},
"required": [
"codeActionKind"
],
"type": "object"
},
"dynamicRegistration": {
"description": "Whether code action supports dynamic registration.",
"type": "boolean"
},
"isPreferredSupport": {
"description": "Whether code action supports the `isPreferred` property.",
"type": "boolean"
}
},
"type": "object"
},
"CodeActionContext": {
"additionalProperties": false,
"description": "Contains additional diagnostic information about the context in which\r\na [code action](#CodeActionProvider.provideCodeActions) is run. \n The CodeActionContext namespace provides helper functions to work with\r\n[CodeActionContext](#CodeActionContext) literals.",
"properties": {
"diagnostics": {
"description": "An array of diagnostics known on the client side overlapping the range provided to the\r\n`textDocument/codeAction` request. They are provied so that the server knows which\r\nerrors are currently presented to the user for the given range. There is no guarantee\r\nthat these accurately reflect the error state of the resource. The primary parameter\r\nto compute code actions is the provided range.",
"items": {
"$ref": "#/definitions/Diagnostic"
},
"type": "array"
},
"only": {
"description": "Requested kind of actions to return.\r\n\r\nActions not of this kind are filtered out by the client before being shown. So servers\r\ncan omit computing them.",
"items": {
"$ref": "#/definitions/CodeActionKind"
},
"type": "array"
}
},
"required": [
"diagnostics"
],
"type": "object"
},
"CodeActionKind": {
"description": "The kind of a code action.\r\n\r\nKinds are a hierarchical list of identifiers separated by `.`, e.g. `\"refactor.extract.function\"`.\r\n\r\nThe set of kinds is open and client needs to announce the kinds it supports to the server during\r\ninitialization. \n A set of predefined code action kinds",
"type": "string"
},
"CodeActionOptions": {
"additionalProperties": false,
"description": "Provider options for a [CodeActionRequest](#CodeActionRequest).",
"properties": {
"codeActionKinds": {
"description": "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.",
"items": {
"$ref": "#/definitions/CodeActionKind"
},
"type": "array"
},
"workDoneProgress": {
"type": "boolean"
}
},
"type": "object"
},
"CodeActionParams": {
"additionalProperties": false,
"description": "The parameters of a [CodeActionRequest](#CodeActionRequest).",
"properties": {
"context": {
"$ref": "#/definitions/CodeActionContext",
"description": "Context carrying additional information."
},
"partialResultToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report partial results (e.g. streaming) to\nthe client."
},
"range": {
"$ref": "#/definitions/Range",
"description": "The range for which the command was invoked."
},
"textDocument": {
"$ref": "#/definitions/TextDocumentIdentifier",
"description": "The document in which the command was invoked."
},
"workDoneToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report work done progress."
}
},
"required": [
"textDocument",
"range",
"context"
],
"type": "object"
},
"CodeLens": {
"additionalProperties": false,
"description": "A code lens represents a [command](#Command) that should be shown along with\r\nsource text, like the number of references, a way to run tests, etc.\r\n\r\nA code lens is _unresolved_ when no command is associated to it. For performance\r\nreasons the creation of a code lens and resolving should be done to two stages. \n The CodeLens namespace provides helper functions to work with\r\n[CodeLens](#CodeLens) literals.",
"properties": {
"command": {
"$ref": "#/definitions/Command",
"description": "The command this code lens represents."
},
"data": {
"description": "An data entry field that is preserved on a code lens item between\r\na [CodeLensRequest](#CodeLensRequest) and a [CodeLensResolveRequest]\r\n(#CodeLensResolveRequest)"
},
"range": {
"$ref": "#/definitions/Range",
"description": "The range in which this code lens is valid. Should only span a single line."
}
},
"required": [
"range"
],
"type": "object"
},
"CodeLensClientCapabilities": {
"additionalProperties": false,
"description": "The client capabilities of a [CodeLensRequest](#CodeLensRequest).",
"properties": {
"dynamicRegistration": {
"description": "Whether code lens supports dynamic registration.",
"type": "boolean"
}
},
"type": "object"
},
"CodeLensOptions": {
"additionalProperties": false,
"description": "Code Lens provider options of a [CodeLensRequest](#CodeLensRequest).",
"properties": {
"resolveProvider": {
"description": "Code lens has a resolve provider as well.",
"type": "boolean"
},
"workDoneProgress": {
"type": "boolean"
}
},
"type": "object"
},
"CodeLensParams": {
"additionalProperties": false,
"description": "The parameters of a [CodeLensRequest](#CodeLensRequest).",
"properties": {
"partialResultToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report partial results (e.g. streaming) to\nthe client."
},
"textDocument": {
"$ref": "#/definitions/TextDocumentIdentifier",
"description": "The document to request code lens for."
},
"workDoneToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report work done progress."
}
},
"required": [
"textDocument"
],
"type": "object"
},
"Color": {
"additionalProperties": false,
"description": "Represents a color in RGBA space. \n The Color namespace provides helper functions to work with\r\n[Color](#Color) literals.",
"properties": {
"alpha": {
"description": "The alpha component of this color in the range [0-1].",
"type": "number"
},
"blue": {
"description": "The blue component of this color in the range [0-1].",
"type": "number"
},
"green": {
"description": "The green component of this color in the range [0-1].",
"type": "number"
},
"red": {
"description": "The red component of this color in the range [0-1].",
"type": "number"
}
},
"required": [
"red",
"green",
"blue",
"alpha"
],
"type": "object"
},
"ColorInformation": {
"additionalProperties": false,
"description": "Represents a color range from a document. \n The ColorInformation namespace provides helper functions to work with\r\n[ColorInformation](#ColorInformation) literals.",
"properties": {
"color": {
"$ref": "#/definitions/Color",
"description": "The actual color value for this color range."
},
"range": {
"$ref": "#/definitions/Range",
"description": "The range in the document where this color appers."
}
},
"required": [
"range",
"color"
],
"type": "object"
},
"ColorPresentation": {
"additionalProperties": false,
"description": "The Color namespace provides helper functions to work with\r\n[ColorPresentation](#ColorPresentation) literals.",
"properties": {
"additionalTextEdits": {
"description": "An optional array of additional [text edits](#TextEdit) that are applied when\r\nselecting this color presentation. Edits must not overlap with the main [edit](#ColorPresentation.textEdit) nor with themselves.",
"items": {
"$ref": "#/definitions/TextEdit"
},
"type": "array"
},
"label": {
"description": "The label of this color presentation. It will be shown on the color\r\npicker header. By default this is also the text that is inserted when selecting\r\nthis color presentation.",
"type": "string"
},
"textEdit": {
"$ref": "#/definitions/TextEdit",
"description": "An [edit](#TextEdit) which is applied to a document when selecting\r\nthis presentation for the color. When `falsy` the [label](#ColorPresentation.label)\r\nis used."
}
},
"required": [
"label"
],
"type": "object"
},
"ColorPresentationParams": {
"additionalProperties": false,
"description": "Parameters for a [ColorPresentationRequest](#ColorPresentationRequest).",
"properties": {
"color": {
"$ref": "#/definitions/Color",
"description": "The color to request presentations for."
},
"partialResultToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report partial results (e.g. streaming) to\nthe client."
},
"range": {
"$ref": "#/definitions/Range",
"description": "The range where the color would be inserted. Serves as a context."
},
"textDocument": {
"$ref": "#/definitions/TextDocumentIdentifier",
"description": "The text document."
},
"workDoneToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report work done progress."
}
},
"required": [
"textDocument",
"color",
"range"
],
"type": "object"
},
"Command": {
"additionalProperties": false,
"description": "Represents a reference to a command. Provides a title which\r\nwill be used to represent a command in the UI and, optionally,\r\nan array of arguments which will be passed to the command handler\r\nfunction when invoked. \n The Command namespace provides helper functions to work with\r\n[Command](#Command) literals.",
"properties": {
"arguments": {
"description": "Arguments that the command handler should be\r\ninvoked with.",
"items": {
},
"type": "array"
},
"command": {
"description": "The identifier of the actual command handler.",
"type": "string"
},
"title": {
"description": "Title of the command, like `save`.",
"type": "string"
}
},
"required": [
"title",
"command"
],
"type": "object"
},
"CompletionClientCapabilities": {
"additionalProperties": false,
"description": "Completion client capabilities",
"properties": {
"completionItem": {
"additionalProperties": false,
"description": "The client supports the following `CompletionItem` specific\ncapabilities.",
"properties": {
"commitCharactersSupport": {
"description": "Client supports commit characters on a completion item.",
"type": "boolean"
},
"deprecatedSupport": {
"description": "Client supports the deprecated property on a completion item.",
"type": "boolean"
},
"documentationFormat": {
"description": "Client supports the follow content formats for the documentation\nproperty. The order describes the preferred format of the client.",
"items": {
"$ref": "#/definitions/MarkupKind"
},
"type": "array"
},
"preselectSupport": {
"description": "Client supports the preselect property on a completion item.",
"type": "boolean"
},
"snippetSupport": {
"description": "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.",
"type": "boolean"
},
"tagSupport": {
"additionalProperties": false,
"description": "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.",
"properties": {
"valueSet": {
"description": "The tags supported by the client.",
"items": {
"$ref": "#/definitions/CompletionItemTag"
},
"type": "array"
}
},
"required": [
"valueSet"
],
"type": "object"
}
},
"type": "object"
},
"completionItemKind": {
"additionalProperties": false,
"properties": {
"valueSet": {
"description": "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.",
"items": {
"$ref": "#/definitions/CompletionItemKind"
},
"type": "array"
}
},
"type": "object"
},
"contextSupport": {
"description": "The client supports to send additional context information for a\n`textDocument/completion` requestion.",
"type": "boolean"
},
"dynamicRegistration": {
"description": "Whether completion supports dynamic registration.",
"type": "boolean"
}
},
"type": "object"
},
"CompletionContext": {
"additionalProperties": false,
"description": "Contains additional information about the context in which a completion request is triggered.",
"properties": {
"triggerCharacter": {
"description": "The trigger character (a single character) that has trigger code complete.\nIs undefined if `triggerKind !== CompletionTriggerKind.TriggerCharacter`",
"type": "string"
},
"triggerKind": {
"$ref": "#/definitions/CompletionTriggerKind",
"description": "How the completion was triggered."
}
},
"required": [
"triggerKind"
],
"type": "object"
},
"CompletionItem": {
"additionalProperties": false,
"description": "A completion item represents a text snippet that is\r\nproposed to complete text that is being typed. \n The CompletionItem namespace provides functions to deal with\r\ncompletion items.",
"properties": {
"additionalTextEdits": {
"description": "An optional array of additional [text edits](#TextEdit) that are applied when\r\nselecting this completion. Edits must not overlap (including the same insert position)\r\nwith the main [edit](#CompletionItem.textEdit) nor with themselves.\r\n\r\nAdditional text edits should be used to change text unrelated to the current cursor position\r\n(for example adding an import statement at the top of the file if the completion item will\r\ninsert an unqualified type).",
"items": {
"$ref": "#/definitions/TextEdit"
},
"type": "array"
},
"command": {
"$ref": "#/definitions/Command",
"description": "An optional [command](#Command) that is executed *after* inserting this completion. *Note* that\r\nadditional modifications to the current document should be described with the\r\n[additionalTextEdits](#CompletionItem.additionalTextEdits)-property."
},
"commitCharacters": {
"description": "An optional set of characters that when pressed while this completion is active will accept it first and\r\nthen type that character. *Note* that all commit characters should have `length=1` and that superfluous\r\ncharacters will be ignored.",
"items": {
"type": "string"
},
"type": "array"
},
"data": {
"description": "An data entry field that is preserved on a completion item between\r\na [CompletionRequest](#CompletionRequest) and a [CompletionResolveRequest]\r\n(#CompletionResolveRequest)"
},
"deprecated": {
"description": "Indicates if this item is deprecated.",
"type": "boolean"
},
"detail": {
"description": "A human-readable string with additional information\r\nabout this item, like type or symbol information.",
"type": "string"
},
"documentation": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/definitions/MarkupContent"
}
],
"description": "A human-readable string that represents a doc-comment."
},
"filterText": {
"description": "A string that should be used when filtering a set of\r\ncompletion items. When `falsy` the [label](#CompletionItem.label)\r\nis used.",
"type": "string"
},
"insertText": {
"description": "A string that should be inserted into a document when selecting\r\nthis completion. When `falsy` the [label](#CompletionItem.label)\r\nis used.\r\n\r\nThe `insertText` is subject to interpretation by the client side.\r\nSome tools might not take the string literally. For example\r\nVS Code when code complete is requested in this example `con<cursor position>`\r\nand a completion item with an `insertText` of `console` is provided it\r\nwill only insert `sole`. Therefore it is recommended to use `textEdit` instead\r\nsince it avoids additional client side interpretation.",
"type": "string"
},
"insertTextFormat": {
"$ref": "#/definitions/InsertTextFormat",
"description": "The format of the insert text. The format applies to both the `insertText` property\r\nand the `newText` property of a provided `textEdit`."
},
"kind": {
"$ref": "#/definitions/CompletionItemKind",
"description": "The kind of this completion item. Based of the kind\r\nan icon is chosen by the editor."
},
"label": {
"description": "The label of this completion item. By default\r\nalso the text that is inserted when selecting\r\nthis completion.",
"type": "string"
},
"preselect": {
"description": "Select this item when showing.\r\n\r\n*Note* that only one completion item can be selected and that the\r\ntool / client decides which item that is. The rule is that the *first*\r\nitem of those that match best is selected.",
"type": "boolean"
},
"sortText": {
"description": "A string that should be used when comparing this item\r\nwith other items. When `falsy` the [label](#CompletionItem.label)\r\nis used.",
"type": "string"
},
"tags": {
"description": "Tags for this completion item.",
"items": {
"$ref": "#/definitions/CompletionItemTag"
},
"type": "array"
},
"textEdit": {
"$ref": "#/definitions/TextEdit",
"description": "An [edit](#TextEdit) which is applied to a document when selecting\r\nthis completion. When an edit is provided the value of\r\n[insertText](#CompletionItem.insertText) is ignored.\r\n\r\n*Note:* The text edit's range must be a [single line] and it must contain the position\r\nat which completion has been requested."
}
},
"required": [
"label"
],
"type": "object"
},
"CompletionItemKind": {
"description": "The kind of a completion entry.",
"enum": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25
],
"type": "number"
},
"CompletionItemTag": {
"description": "Completion item tags are extra annotations that tweak the rendering of a completion\r\nitem.",
"enum": [
1
],
"type": "number"
},
"CompletionList": {
"additionalProperties": false,
"description": "Represents a collection of [completion items](#CompletionItem) to be presented\r\nin the editor. \n The CompletionList namespace provides functions to deal with\r\ncompletion lists.",
"properties": {
"isIncomplete": {
"description": "This list it not complete. Further typing results in recomputing this list.",
"type": "boolean"
},
"items": {
"description": "The completion items.",
"items": {
"$ref": "#/definitions/CompletionItem"
},
"type": "array"
}
},
"required": [
"isIncomplete",
"items"
],
"type": "object"
},
"CompletionOptions": {
"additionalProperties": false,
"description": "Completion options.",
"properties": {
"allCommitCharacters": {
"description": "The list of all possible characters that commit a completion. This field can be used\nif clients don't support individual commmit characters per completion item. See\n`ClientCapabilities.textDocument.completion.completionItem.commitCharactersSupport`",
"items": {
"type": "string"
},
"type": "array"
},
"resolveProvider": {
"description": "The server provides support to resolve additional\ninformation for a completion item.",
"type": "boolean"
},
"triggerCharacters": {
"description": "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`.",
"items": {
"type": "string"
},
"type": "array"
},
"workDoneProgress": {
"type": "boolean"
}
},
"type": "object"
},
"CompletionParams": {
"additionalProperties": false,
"description": "Completion parameters",
"properties": {
"context": {
"$ref": "#/definitions/CompletionContext",
"description": "The completion context. This is only available it the client specifies\nto send this using the client capability `textDocument.completion.contextSupport === true`"
},
"partialResultToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report partial results (e.g. streaming) to\nthe client."
},
"position": {
"$ref": "#/definitions/Position",
"description": "The position inside the text document."
},
"textDocument": {
"$ref": "#/definitions/TextDocumentIdentifier",
"description": "The text document."
},
"workDoneToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report work done progress."
}
},
"required": [
"position",
"textDocument"
],
"type": "object"
},
"CompletionTriggerKind": {
"description": "How a completion was triggered",
"enum": [
1,
2,
3
],
"type": "number"
},
"ConfigurationItem": {
"additionalProperties": false,
"properties": {
"scopeUri": {
"description": "The scope to get the configuration section for.",
"type": "string"
},
"section": {
"description": "The configuration section asked for.",
"type": "string"
}
},
"type": "object"
},
"ConfigurationParams": {
"additionalProperties": false,
"description": "The parameters of a configuration request.",
"properties": {
"items": {
"items": {
"$ref": "#/definitions/ConfigurationItem"
},
"type": "array"
}
},
"required": [
"items"
],
"type": "object"
},
"CreateFile": {
"additionalProperties": false,
"description": "Create file operation.",
"properties": {
"kind": {
"description": "A create",
"enum": [
"create"
],
"type": "string"
},
"options": {
"$ref": "#/definitions/CreateFileOptions",
"description": "Additional options"
},
"uri": {
"$ref": "#/definitions/DocumentUri",
"description": "The resource to create."
}
},
"required": [
"kind",
"uri"
],
"type": "object"
},
"CreateFileOptions": {
"additionalProperties": false,
"description": "Options to create a file.",
"properties": {
"ignoreIfExists": {
"description": "Ignore if exists.",
"type": "boolean"
},
"overwrite": {
"description": "Overwrite existing file. Overwrite wins over `ignoreIfExists`",
"type": "boolean"
}
},
"type": "object"
},
"DeclarationClientCapabilities": {
"additionalProperties": false,
"description": "Since 3.14.0",
"properties": {
"dynamicRegistration": {
"description": "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.",
"type": "boolean"
},
"linkSupport": {
"description": "The client supports additional metadata in the form of declaration links.",
"type": "boolean"
}
},
"type": "object"
},
"DeclarationOptions": {
"additionalProperties": false,
"properties": {
"workDoneProgress": {
"type": "boolean"
}
},
"type": "object"
},
"DeclarationRegistrationOptions": {
"additionalProperties": false,
"properties": {
"documentSelector": {
"anyOf": [
{
"$ref": "#/definitions/DocumentSelector"
},
{
"type": "null"
}
],
"description": "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."
},
"id": {
"description": "The id used to register the request. The id can be used to deregister\nthe request again. See also Registration#id.",
"type": "string"
},
"workDoneProgress": {
"type": "boolean"
}
},
"required": [
"documentSelector"
],
"type": "object"
},
"DefinitionClientCapabilities": {
"additionalProperties": false,
"description": "Client Capabilities for a [DefinitionRequest](#DefinitionRequest).",
"properties": {
"dynamicRegistration": {
"description": "Whether definition supports dynamic registration.",
"type": "boolean"
},
"linkSupport": {
"description": "The client supports additional metadata in the form of definition links.",
"type": "boolean"
}
},
"type": "object"
},
"DefinitionOptions": {
"additionalProperties": false,
"description": "Server Capabilities for a [DefinitionRequest](#DefinitionRequest).",
"properties": {
"workDoneProgress": {
"type": "boolean"
}
},
"type": "object"
},
"DeleteFile": {
"additionalProperties": false,
"description": "Delete file operation",
"properties": {
"kind": {
"description": "A delete",
"enum": [
"delete"
],
"type": "string"
},
"options": {
"$ref": "#/definitions/DeleteFileOptions",
"description": "Delete options."
},
"uri": {
"$ref": "#/definitions/DocumentUri",
"description": "The file to delete."
}
},
"required": [
"kind",
"uri"
],
"type": "object"
},
"DeleteFileOptions": {
"additionalProperties": false,
"description": "Delete file options",
"properties": {
"ignoreIfNotExists": {
"description": "Ignore the operation if the file doesn't exist.",
"type": "boolean"
},
"recursive": {
"description": "Delete the content recursively if a folder is denoted.",
"type": "boolean"
}
},
"type": "object"
},
"Diagnostic": {
"additionalProperties": false,
"description": "Represents a diagnostic, such as a compiler error or warning. Diagnostic objects\r\nare only valid in the scope of a resource. \n The Diagnostic namespace provides helper functions to work with\r\n[Diagnostic](#Diagnostic) literals.",
"properties": {
"code": {
"description": "The diagnostic's code, which usually appear in the user interface.",
"type": [
"number",
"string"
]
},
"message": {
"description": "The diagnostic's message. It usually appears in the user interface",
"type": "string"
},
"range": {
"$ref": "#/definitions/Range",
"description": "The range at which the message applies"
},
"relatedInformation": {
"description": "An array of related diagnostic information, e.g. when symbol-names within\r\na scope collide all definitions can be marked via this property.",
"items": {
"$ref": "#/definitions/DiagnosticRelatedInformation"
},
"type": "array"
},
"severity": {
"$ref": "#/definitions/DiagnosticSeverity",
"description": "The diagnostic's severity. Can be omitted. If omitted it is up to the\r\nclient to interpret diagnostics as error, warning, info or hint."
},
"source": {
"description": "A human-readable string describing the source of this\r\ndiagnostic, e.g. 'typescript' or 'super lint'. It usually\r\nappears in the user interface.",
"type": "string"
},
"tags": {
"description": "Additional metadata about the diagnostic.",
"items": {
"$ref": "#/definitions/DiagnosticTag"
},
"type": "array"
}
},
"required": [
"range",
"message"
],
"type": "object"
},
"DiagnosticRelatedInformation": {
"additionalProperties": false,
"description": "Represents a related message and source code location for a diagnostic. This should be\r\nused to point to code locations that cause or related to a diagnostics, e.g when duplicating\r\na symbol in a scope. \n The DiagnosticRelatedInformation namespace provides helper functions to work with\r\n[DiagnosticRelatedInformation](#DiagnosticRelatedInformation) literals.",
"properties": {
"location": {
"$ref": "#/definitions/Location",
"description": "The location of this related diagnostic information."
},
"message": {
"description": "The message of this related diagnostic information.",
"type": "string"
}
},
"required": [
"location",
"message"
],
"type": "object"
},
"DiagnosticSeverity": {
"description": "The diagnostic's severity.",
"enum": [
1,
2,
3,
4
],
"type": "number"
},
"DiagnosticTag": {
"description": "The diagnostic tags.",
"enum": [
1,
2
],
"type": "number"
},
"DidChangeConfigurationClientCapabilities": {
"additionalProperties": false,
"properties": {
"dynamicRegistration": {
"description": "Did change configuration notification supports dynamic registration.",
"type": "boolean"
}
},
"type": "object"
},
"DidChangeConfigurationParams": {
"additionalProperties": false,
"description": "The parameters of a change configuration notification.",
"properties": {
"settings": {
"description": "The actual changed settings"
}
},
"required": [
"settings"
],
"type": "object"
},
"DidChangeTextDocumentParams": {
"additionalProperties": false,
"description": "The change text document notification's parameters.",
"properties": {
"contentChanges": {
"description": "The actual content changes. The content changes describe single state changes\nto the document. So if there are two content changes c1 and c2 for a document\nin state S then c1 move the document to S' and c2 to S''.",
"items": {
"$ref": "#/definitions/TextDocumentContentChangeEvent"
},
"type": "array"
},
"textDocument": {
"$ref": "#/definitions/VersionedTextDocumentIdentifier",
"description": "The document that did change. The version number points\nto the version after all provided content changes have\nbeen applied."
}
},
"required": [
"textDocument",
"contentChanges"
],
"type": "object"
},
"DidChangeWatchedFilesClientCapabilities": {
"additionalProperties": false,
"properties": {
"dynamicRegistration": {
"description": "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.",
"type": "boolean"
}
},
"type": "object"
},
"DidChangeWatchedFilesParams": {
"additionalProperties": false,
"description": "The watched files change notification's parameters.",
"properties": {
"changes": {
"description": "The actual file events.",
"items": {
"$ref": "#/definitions/FileEvent"
},
"type": "array"
}
},
"required": [
"changes"
],
"type": "object"
},
"DidChangeWorkspaceFoldersParams": {
"additionalProperties": false,
"description": "The parameters of a `workspace/didChangeWorkspaceFolders` notification.",
"properties": {
"event": {
"$ref": "#/definitions/WorkspaceFoldersChangeEvent",
"description": "The actual workspace folder change event."
}
},
"required": [
"event"
],
"type": "object"
},
"DidCloseTextDocumentParams": {
"additionalProperties": false,
"description": "The parameters send in a close text document notification",
"properties": {
"textDocument": {
"$ref": "#/definitions/TextDocumentIdentifier",
"description": "The document that was closed."
}
},
"required": [
"textDocument"
],
"type": "object"
},
"DidOpenTextDocumentParams": {
"additionalProperties": false,
"description": "The parameters send in a open text document notification",
"properties": {
"textDocument": {
"$ref": "#/definitions/TextDocumentItem",
"description": "The document that was opened."
}
},
"required": [
"textDocument"
],
"type": "object"
},
"DidSaveTextDocumentParams": {
"additionalProperties": false,
"description": "The parameters send in a save text document notification",
"properties": {
"text": {
"description": "Optional the content when saved. Depends on the includeText value\nwhen the save notification was requested.",
"type": "string"
},
"textDocument": {
"$ref": "#/definitions/VersionedTextDocumentIdentifier",
"description": "The document that was closed."
}
},
"required": [
"textDocument"
],
"type": "object"
},
"DocumentColorClientCapabilities": {
"additionalProperties": false,
"properties": {
"dynamicRegistration": {
"description": "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.",
"type": "boolean"
}
},
"type": "object"
},
"DocumentColorOptions": {
"additionalProperties": false,
"properties": {
"resolveProvider": {
"description": "Code lens has a resolve provider as well.",
"type": "boolean"
},
"workDoneProgress": {
"type": "boolean"
}
},
"type": "object"
},
"DocumentColorParams": {
"additionalProperties": false,
"description": "Parameters for a [DocumentColorRequest](#DocumentColorRequest).",
"properties": {
"partialResultToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report partial results (e.g. streaming) to\nthe client."
},
"textDocument": {
"$ref": "#/definitions/TextDocumentIdentifier",
"description": "The text document."
},
"workDoneToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report work done progress."
}
},
"required": [
"textDocument"
],
"type": "object"
},
"DocumentColorRegistrationOptions": {
"additionalProperties": false,
"properties": {
"documentSelector": {
"anyOf": [
{
"$ref": "#/definitions/DocumentSelector"
},
{
"type": "null"
}
],
"description": "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."
},
"id": {
"description": "The id used to register the request. The id can be used to deregister\nthe request again. See also Registration#id.",
"type": "string"
},
"resolveProvider": {
"description": "Code lens has a resolve provider as well.",
"type": "boolean"
},
"workDoneProgress": {
"type": "boolean"
}
},
"required": [
"documentSelector"
],
"type": "object"
},
"DocumentFilter": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"language": {
"description": "A language id, like `typescript`.",
"type": "string"
},
"pattern": {
"description": "A glob pattern, like `*.{ts,js}`.",
"type": "string"
},
"scheme": {
"description": "A Uri [scheme](#Uri.scheme), like `file` or `untitled`.",
"type": "string"
}
},
"required": [
"language"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"language": {
"description": "A language id, like `typescript`.",
"type": "string"
},
"pattern": {
"description": "A glob pattern, like `*.{ts,js}`.",
"type": "string"
},
"scheme": {
"description": "A Uri [scheme](#Uri.scheme), like `file` or `untitled`.",
"type": "string"
}
},
"required": [
"scheme"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"language": {
"description": "A language id, like `typescript`.",
"type": "string"
},
"pattern": {
"description": "A glob pattern, like `*.{ts,js}`.",
"type": "string"
},
"scheme": {
"description": "A Uri [scheme](#Uri.scheme), like `file` or `untitled`.",
"type": "string"
}
},
"required": [
"pattern"
],
"type": "object"
}
],
"description": "A document filter denotes a document by different properties like\nthe [language](#TextDocument.languageId), the [scheme](#Uri.scheme) of\nits resource, or a glob-pattern that is applied to the [path](#TextDocument.fileName).\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 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 The DocumentFilter namespace provides helper functions to work with\n[DocumentFilter](#DocumentFilter) literals."
},
"DocumentFormattingClientCapabilities": {
"additionalProperties": false,
"description": "Client capabilities of a [DocumentFormattingRequest](#DocumentFormattingRequest).",
"properties": {
"dynamicRegistration": {
"description": "Whether formatting supports dynamic registration.",
"type": "boolean"
}
},
"type": "object"
},
"DocumentFormattingOptions": {
"additionalProperties": false,
"description": "Provider options for a [DocumentFormattingRequest](#DocumentFormattingRequest).",
"properties": {
"workDoneProgress": {
"type": "boolean"
}
},
"type": "object"
},
"DocumentFormattingParams": {
"additionalProperties": false,
"description": "The parameters of a [DocumentFormattingRequest](#DocumentFormattingRequest).",
"properties": {
"options": {
"$ref": "#/definitions/FormattingOptions",
"description": "The format options"
},
"textDocument": {
"$ref": "#/definitions/TextDocumentIdentifier",
"description": "The document to format."
},
"workDoneToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report work done progress."
}
},
"required": [
"textDocument",
"options"
],
"type": "object"
},
"DocumentHighlight": {
"additionalProperties": false,
"description": "A document highlight is a range inside a text document which deserves\r\nspecial attention. Usually a document highlight is visualized by changing\r\nthe background color of its range. \n DocumentHighlight namespace to provide helper functions to work with\r\n[DocumentHighlight](#DocumentHighlight) literals.",
"properties": {
"kind": {
"$ref": "#/definitions/DocumentHighlightKind",
"description": "The highlight kind, default is [text](#DocumentHighlightKind.Text)."
},
"range": {
"$ref": "#/definitions/Range",
"description": "The range this highlight applies to."
}
},
"required": [
"range"
],
"type": "object"
},
"DocumentHighlightClientCapabilities": {
"additionalProperties": false,
"description": "Client Capabilities for a [DocumentHighlightRequest](#DocumentHighlightRequest).",
"properties": {
"dynamicRegistration": {
"description": "Whether document highlight supports dynamic registration.",
"type": "boolean"
}
},
"type": "object"
},
"DocumentHighlightKind": {
"description": "A document highlight kind.",
"enum": [
1,
2,
3
],
"type": "number"
},
"DocumentHighlightOptions": {
"additionalProperties": false,
"description": "Provider options for a [DocumentHighlightRequest](#DocumentHighlightRequest).",
"properties": {
"workDoneProgress": {
"type": "boolean"
}
},
"type": "object"
},
"DocumentLink": {
"additionalProperties": false,
"description": "A document link is a range in a text document that links to an internal or external resource, like another\r\ntext document or a web site. \n The DocumentLink namespace provides helper functions to work with\r\n[DocumentLink](#DocumentLink) literals.",
"properties": {
"data": {
"description": "A data entry field that is preserved on a document link between a\r\nDocumentLinkRequest and a DocumentLinkResolveRequest."
},
"range": {
"$ref": "#/definitions/Range",
"description": "The range this link applies to."
},
"target": {
"description": "The uri this link points to.",
"type": "string"
},
"tooltip": {
"description": "The tooltip text when you hover over this link.\r\n\r\nIf a tooltip is provided, is will be displayed in a string that includes instructions on how to\r\ntrigger the link, such as `{0} (ctrl + click)`. The specific instructions vary depending on OS,\r\nuser settings, and localization.",
"type": "string"
}
},
"required": [
"range"
],
"type": "object"
},
"DocumentLinkClientCapabilities": {
"additionalProperties": false,
"description": "The client capabilities of a [DocumentLinkRequest](#DocumentLinkRequest).",
"properties": {
"dynamicRegistration": {
"description": "Whether document link supports dynamic registration.",
"type": "boolean"
},
"tooltipSupport": {
"description": "Whether the client support the `tooltip` property on `DocumentLink`.",
"type": "boolean"
}
},
"type": "object"
},
"DocumentLinkOptions": {
"additionalProperties": false,
"description": "Provider options for a [DocumentLinkRequest](#DocumentLinkRequest).",
"properties": {
"resolveProvider": {
"description": "Document links have a resolve provider as well.",
"type": "boolean"
},
"workDoneProgress": {
"type": "boolean"
}
},
"type": "object"
},
"DocumentLinkParams": {
"additionalProperties": false,
"description": "The parameters of a [DocumentLinkRequest](#DocumentLinkRequest).",
"properties": {
"partialResultToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report partial results (e.g. streaming) to\nthe client."
},
"textDocument": {
"$ref": "#/definitions/TextDocumentIdentifier",
"description": "The document to provide document links for."
},
"workDoneToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report work done progress."
}
},
"required": [
"textDocument"
],
"type": "object"
},
"DocumentOnTypeFormattingClientCapabilities": {
"additionalProperties": false,
"description": "Client capabilities of a [DocumentOnTypeFormattingRequest](#DocumentOnTypeFormattingRequest).",
"properties": {
"dynamicRegistration": {
"description": "Whether on type formatting supports dynamic registration.",
"type": "boolean"
}
},
"type": "object"
},
"DocumentOnTypeFormattingOptions": {
"additionalProperties": false,
"description": "Provider options for a [DocumentOnTypeFormattingRequest](#DocumentOnTypeFormattingRequest).",
"properties": {
"firstTriggerCharacter": {
"description": "A character on which formatting should be triggered, like `}`.",
"type": "string"
},
"moreTriggerCharacter": {
"description": "More trigger characters.",
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"firstTriggerCharacter"
],
"type": "object"
},
"DocumentOnTypeFormattingParams": {
"additionalProperties": false,
"description": "The parameters of a [DocumentOnTypeFormattingRequest](#DocumentOnTypeFormattingRequest).",
"properties": {
"ch": {
"description": "The character that has been typed.",
"type": "string"
},
"options": {
"$ref": "#/definitions/FormattingOptions",
"description": "The format options."
},
"position": {
"$ref": "#/definitions/Position",
"description": "The position at which this request was send."
},
"textDocument": {
"$ref": "#/definitions/TextDocumentIdentifier",
"description": "The document to format."
}
},
"required": [
"textDocument",
"position",
"ch",
"options"
],
"type": "object"
},
"DocumentRangeFormattingClientCapabilities": {
"additionalProperties": false,
"description": "Client capabilities of a [DocumentRangeFormattingRequest](#DocumentRangeFormattingRequest).",
"properties": {
"dynamicRegistration": {
"description": "Whether range formatting supports dynamic registration.",
"type": "boolean"
}
},
"type": "object"
},
"DocumentRangeFormattingOptions": {
"additionalProperties": false,
"description": "Provider options for a [DocumentRangeFormattingRequest](#DocumentRangeFormattingRequest).",
"properties": {
"workDoneProgress": {
"type": "boolean"
}
},
"type": "object"
},
"DocumentRangeFormattingParams": {
"additionalProperties": false,
"description": "The parameters of a [DocumentRangeFormattingRequest](#DocumentRangeFormattingRequest).",
"properties": {
"options": {
"$ref": "#/definitions/FormattingOptions",
"description": "The format options"
},
"range": {
"$ref": "#/definitions/Range",
"description": "The range to format"
},
"textDocument": {
"$ref": "#/definitions/TextDocumentIdentifier",
"description": "The document to format."
},
"workDoneToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report work done progress."
}
},
"required": [
"textDocument",
"range",
"options"
],
"type": "object"
},
"DocumentSelector": {
"description": "A document selector is the combination of one or many document filters. \n The DocumentSelector namespace provides helper functions to work with\n[DocumentSelector](#DocumentSelector)s.",
"items": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/definitions/DocumentFilter"
}
]
},
"type": "array"
},
"DocumentSymbol": {
"additionalProperties": false,
"description": "Represents programming constructs like variables, classes, interfaces etc.\r\nthat appear in a document. Document symbols can be hierarchical and they\r\nhave two ranges: one that encloses its definition and one that points to\r\nits most interesting range, e.g. the range of an identifier.",
"properties": {
"children": {
"description": "Children of this symbol, e.g. properties of a class.",
"items": {
"$ref": "#/definitions/DocumentSymbol"
},
"type": "array"
},
"deprecated": {
"description": "Indicates if this symbol is deprecated.",
"type": "boolean"
},
"detail": {
"description": "More detail for this symbol, e.g the signature of a function.",
"type": "string"
},
"kind": {
"$ref": "#/definitions/SymbolKind",
"description": "The kind of this symbol."
},
"name": {
"description": "The name of this symbol. Will be displayed in the user interface and therefore must not be\r\nan empty string or a string only consisting of white spaces.",
"type": "string"
},
"range": {
"$ref": "#/definitions/Range",
"description": "The range enclosing this symbol not including leading/trailing whitespace but everything else\r\nlike comments. This information is typically used to determine if the the clients cursor is\r\ninside the symbol to reveal in the symbol in the UI."
},
"selectionRange": {
"$ref": "#/definitions/Range",
"description": "The range that should be selected and revealed when this symbol is being picked, e.g the name of a function.\r\nMust be contained by the the `range`."
}
},
"required": [
"name",
"kind",
"range",
"selectionRange"
],
"type": "object"
},
"DocumentSymbolClientCapabilities": {
"additionalProperties": false,
"description": "Client Capabilities for a [DocumentSymbolRequest](#DocumentSymbolRequest).",
"properties": {
"dynamicRegistration": {
"description": "Whether document symbol supports dynamic registration.",
"type": "boolean"
},
"hierarchicalDocumentSymbolSupport": {
"description": "The client support hierarchical document symbols.",
"type": "boolean"
},
"symbolKind": {
"additionalProperties": false,
"description": "Specific capabilities for the `SymbolKind`.",
"properties": {
"valueSet": {
"description": "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.",
"items": {
"$ref": "#/definitions/SymbolKind"
},
"type": "array"
}
},
"type": "object"
}
},
"type": "object"
},
"DocumentSymbolOptions": {
"additionalProperties": false,
"description": "Provider options for a [DocumentSymbolRequest](#DocumentSymbolRequest).",
"properties": {
"workDoneProgress": {
"type": "boolean"
}
},
"type": "object"
},
"DocumentSymbolParams": {
"additionalProperties": false,
"description": "Parameters for a [DocumentSymbolRequest](#DocumentSymbolRequest).",
"properties": {
"partialResultToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report partial results (e.g. streaming) to\nthe client."
},
"textDocument": {
"$ref": "#/definitions/TextDocumentIdentifier",
"description": "The text document."
},
"workDoneToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report work done progress."
}
},
"required": [
"textDocument"
],
"type": "object"
},
"DocumentUri": {
"description": "A tagging type for string properties that are actually URIs.",
"type": "string"
},
"ExecuteCommandClientCapabilities": {
"additionalProperties": false,
"description": "The client capabilities of a [ExecuteCommandRequest](#ExecuteCommandRequest).",
"properties": {
"dynamicRegistration": {
"description": "Execute command supports dynamic registration.",
"type": "boolean"
}
},
"type": "object"
},
"ExecuteCommandOptions": {
"additionalProperties": false,
"description": "The server capabilities of a [ExecuteCommandRequest](#ExecuteCommandRequest).",
"properties": {
"commands": {
"description": "The commands to be executed on the server",
"items": {
"type": "string"
},
"type": "array"
},
"workDoneProgress": {
"type": "boolean"
}
},
"required": [
"commands"
],
"type": "object"
},
"ExecuteCommandParams": {
"additionalProperties": false,
"description": "The parameters of a [ExecuteCommandRequest](#ExecuteCommandRequest).",
"properties": {
"arguments": {
"description": "Arguments that the command should be invoked with.",
"items": {
},
"type": "array"
},
"command": {
"description": "The identifier of the actual command handler.",
"type": "string"
},
"workDoneToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report work done progress."
}
},
"required": [
"command"
],
"type": "object"
},
"FailureHandlingKind": {
"enum": [
"abort",
"transactional",
"undo",
"textOnlyTransactional"
],
"type": "string"
},
"FileChangeType": {
"description": "The file event type",
"enum": [
1,
2,
3
],
"type": "number"
},
"FileEvent": {
"additionalProperties": false,
"description": "An event describing a file change.",
"properties": {
"type": {
"$ref": "#/definitions/FileChangeType",
"description": "The change type."
},
"uri": {
"$ref": "#/definitions/DocumentUri",
"description": "The file's uri."
}
},
"required": [
"uri",
"type"
],
"type": "object"
},
"FoldingRange": {
"additionalProperties": false,
"description": "Represents a folding range. \n The folding range namespace provides helper functions to work with\r\n[FoldingRange](#FoldingRange) literals.",
"properties": {
"endCharacter": {
"description": "The zero-based character offset before the folded range ends. If not defined, defaults to the length of the end line.",
"type": "number"
},
"endLine": {
"description": "The zero-based line number where the folded range ends.",
"type": "number"
},
"kind": {
"description": "Describes the kind of the folding range such as `comment' or 'region'. The kind\r\nis used to categorize folding ranges and used by commands like 'Fold all comments'. See\r\n[FoldingRangeKind](#FoldingRangeKind) for an enumeration of standardized kinds.",
"type": "string"
},
"startCharacter": {
"description": "The zero-based character offset from where the folded range starts. If not defined, defaults to the length of the start line.",
"type": "number"
},
"startLine": {
"description": "The zero-based line number from where the folded range starts.",
"type": "number"
}
},
"required": [
"startLine",
"endLine"
],
"type": "object"
},
"FoldingRangeClientCapabilities": {
"additionalProperties": false,
"properties": {
"dynamicRegistration": {
"description": "Whether implementation supports dynamic registration for folding range providers. If this is set to `true`\nthe client supports the new `FoldingRangeRegistrationOptions` return value for the corresponding server\ncapability as well.",
"type": "boolean"
},
"lineFoldingOnly": {
"description": "If set, the client signals that it only supports folding complete lines. If set, client will\nignore specified `startCharacter` and `endCharacter` properties in a FoldingRange.",
"type": "boolean"
},
"rangeLimit": {
"description": "The maximum number of folding ranges that the client prefers to receive per document. The value serves as a\nhint, servers are free to follow the limit.",
"type": "number"
}
},
"type": "object"
},
"FoldingRangeOptions": {
"additionalProperties": false,
"properties": {
"workDoneProgress": {
"type": "boolean"
}
},
"type": "object"
},
"FoldingRangeParams": {
"additionalProperties": false,
"description": "Parameters for a [FoldingRangeRequest](#FoldingRangeRequest).",
"properties": {
"partialResultToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report partial results (e.g. streaming) to\nthe client."
},
"textDocument": {
"$ref": "#/definitions/TextDocumentIdentifier",
"description": "The text document."
},
"workDoneToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report work done progress."
}
},
"required": [
"textDocument"
],
"type": "object"
},
"FoldingRangeRegistrationOptions": {
"additionalProperties": false,
"properties": {
"documentSelector": {
"anyOf": [
{
"$ref": "#/definitions/DocumentSelector"
},
{
"type": "null"
}
],
"description": "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."
},
"id": {
"description": "The id used to register the request. The id can be used to deregister\nthe request again. See also Registration#id.",
"type": "string"
},
"workDoneProgress": {
"type": "boolean"
}
},
"required": [
"documentSelector"
],
"type": "object"
},
"FormattingOptions": {
"additionalProperties": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"not": {
}
}
],
"description": "Signature for further properties."
},
"description": "Value-object describing what options formatting should use. \n The FormattingOptions namespace provides helper functions to work with\r\n[FormattingOptions](#FormattingOptions) literals.",
"properties": {
"insertFinalNewline": {
"description": "Insert a newline character at the end of the file if one does not exist.",
"type": "boolean"
},
"insertSpaces": {
"description": "Prefer spaces over tabs.",
"type": "boolean"
},
"tabSize": {
"description": "Size of a tab in spaces.",
"type": "number"
},
"trimFinalNewlines": {
"description": "Trim all newlines after the final newline at the end of the file.",
"type": "boolean"
},
"trimTrailingWhitespace": {
"description": "Trim trailing whitespaces on a line.",
"type": "boolean"
}
},
"required": [
"tabSize",
"insertSpaces"
],
"type": "object"
},
"Hover": {
"additionalProperties": false,
"description": "The result of a hover request.",
"properties": {
"contents": {
"anyOf": [
{
"$ref": "#/definitions/MarkupContent"
},
{
"$ref": "#/definitions/MarkedString"
},
{
"items": {
"$ref": "#/definitions/MarkedString"
},
"type": "array"
}
],
"description": "The hover's content"
},
"range": {
"$ref": "#/definitions/Range",
"description": "An optional range"
}
},
"required": [
"contents"
],
"type": "object"
},
"HoverClientCapabilities": {
"additionalProperties": false,
"properties": {
"contentFormat": {
"description": "Client supports the follow content formats for the content\nproperty. The order describes the preferred format of the client.",
"items": {
"$ref": "#/definitions/MarkupKind"
},
"type": "array"
},
"dynamicRegistration": {
"description": "Whether hover supports dynamic registration.",
"type": "boolean"
}
},
"type": "object"
},
"HoverOptions": {
"additionalProperties": false,
"description": "Hover options.",
"properties": {
"workDoneProgress": {
"type": "boolean"
}
},
"type": "object"
},
"ImplementationClientCapabilities": {
"additionalProperties": false,
"description": "Since 3.6.0",
"properties": {
"dynamicRegistration": {
"description": "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.",
"type": "boolean"
},
"linkSupport": {
"description": "The client supports additional metadata in the form of definition links.\n\nSince 3.14.0",
"type": "boolean"
}
},
"type": "object"
},
"ImplementationOptions": {
"additionalProperties": false,
"properties": {
"workDoneProgress": {
"type": "boolean"
}
},
"type": "object"
},
"ImplementationRegistrationOptions": {
"additionalProperties": false,
"properties": {
"documentSelector": {
"anyOf": [
{
"$ref": "#/definitions/DocumentSelector"
},
{
"type": "null"
}
],
"description": "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."
},
"id": {
"description": "The id used to register the request. The id can be used to deregister\nthe request again. See also Registration#id.",
"type": "string"
},
"workDoneProgress": {
"type": "boolean"
}
},
"required": [
"documentSelector"
],
"type": "object"
},
"InitializeParams": {
"additionalProperties": false,
"properties": {
"capabilities": {
"$ref": "#/definitions/ClientCapabilities",
"description": "The capabilities provided by the client (editor or tool)"
},
"clientInfo": {
"additionalProperties": false,
"description": "Information about the client",
"properties": {
"name": {
"description": "The name of the client as defined by the client.",
"type": "string"
},
"version": {
"description": "The client's version as defined by the client.",
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
},
"initializationOptions": {
"description": "User provided initialization options."
},
"processId": {
"description": "The process Id of the parent process that started\nthe server.",
"type": [
"number",
"null"
]
},
"rootPath": {
"description": "The rootPath of the workspace. Is null\nif no folder is open.",
"type": [
"string",
"null"
]
},
"rootUri": {
"anyOf": [
{
"$ref": "#/definitions/DocumentUri"
},
{
"type": "null"
}
],
"description": "The rootUri of the workspace. Is null if no\nfolder is open. If both `rootPath` and `rootUri` are set\n`rootUri` wins."
},
"trace": {
"description": "The initial trace setting. If omitted trace is disabled ('off').",
"enum": [
"off",
"messages",
"verbose"
],
"type": "string"
},
"workDoneToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report work done progress."
},
"workspaceFolders": {
"anyOf": [
{
"items": {
"$ref": "#/definitions/WorkspaceFolder"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "The actual configured workspace folders."
}
},
"required": [
"capabilities",
"processId",
"rootUri",
"workspaceFolders"
],
"type": "object"
},
"InitializeResult": {
"additionalProperties": {
"description": "Custom initialization results."
},
"description": "The result returned from an initialize request.",
"properties": {
"capabilities": {
"$ref": "#/definitions/ServerCapabilities<any>",
"description": "The capabilities the language server provides."
},
"serverInfo": {
"additionalProperties": false,
"description": "Information about the server.",
"properties": {
"name": {
"description": "The name of the server as defined by the server.",
"type": "string"
},
"version": {
"description": "The servers's version as defined by the server.",
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
}
},
"required": [
"capabilities"
],
"type": "object"
},
"InitializedParams": {
"additionalProperties": false,
"type": "object"
},
"InsertTextFormat": {
"description": "Defines whether the insert text in a completion item should be interpreted as\r\nplain text or a snippet.",
"enum": [
1,
2
],
"type": "number"
},
"Location": {
"additionalProperties": false,
"description": "Represents a location inside a resource, such as a line\r\ninside a text file. \n The Location namespace provides helper functions to work with\r\n[Location](#Location) literals.",
"properties": {
"range": {
"$ref": "#/definitions/Range"
},
"uri": {
"$ref": "#/definitions/DocumentUri"
}
},
"required": [
"uri",
"range"
],
"type": "object"
},
"LogMessageParams": {
"additionalProperties": false,
"description": "The log message parameters.",
"properties": {
"message": {
"description": "The actual message",
"type": "string"
},
"type": {
"$ref": "#/definitions/MessageType",
"description": "The message type. See {@link MessageType}"
}
},
"required": [
"type",
"message"
],
"type": "object"
},
"MarkedString": {
"anyOf": [
{
"type": "string"
},
{
"additionalProperties": false,
"properties": {
"language": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"language",
"value"
],
"type": "object"
}
],
"description": "MarkedString can be used to render human readable text. It is either a markdown string\r\nor a code-block that provides a language and a code snippet. The language identifier\r\nis semantically equal to the optional language identifier in fenced code blocks in GitHub\r\nissues. See https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting\r\n\r\nThe pair of a language and a value is an equivalent to markdown:\r\n```${language}\r\n${value}\r\n```\r\n\r\nNote that markdown strings will be sanitized - that means html will be escaped."
},
"MarkupContent": {
"additionalProperties": false,
"description": "A `MarkupContent` literal represents a string value which content is interpreted base on its\r\nkind flag. Currently the protocol supports `plaintext` and `markdown` as markup kinds.\r\n\r\nIf the kind is `markdown` then the value can contain fenced code blocks like in GitHub issues.\r\nSee https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting\r\n\r\nHere is an example how such a string can be constructed using JavaScript / TypeScript:\r\n```ts\r\nlet markdown: MarkdownContent = {\r\n kind: MarkupKind.Markdown,\r\nvalue: [\r\n\t\t'# Header',\r\n\t\t'Some text',\r\n\t\t'```typescript',\r\n\t\t'someCode();',\r\n\t\t'```'\r\n].join('\\n')\r\n};\r\n```\r\n\r\n*Please Note* that clients might sanitize the return markdown. A client could decide to\r\nremove HTML from the markdown to avoid script execution.",
"properties": {
"kind": {
"$ref": "#/definitions/MarkupKind",
"description": "The type of the Markup"
},
"value": {
"description": "The content itself",
"type": "string"
}
},
"required": [
"kind",
"value"
],
"type": "object"
},
"MarkupKind": {
"description": "Describes the content type that a client supports in various\r\nresult literals like `Hover`, `ParameterInfo` or `CompletionItem`.\r\n\r\nPlease note that `MarkupKinds` must not start with a `$`. This kinds\r\nare reserved for internal usage.",
"enum": [
"plaintext",
"markdown"
],
"type": "string"
},
"MessageActionItem": {
"additionalProperties": false,
"properties": {
"title": {
"description": "A short title like 'Retry', 'Open Log' etc.",
"type": "string"
}
},
"required": [
"title"
],
"type": "object"
},
"MessageType": {
"description": "The message type",
"enum": [
1,
2,
3,
4
],
"type": "number"
},
"ParameterInformation": {
"additionalProperties": false,
"description": "Represents a parameter of a callable-signature. A parameter can\r\nhave a label and a doc-comment. \n The ParameterInformation namespace provides helper functions to work with\r\n[ParameterInformation](#ParameterInformation) literals.",
"properties": {
"documentation": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/definitions/MarkupContent"
}
],
"description": "The human-readable doc-comment of this signature. Will be shown\r\nin the UI but can be omitted."
},
"label": {
"anyOf": [
{
"type": "string"
},
{
"items": [
{
"type": "number"
},
{
"type": "number"
}
],
"maxItems": 2,
"minItems": 2,
"type": "array"
}
],
"description": "The label of this parameter information.\r\n\r\nEither a string or an inclusive start and exclusive end offsets within its containing\r\nsignature label. (see SignatureInformation.label). The offsets are based on a UTF-16\r\nstring representation as `Position` and `Range` does.\r\n\r\n*Note*: a label of type string should be a substring of its containing signature label.\r\nIts intended use case is to highlight the parameter label part in the `SignatureInformation.label`."
}
},
"required": [
"label"
],
"type": "object"
},
"Position": {
"additionalProperties": false,
"description": "Position in a text document expressed as zero-based line and character offset.\r\nThe offsets are based on a UTF-16 string representation. So a string of the form\r\n`a๐€b` the character offset of the character `a` is 0, the character offset of `๐€`\r\nis 1 and the character offset of b is 3 since `๐€` is represented using two code\r\nunits in UTF-16.\r\n\r\nPositions are line end character agnostic. So you can not specify a position that\r\ndenotes `\\r|\\n` or `\\n|` where `|` represents the character offset. \n The Position namespace provides helper functions to work with\r\n[Position](#Position) literals.",
"properties": {
"character": {
"description": "Character offset on a line in a document (zero-based). Assuming that the line is\r\nrepresented as a string, the `character` value represents the gap between the\r\n`character` and `character + 1`.\r\n\r\nIf the character value is greater than the line length it defaults back to the\r\nline length.\r\nIf a line number is negative, it defaults to 0.",
"type": "number"
},
"line": {
"description": "Line position in a document (zero-based).\r\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.\r\nIf a line number is negative, it defaults to 0.",
"type": "number"
}
},
"required": [
"line",
"character"
],
"type": "object"
},
"ProgressToken": {
"type": [
"number",
"string"
]
},
"PublishDiagnosticsClientCapabilities": {
"additionalProperties": false,
"description": "The publish diagnostic client capabilities.",
"properties": {
"relatedInformation": {
"description": "Whether the clients accepts diagnostics with related information.",
"type": "boolean"
},
"tagSupport": {
"additionalProperties": false,
"description": "Client supports the tag property to provide meta data about a diagnostic.\nClients supporting tags have to handle unknown tags gracefully.",
"properties": {
"valueSet": {
"description": "The tags supported by the client.",
"items": {
"$ref": "#/definitions/DiagnosticTag"
},
"type": "array"
}
},
"required": [
"valueSet"
],
"type": "object"
}
},
"type": "object"
},
"PublishDiagnosticsParams": {
"additionalProperties": false,
"description": "The publish diagnostic notification's parameters.",
"properties": {
"diagnostics": {
"description": "An array of diagnostic information items.",
"items": {
"$ref": "#/definitions/Diagnostic"
},
"type": "array"
},
"uri": {
"$ref": "#/definitions/DocumentUri",
"description": "The URI for which diagnostic information is reported."
},
"version": {
"description": "Optional the version number of the document the diagnostics are published for.",
"type": "number"
}
},
"required": [
"uri",
"diagnostics"
],
"type": "object"
},
"Range": {
"additionalProperties": false,
"description": "A range in a text document expressed as (zero-based) start and end positions.\r\n\r\nIf you want to specify a range that contains a line including the line ending\r\ncharacter(s) then use an end position denoting the start of the next line.\r\nFor example:\r\n```ts\r\n{\r\n start: { line: 5, character: 23 }\r\n end : { line 6, character : 0 }\r\n}\r\n``` \n The Range namespace provides helper functions to work with\r\n[Range](#Range) literals.",
"properties": {
"end": {
"$ref": "#/definitions/Position",
"description": "The range's end position."
},
"start": {
"$ref": "#/definitions/Position",
"description": "The range's start position"
}
},
"required": [
"start",
"end"
],
"type": "object"
},
"ReferenceClientCapabilities": {
"additionalProperties": false,
"description": "Client Capabilities for a [ReferencesRequest](#ReferencesRequest).",
"properties": {
"dynamicRegistration": {
"description": "Whether references supports dynamic registration.",
"type": "boolean"
}
},
"type": "object"
},
"ReferenceContext": {
"additionalProperties": false,
"description": "Value-object that contains additional information when\r\nrequesting references.",
"properties": {
"includeDeclaration": {
"description": "Include the declaration of the current symbol.",
"type": "boolean"
}
},
"required": [
"includeDeclaration"
],
"type": "object"
},
"ReferenceOptions": {
"additionalProperties": false,
"description": "Reference options.",
"properties": {
"workDoneProgress": {
"type": "boolean"
}
},
"type": "object"
},
"ReferenceParams": {
"additionalProperties": false,
"description": "Parameters for a [ReferencesRequest](#ReferencesRequest).",
"properties": {
"context": {
"$ref": "#/definitions/ReferenceContext"
},
"partialResultToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report partial results (e.g. streaming) to\nthe client."
},
"position": {
"$ref": "#/definitions/Position",
"description": "The position inside the text document."
},
"textDocument": {
"$ref": "#/definitions/TextDocumentIdentifier",
"description": "The text document."
},
"workDoneToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report work done progress."
}
},
"required": [
"context",
"position",
"textDocument"
],
"type": "object"
},
"Registration": {
"additionalProperties": false,
"description": "General parameters to to register for an notification or to register a provider.",
"properties": {
"id": {
"description": "The id used to register the request. The id can be used to deregister\nthe request again.",
"type": "string"
},
"method": {
"description": "The method to register for.",
"type": "string"
},
"registerOptions": {
"description": "Options necessary for the registration."
}
},
"required": [
"id",
"method"
],
"type": "object"
},
"RegistrationParams": {
"additionalProperties": false,
"properties": {
"registrations": {
"items": {
"$ref": "#/definitions/Registration"
},
"type": "array"
}
},
"required": [
"registrations"
],
"type": "object"
},
"RenameClientCapabilities": {
"additionalProperties": false,
"properties": {
"dynamicRegistration": {
"description": "Whether rename supports dynamic registration.",
"type": "boolean"
},
"prepareSupport": {
"description": "Client supports testing for validity of rename operations\nbefore execution.",
"type": "boolean"
}
},
"type": "object"
},
"RenameFile": {
"additionalProperties": false,
"description": "Rename file operation",
"properties": {
"kind": {
"description": "A rename",
"enum": [
"rename"
],
"type": "string"
},
"newUri": {
"$ref": "#/definitions/DocumentUri",
"description": "The new location."
},
"oldUri": {
"$ref": "#/definitions/DocumentUri",
"description": "The old (existing) location."
},
"options": {
"$ref": "#/definitions/RenameFileOptions",
"description": "Rename options."
}
},
"required": [
"kind",
"newUri",
"oldUri"
],
"type": "object"
},
"RenameFileOptions": {
"additionalProperties": false,
"description": "Rename file options",
"properties": {
"ignoreIfExists": {
"description": "Ignores if target exists.",
"type": "boolean"
},
"overwrite": {
"description": "Overwrite target if existing. Overwrite wins over `ignoreIfExists`",
"type": "boolean"
}
},
"type": "object"
},
"RenameOptions": {
"additionalProperties": false,
"description": "Provider options for a [RenameRequest](#RenameRequest).",
"properties": {
"prepareProvider": {
"description": "Renames should be checked and tested before being executed.",
"type": "boolean"
},
"workDoneProgress": {
"type": "boolean"
}
},
"type": "object"
},
"RenameParams": {
"additionalProperties": false,
"description": "The parameters of a [RenameRequest](#RenameRequest).",
"properties": {
"newName": {
"description": "The new name of the symbol. If the given name is not valid the\nrequest must return a [ResponseError](#ResponseError) with an\nappropriate message set.",
"type": "string"
},
"position": {
"$ref": "#/definitions/Position",
"description": "The position at which this request was sent."
},
"textDocument": {
"$ref": "#/definitions/TextDocumentIdentifier",
"description": "The document to rename."
},
"workDoneToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report work done progress."
}
},
"required": [
"textDocument",
"position",
"newName"
],
"type": "object"
},
"ResourceOperationKind": {
"description": "The kind of resource operations supported by the client.",
"enum": [
"create",
"rename",
"delete"
],
"type": "string"
},
"ResponseErrorLiteral<any>": {
"additionalProperties": false,
"properties": {
"code": {
"description": "A number indicating the error type that occured.",
"type": "number"
},
"data": {
"description": "A Primitive or Structured value that contains additional\r\ninformation about the error. Can be omitted."
},
"message": {
"description": "A string providing a short decription of the error.",
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object"
},
"SaveOptions": {
"additionalProperties": false,
"description": "Save options.",
"properties": {
"includeText": {
"description": "The client is supposed to include the content on save.",
"type": "boolean"
}
},
"type": "object"
},
"SelectionRangeClientCapabilities": {
"additionalProperties": false,
"properties": {
"dynamicRegistration": {
"description": "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.",
"type": "boolean"
}
},
"type": "object"
},
"SelectionRangeOptions": {
"additionalProperties": false,
"properties": {
"workDoneProgress": {
"type": "boolean"
}
},
"type": "object"
},
"SelectionRangeRegistrationOptions": {
"additionalProperties": false,
"properties": {
"documentSelector": {
"anyOf": [
{
"$ref": "#/definitions/DocumentSelector"
},
{
"type": "null"
}
],
"description": "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."
},
"id": {
"description": "The id used to register the request. The id can be used to deregister\nthe request again. See also Registration#id.",
"type": "string"
},
"workDoneProgress": {
"type": "boolean"
}
},
"required": [
"documentSelector"
],
"type": "object"
},
"ServerCapabilities<any>": {
"additionalProperties": false,
"properties": {
"codeActionProvider": {
"anyOf": [
{
"type": "boolean"
},
{
"$ref": "#/definitions/CodeActionOptions"
}
],
"description": "The server provides code actions. CodeActionOptions may only be\nspecified if the client states that it supports\n`codeActionLiteralSupport` in its initial `initialize` request."
},
"codeLensProvider": {
"$ref": "#/definitions/CodeLensOptions",
"description": "The server provides code lens."
},
"colorProvider": {
"anyOf": [
{
"type": "boolean"
},
{
"$ref": "#/definitions/DocumentColorOptions"
},
{
"$ref": "#/definitions/DocumentColorRegistrationOptions"
}
],
"description": "The server provides color provider support."
},
"completionProvider": {
"$ref": "#/definitions/CompletionOptions",
"description": "The server provides completion support."
},
"declarationProvider": {
"anyOf": [
{
"type": "boolean"
},
{
"$ref": "#/definitions/DeclarationOptions"
},
{
"$ref": "#/definitions/DeclarationRegistrationOptions"
}
],
"description": "The server provides Goto Declaration support."
},
"definitionProvider": {
"anyOf": [
{
"type": "boolean"
},
{
"$ref": "#/definitions/DefinitionOptions"
}
],
"description": "The server provides goto definition support."
},
"documentFormattingProvider": {
"anyOf": [
{
"type": "boolean"
},
{
"$ref": "#/definitions/DocumentFormattingOptions"
}
],
"description": "The server provides document formatting."
},
"documentHighlightProvider": {
"anyOf": [
{
"type": "boolean"
},
{
"$ref": "#/definitions/DocumentHighlightOptions"
}
],
"description": "The server provides document highlight support."
},
"documentLinkProvider": {
"$ref": "#/definitions/DocumentLinkOptions",
"description": "The server provides document link support."
},
"documentOnTypeFormattingProvider": {
"$ref": "#/definitions/DocumentOnTypeFormattingOptions",
"description": "The server provides document formatting on typing."
},
"documentRangeFormattingProvider": {
"anyOf": [
{
"type": "boolean"
},
{
"$ref": "#/definitions/DocumentRangeFormattingOptions"
}
],
"description": "The server provides document range formatting."
},
"documentSymbolProvider": {
"anyOf": [
{
"type": "boolean"
},
{
"$ref": "#/definitions/DocumentSymbolOptions"
}
],
"description": "The server provides document symbol support."
},
"executeCommandProvider": {
"$ref": "#/definitions/ExecuteCommandOptions",
"description": "The server provides execute command support."
},
"experimental": {
"description": "Experimental server capabilities."
},
"foldingRangeProvider": {
"anyOf": [
{
"type": "boolean"
},
{
"$ref": "#/definitions/FoldingRangeOptions"
},
{
"$ref": "#/definitions/FoldingRangeRegistrationOptions"
}
],
"description": "The server provides folding provider support."
},
"hoverProvider": {
"anyOf": [
{
"type": "boolean"
},
{
"$ref": "#/definitions/HoverOptions"
}
],
"description": "The server provides hover support."
},
"implementationProvider": {
"anyOf": [
{
"type": "boolean"
},
{
"$ref": "#/definitions/ImplementationOptions"
},
{
"$ref": "#/definitions/ImplementationRegistrationOptions"
}
],
"description": "The server provides Goto Implementation support."
},
"referencesProvider": {
"anyOf": [
{
"type": "boolean"
},
{
"$ref": "#/definitions/ReferenceOptions"
}
],
"description": "The server provides find references support."
},
"renameProvider": {
"anyOf": [
{
"type": "boolean"
},
{
"$ref": "#/definitions/RenameOptions"
}
],
"description": "The server provides rename support. RenameOptions may only be\nspecified if the client states that it supports\n`prepareSupport` in its initial `initialize` request."
},
"selectionRangeProvider": {
"anyOf": [
{
"type": "boolean"
},
{
"$ref": "#/definitions/SelectionRangeOptions"
},
{
"$ref": "#/definitions/SelectionRangeRegistrationOptions"
}
],
"description": "The server provides selection range support."
},
"signatureHelpProvider": {
"$ref": "#/definitions/SignatureHelpOptions",
"description": "The server provides signature help support."
},
"textDocumentSync": {
"anyOf": [
{
"$ref": "#/definitions/TextDocumentSyncOptions"
},
{
"$ref": "#/definitions/TextDocumentSyncKind"
}
],
"description": "Defines how text documents are synced. Is either a detailed structure defining each notification or\nfor backwards compatibility the TextDocumentSyncKind number."
},
"typeDefinitionProvider": {
"anyOf": [
{
"type": "boolean"
},
{
"$ref": "#/definitions/TypeDefinitionOptions"
},
{
"$ref": "#/definitions/TypeDefinitionRegistrationOptions"
}
],
"description": "The server provides Goto Type Definition support."
},
"workspace": {
"additionalProperties": false,
"description": "The workspace server capabilities",
"properties": {
"workspaceFolders": {
"additionalProperties": false,
"properties": {
"changeNotifications": {
"description": "Whether the server wants to receive workspace folder\nchange notifications.\n\nIf a strings is provided the string is treated as a ID\nunder which the notification is registed on the client\nside. The ID can be used to unregister for these events\nusing the `client/unregisterCapability` request.",
"type": [
"string",
"boolean"
]
},
"supported": {
"description": "The Server has support for workspace folders",
"type": "boolean"
}
},
"type": "object"
}
},
"type": "object"
},
"workspaceSymbolProvider": {
"anyOf": [
{
"type": "boolean"
},
{
"$ref": "#/definitions/WorkspaceSymbolOptions"
}
],
"description": "The server provides workspace symbol support."
}
},
"type": "object"
},
"ShowMessageParams": {
"additionalProperties": false,
"description": "The parameters of a notification message.",
"properties": {
"message": {
"description": "The actual message",
"type": "string"
},
"type": {
"$ref": "#/definitions/MessageType",
"description": "The message type. See {@link MessageType}"
}
},
"required": [
"type",
"message"
],
"type": "object"
},
"ShowMessageRequestParams": {
"additionalProperties": false,
"properties": {
"actions": {
"description": "The message action items to present.",
"items": {
"$ref": "#/definitions/MessageActionItem"
},
"type": "array"
},
"message": {
"description": "The actual message",
"type": "string"
},
"type": {
"$ref": "#/definitions/MessageType",
"description": "The message type. See {@link MessageType}"
}
},
"required": [
"type",
"message"
],
"type": "object"
},
"SignatureHelp": {
"additionalProperties": false,
"description": "Signature help represents the signature of something\r\ncallable. There can be multiple signature but only one\r\nactive and only one active parameter.",
"properties": {
"activeParameter": {
"description": "The active parameter of the active signature. Set to `null`\r\nif the active signature has no parameters.",
"type": [
"number",
"null"
]
},
"activeSignature": {
"description": "The active signature. Set to `null` if no\r\nsignatures exist.",
"type": [
"number",
"null"
]
},
"signatures": {
"description": "One or more signatures.",
"items": {
"$ref": "#/definitions/SignatureInformation"
},
"type": "array"
}
},
"required": [
"signatures",
"activeSignature",
"activeParameter"
],
"type": "object"
},
"SignatureHelpClientCapabilities": {
"additionalProperties": false,
"description": "Client Capabilities for a [SignatureHelpRequest](#SignatureHelpRequest).",
"properties": {
"contextSupport": {
"description": "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`.",
"type": "boolean"
},
"dynamicRegistration": {
"description": "Whether signature help supports dynamic registration.",
"type": "boolean"
},
"signatureInformation": {
"additionalProperties": false,
"description": "The client supports the following `SignatureInformation`\nspecific properties.",
"properties": {
"documentationFormat": {
"description": "Client supports the follow content formats for the documentation\nproperty. The order describes the preferred format of the client.",
"items": {
"$ref": "#/definitions/MarkupKind"
},
"type": "array"
},
"parameterInformation": {
"additionalProperties": false,
"description": "Client capabilities specific to parameter information.",
"properties": {
"labelOffsetSupport": {
"description": "The client supports processing label offsets instead of a\nsimple label string.",
"type": "boolean"
}
},
"type": "object"
}
},
"type": "object"
}
},
"type": "object"
},
"SignatureHelpOptions": {
"additionalProperties": false,
"description": "Server Capabilities for a [SignatureHelpRequest](#SignatureHelpRequest).",
"properties": {
"retriggerCharacters": {
"description": "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.",
"items": {
"type": "string"
},
"type": "array"
},
"triggerCharacters": {
"description": "List of characters that trigger signature help.",
"items": {
"type": "string"
},
"type": "array"
},
"workDoneProgress": {
"type": "boolean"
}
},
"type": "object"
},
"SignatureInformation": {
"additionalProperties": false,
"description": "Represents the signature of something callable. A signature\r\ncan have a label, like a function-name, a doc-comment, and\r\na set of parameters. \n The SignatureInformation namespace provides helper functions to work with\r\n[SignatureInformation](#SignatureInformation) literals.",
"properties": {
"documentation": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/definitions/MarkupContent"
}
],
"description": "The human-readable doc-comment of this signature. Will be shown\r\nin the UI but can be omitted."
},
"label": {
"description": "The label of this signature. Will be shown in\r\nthe UI.",
"type": "string"
},
"parameters": {
"description": "The parameters of this signature.",
"items": {
"$ref": "#/definitions/ParameterInformation"
},
"type": "array"
}
},
"required": [
"label"
],
"type": "object"
},
"SymbolInformation": {
"additionalProperties": false,
"description": "Represents information about programming constructs like variables, classes,\r\ninterfaces etc.",
"properties": {
"containerName": {
"description": "The name of the symbol containing this symbol. This information is for\r\nuser interface purposes (e.g. to render a qualifier in the user interface\r\nif necessary). It can't be used to re-infer a hierarchy for the document\r\nsymbols.",
"type": "string"
},
"deprecated": {
"description": "Indicates if this symbol is deprecated.",
"type": "boolean"
},
"kind": {
"$ref": "#/definitions/SymbolKind",
"description": "The kind of this symbol."
},
"location": {
"$ref": "#/definitions/Location",
"description": "The location of this symbol. The location's range is used by a tool\r\nto reveal the location in the editor. If the symbol is selected in the\r\ntool the range's start information is used to position the cursor. So\r\nthe range usually spans more than the actual symbol's name and does\r\nnormally include thinks like visibility modifiers.\r\n\r\nThe range doesn't have to denote a node range in the sense of a abstract\r\nsyntax tree. It can therefore not be used to re-construct a hierarchy of\r\nthe symbols."
},
"name": {
"description": "The name of this symbol.",
"type": "string"
}
},
"required": [
"name",
"kind",
"location"
],
"type": "object"
},
"SymbolKind": {
"description": "A symbol kind.",
"enum": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26
],
"type": "number"
},
"TextDocumentClientCapabilities": {
"additionalProperties": false,
"description": "Text document specific client capabilities.",
"properties": {
"codeAction": {
"$ref": "#/definitions/CodeActionClientCapabilities",
"description": "Capabilities specific to the `textDocument/codeAction`"
},
"codeLens": {
"$ref": "#/definitions/CodeLensClientCapabilities",
"description": "Capabilities specific to the `textDocument/codeLens`"
},
"colorProvider": {
"$ref": "#/definitions/DocumentColorClientCapabilities",
"description": "Capabilities specific to the `textDocument/documentColor`"
},
"completion": {
"$ref": "#/definitions/CompletionClientCapabilities",
"description": "Capabilities specific to the `textDocument/completion`"
},
"declaration": {
"$ref": "#/definitions/DeclarationClientCapabilities",
"description": "Capabilities specific to the `textDocument/declaration`"
},
"definition": {
"$ref": "#/definitions/DefinitionClientCapabilities",
"description": "Capabilities specific to the `textDocument/definition`"
},
"documentHighlight": {
"$ref": "#/definitions/DocumentHighlightClientCapabilities",
"description": "Capabilities specific to the `textDocument/documentHighlight`"
},
"documentLink": {
"$ref": "#/definitions/DocumentLinkClientCapabilities",
"description": "Capabilities specific to the `textDocument/documentLink`"
},
"documentSymbol": {
"$ref": "#/definitions/DocumentSymbolClientCapabilities",
"description": "Capabilities specific to the `textDocument/documentSymbol`"
},
"foldingRange": {
"$ref": "#/definitions/FoldingRangeClientCapabilities",
"description": "Capabilities specific to `textDocument/foldingRange` requests."
},
"formatting": {
"$ref": "#/definitions/DocumentFormattingClientCapabilities",
"description": "Capabilities specific to the `textDocument/formatting`"
},
"hover": {
"$ref": "#/definitions/HoverClientCapabilities",
"description": "Capabilities specific to the `textDocument/hover`"
},
"implementation": {
"$ref": "#/definitions/ImplementationClientCapabilities",
"description": "Capabilities specific to the `textDocument/implementation`"
},
"onTypeFormatting": {
"$ref": "#/definitions/DocumentOnTypeFormattingClientCapabilities",
"description": "Capabilities specific to the `textDocument/onTypeFormatting`"
},
"publishDiagnostics": {
"$ref": "#/definitions/PublishDiagnosticsClientCapabilities",
"description": "Capabilities specific to `textDocument/publishDiagnostics`."
},
"rangeFormatting": {
"$ref": "#/definitions/DocumentRangeFormattingClientCapabilities",
"description": "Capabilities specific to the `textDocument/rangeFormatting`"
},
"references": {
"$ref": "#/definitions/ReferenceClientCapabilities",
"description": "Capabilities specific to the `textDocument/references`"
},
"rename": {
"$ref": "#/definitions/RenameClientCapabilities",
"description": "Capabilities specific to the `textDocument/rename`"
},
"selectionRange": {
"$ref": "#/definitions/SelectionRangeClientCapabilities",
"description": "Capabilities specific to `textDocument/selectionRange` requests"
},
"signatureHelp": {
"$ref": "#/definitions/SignatureHelpClientCapabilities",
"description": "Capabilities specific to the `textDocument/signatureHelp`"
},
"synchronization": {
"$ref": "#/definitions/TextDocumentSyncClientCapabilities",
"description": "Defines which synchronization capabilities the client supports."
},
"typeDefinition": {
"$ref": "#/definitions/TypeDefinitionClientCapabilities",
"description": "Capabilities specific to the `textDocument/typeDefinition`"
}
},
"type": "object"
},
"TextDocumentContentChangeEvent": {
"additionalProperties": false,
"description": "An event describing a change to a text document. If range and rangeLength are omitted\r\nthe new text is considered to be the full content of the document.",
"properties": {
"range": {
"$ref": "#/definitions/Range",
"description": "The range of the document that changed."
},
"rangeLength": {
"description": "The length of the range that got replaced.",
"type": "number"
},
"text": {
"description": "The new text of the document.",
"type": "string"
}
},
"required": [
"text"
],
"type": "object"
},
"TextDocumentEdit": {
"additionalProperties": false,
"description": "Describes textual changes on a text document. \n The TextDocumentEdit namespace provides helper function to create\r\nan edit that manipulates a text document.",
"properties": {
"edits": {
"description": "The edits to be applied.",
"items": {
"$ref": "#/definitions/TextEdit"
},
"type": "array"
},
"textDocument": {
"$ref": "#/definitions/VersionedTextDocumentIdentifier",
"description": "The text document to change."
}
},
"required": [
"textDocument",
"edits"
],
"type": "object"
},
"TextDocumentIdentifier": {
"additionalProperties": false,
"description": "A literal to identify a text document in the client. \n The TextDocumentIdentifier namespace provides helper functions to work with\r\n[TextDocumentIdentifier](#TextDocumentIdentifier) literals.",
"properties": {
"uri": {
"$ref": "#/definitions/DocumentUri",
"description": "The text document's uri."
}
},
"required": [
"uri"
],
"type": "object"
},
"TextDocumentItem": {
"additionalProperties": false,
"description": "An item to transfer a text document from the client to the\r\nserver. \n The TextDocumentItem namespace provides helper functions to work with\r\n[TextDocumentItem](#TextDocumentItem) literals.",
"properties": {
"languageId": {
"description": "The text document's language identifier",
"type": "string"
},
"text": {
"description": "The content of the opened text document.",
"type": "string"
},
"uri": {
"$ref": "#/definitions/DocumentUri",
"description": "The text document's uri."
},
"version": {
"description": "The version number of this document (it will increase after each\r\nchange, including undo/redo).",
"type": "number"
}
},
"required": [
"uri",
"languageId",
"version",
"text"
],
"type": "object"
},
"TextDocumentPositionParams": {
"additionalProperties": false,
"description": "A parameter literal used in requests to pass a text document and a position inside that\ndocument.",
"properties": {
"position": {
"$ref": "#/definitions/Position",
"description": "The position inside the text document."
},
"textDocument": {
"$ref": "#/definitions/TextDocumentIdentifier",
"description": "The text document."
}
},
"required": [
"textDocument",
"position"
],
"type": "object"
},
"TextDocumentSaveReason": {
"description": "Represents reasons why a text document is saved.",
"enum": [
1,
2,
3
],
"type": "number"
},
"TextDocumentSyncClientCapabilities": {
"additionalProperties": false,
"properties": {
"didSave": {
"description": "The client supports did save notifications.",
"type": "boolean"
},
"dynamicRegistration": {
"description": "Whether text document synchronization supports dynamic registration.",
"type": "boolean"
},
"willSave": {
"description": "The client supports sending will save notifications.",
"type": "boolean"
},
"willSaveWaitUntil": {
"description": "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.",
"type": "boolean"
}
},
"type": "object"
},
"TextDocumentSyncKind": {
"description": "Defines how the host (editor) should sync\ndocument changes to the language server.",
"enum": [
0,
1,
2
],
"type": "number"
},
"TextDocumentSyncOptions": {
"additionalProperties": false,
"properties": {
"change": {
"$ref": "#/definitions/TextDocumentSyncKind",
"description": "Change notifications are sent to the server. See TextDocumentSyncKind.None, TextDocumentSyncKind.Full\nand TextDocumentSyncKind.Incremental. If omitted it defaults to TextDocumentSyncKind.None."
},
"openClose": {
"description": "Open and close notifications are sent to the server. If omitted open close notification should not\nbe sent.",
"type": "boolean"
},
"save": {
"$ref": "#/definitions/SaveOptions",
"description": "If present save notifications are sent to the server. If omitted the notification should not be\nsent."
},
"willSave": {
"description": "If present will save notifications are sent to the server. If omitted the notification should not be\nsent.",
"type": "boolean"
},
"willSaveWaitUntil": {
"description": "If present will save wait until requests are sent to the server. If omitted the request should not be\nsent.",
"type": "boolean"
}
},
"type": "object"
},
"TextEdit": {
"additionalProperties": false,
"description": "A text edit applicable to a text document. \n The TextEdit namespace provides helper function to create replace,\r\ninsert and delete edits more easily.",
"properties": {
"newText": {
"description": "The string to be inserted. For delete operations use an\r\nempty string.",
"type": "string"
},
"range": {
"$ref": "#/definitions/Range",
"description": "The range of the text document to be manipulated. To insert\r\ntext into a document create a range where start === end."
}
},
"required": [
"range",
"newText"
],
"type": "object"
},
"TypeDefinitionClientCapabilities": {
"additionalProperties": false,
"description": "Since 3.6.0",
"properties": {
"dynamicRegistration": {
"description": "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.",
"type": "boolean"
},
"linkSupport": {
"description": "The client supports additional metadata in the form of definition links.\n\nSince 3.14.0",
"type": "boolean"
}
},
"type": "object"
},
"TypeDefinitionOptions": {
"additionalProperties": false,
"properties": {
"workDoneProgress": {
"type": "boolean"
}
},
"type": "object"
},
"TypeDefinitionRegistrationOptions": {
"additionalProperties": false,
"properties": {
"documentSelector": {
"anyOf": [
{
"$ref": "#/definitions/DocumentSelector"
},
{
"type": "null"
}
],
"description": "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."
},
"id": {
"description": "The id used to register the request. The id can be used to deregister\nthe request again. See also Registration#id.",
"type": "string"
},
"workDoneProgress": {
"type": "boolean"
}
},
"required": [
"documentSelector"
],
"type": "object"
},
"Unregistration": {
"additionalProperties": false,
"description": "General parameters to unregister a request or notification.",
"properties": {
"id": {
"description": "The id used to unregister the request or notification. Usually an id\nprovided during the register request.",
"type": "string"
},
"method": {
"description": "The method to unregister for.",
"type": "string"
}
},
"required": [
"id",
"method"
],
"type": "object"
},
"UnregistrationParams": {
"additionalProperties": false,
"properties": {
"unregisterations": {
"items": {
"$ref": "#/definitions/Unregistration"
},
"type": "array"
}
},
"required": [
"unregisterations"
],
"type": "object"
},
"VersionedTextDocumentIdentifier": {
"additionalProperties": false,
"description": "An identifier to denote a specific version of a text document. \n The VersionedTextDocumentIdentifier namespace provides helper functions to work with\r\n[VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) literals.",
"properties": {
"uri": {
"$ref": "#/definitions/DocumentUri",
"description": "The text document's uri."
},
"version": {
"description": "The version number of this document. If a versioned text document identifier\r\nis sent from the server to the client and the file is not open in the editor\r\n(the server has not received an open notification before) the server can send\r\n`null` to indicate that the version is unknown and the content on disk is the\r\ntruth (as speced with document content ownership).",
"type": [
"number",
"null"
]
}
},
"required": [
"uri",
"version"
],
"type": "object"
},
"WillSaveTextDocumentParams": {
"additionalProperties": false,
"description": "The parameters send in a will save text document notification.",
"properties": {
"reason": {
"$ref": "#/definitions/TextDocumentSaveReason",
"description": "The 'TextDocumentSaveReason'."
},
"textDocument": {
"$ref": "#/definitions/TextDocumentIdentifier",
"description": "The document that will be saved."
}
},
"required": [
"textDocument",
"reason"
],
"type": "object"
},
"WorkspaceClientCapabilities": {
"additionalProperties": false,
"description": "Workspace specific client capabilities.",
"properties": {
"applyEdit": {
"description": "The client supports applying batch edits\nto the workspace by supporting the request\n'workspace/applyEdit'",
"type": "boolean"
},
"didChangeConfiguration": {
"$ref": "#/definitions/DidChangeConfigurationClientCapabilities",
"description": "Capabilities specific to the `workspace/didChangeConfiguration` notification."
},
"didChangeWatchedFiles": {
"$ref": "#/definitions/DidChangeWatchedFilesClientCapabilities",
"description": "Capabilities specific to the `workspace/didChangeWatchedFiles` notification."
},
"executeCommand": {
"$ref": "#/definitions/ExecuteCommandClientCapabilities",
"description": "Capabilities specific to the `workspace/executeCommand` request."
},
"symbol": {
"$ref": "#/definitions/WorkspaceSymbolClientCapabilities",
"description": "Capabilities specific to the `workspace/symbol` request."
},
"workspaceEdit": {
"$ref": "#/definitions/WorkspaceEditClientCapabilities",
"description": "Capabilities specific to `WorkspaceEdit`s"
}
},
"type": "object"
},
"WorkspaceEdit": {
"additionalProperties": false,
"description": "A workspace edit represents changes to many resources managed in the workspace. The edit\r\nshould either provide `changes` or `documentChanges`. If documentChanges are present\r\nthey are preferred over `changes` if the client can handle versioned document edits.",
"properties": {
"changes": {
"additionalProperties": {
"items": {
"$ref": "#/definitions/TextEdit"
},
"type": "array"
},
"description": "Holds changes to existing resources.",
"type": "object"
},
"documentChanges": {
"description": "Depending on the client capability `workspace.workspaceEdit.resourceOperations` document changes\r\nare either an array of `TextDocumentEdit`s to express changes to n different text documents\r\nwhere each text document edit addresses a specific version of a text document. Or it can contain\r\nabove `TextDocumentEdit`s mixed with create, rename and delete file / folder operations.\r\n\r\nWhether a client supports versioned document edits is expressed via\r\n`workspace.workspaceEdit.documentChanges` client capability.\r\n\r\nIf a client neither supports `documentChanges` nor `workspace.workspaceEdit.resourceOperations` then\r\nonly plain `TextEdit`s using the `changes` property are supported.",
"items": {
"anyOf": [
{
"$ref": "#/definitions/TextDocumentEdit"
},
{
"$ref": "#/definitions/CreateFile"
},
{
"$ref": "#/definitions/RenameFile"
},
{
"$ref": "#/definitions/DeleteFile"
}
]
},
"type": "array"
}
},
"type": "object"
},
"WorkspaceEditClientCapabilities": {
"additionalProperties": false,
"properties": {
"documentChanges": {
"description": "The client supports versioned document changes in `WorkspaceEdit`s",
"type": "boolean"
},
"failureHandling": {
"$ref": "#/definitions/FailureHandlingKind",
"description": "The failure handling strategy of a client if applying the workspace edit\nfails."
},
"resourceOperations": {
"description": "The resource operations the client supports. Clients should at least\nsupport 'create', 'rename' and 'delete' files and folders.",
"items": {
"$ref": "#/definitions/ResourceOperationKind"
},
"type": "array"
}
},
"type": "object"
},
"WorkspaceFolder": {
"additionalProperties": false,
"properties": {
"name": {
"description": "The name of the workspace folder. Used to refer to this\nworkspace folder in thge user interface.",
"type": "string"
},
"uri": {
"description": "The associated URI for this workspace folder.",
"type": "string"
}
},
"required": [
"uri",
"name"
],
"type": "object"
},
"WorkspaceFoldersChangeEvent": {
"additionalProperties": false,
"description": "The workspace folder change event.",
"properties": {
"added": {
"description": "The array of added workspace folders",
"items": {
"$ref": "#/definitions/WorkspaceFolder"
},
"type": "array"
},
"removed": {
"description": "The array of the removed workspace folders",
"items": {
"$ref": "#/definitions/WorkspaceFolder"
},
"type": "array"
}
},
"required": [
"added",
"removed"
],
"type": "object"
},
"WorkspaceSymbolClientCapabilities": {
"additionalProperties": false,
"description": "Client capabilities for a [WorkspaceSymbolRequest](#WorkspaceSymbolRequest).",
"properties": {
"dynamicRegistration": {
"description": "Symbol request supports dynamic registration.",
"type": "boolean"
},
"symbolKind": {
"additionalProperties": false,
"description": "Specific capabilities for the `SymbolKind` in the `workspace/symbol` request.",
"properties": {
"valueSet": {
"description": "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.",
"items": {
"$ref": "#/definitions/SymbolKind"
},
"type": "array"
}
},
"type": "object"
}
},
"type": "object"
},
"WorkspaceSymbolOptions": {
"additionalProperties": false,
"description": "Server capabilities for a [WorkspaceSymbolRequest](#WorkspaceSymbolRequest).",
"properties": {
"workDoneProgress": {
"type": "boolean"
}
},
"type": "object"
},
"WorkspaceSymbolParams": {
"additionalProperties": false,
"description": "The parameters of a [WorkspaceSymbolRequest](#WorkspaceSymbolRequest).",
"properties": {
"partialResultToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report partial results (e.g. streaming) to\nthe client."
},
"query": {
"description": "A query string to filter symbols by. Clients may send an empty\nstring here to request all symbols.",
"type": "string"
},
"workDoneToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report work done progress."
}
},
"required": [
"query"
],
"type": "object"
},
"_AnyFeature": {
"anyOf": [
{
"$ref": "#/definitions/_CodeLensResolveFeature"
},
{
"$ref": "#/definitions/_CompletionItemResolveFeature"
},
{
"$ref": "#/definitions/_DocumentLinkResolveFeature"
},
{
"$ref": "#/definitions/_InitializeFeature"
},
{
"$ref": "#/definitions/_ShutdownFeature"
},
{
"$ref": "#/definitions/_TextDocumentCodeActionFeature"
},
{
"$ref": "#/definitions/_TextDocumentCodeLensFeature"
},
{
"$ref": "#/definitions/_TextDocumentColorPresentationFeature"
},
{
"$ref": "#/definitions/_TextDocumentCompletionFeature"
},
{
"$ref": "#/definitions/_TextDocumentDeclarationFeature"
},
{
"$ref": "#/definitions/_TextDocumentDefinitionFeature"
},
{
"$ref": "#/definitions/_TextDocumentDocumentColorFeature"
},
{
"$ref": "#/definitions/_TextDocumentDocumentHighlightFeature"
},
{
"$ref": "#/definitions/_TextDocumentDocumentLinkFeature"
},
{
"$ref": "#/definitions/_TextDocumentDocumentSymbolFeature"
},
{
"$ref": "#/definitions/_TextDocumentFoldingRangeFeature"
},
{
"$ref": "#/definitions/_TextDocumentFormattingFeature"
},
{
"$ref": "#/definitions/_TextDocumentHoverFeature"
},
{
"$ref": "#/definitions/_TextDocumentImplementationFeature"
},
{
"$ref": "#/definitions/_TextDocumentOnTypeFormattingFeature"
},
{
"$ref": "#/definitions/_TextDocumentPrepareRenameFeature"
},
{
"$ref": "#/definitions/_TextDocumentRangeFormattingFeature"
},
{
"$ref": "#/definitions/_TextDocumentReferencesFeature"
},
{
"$ref": "#/definitions/_TextDocumentRenameFeature"
},
{
"$ref": "#/definitions/_TextDocumentSignatureHelpFeature"
},
{
"$ref": "#/definitions/_TextDocumentTypeDefinitionFeature"
},
{
"$ref": "#/definitions/_TextDocumentWillSaveWaitUntilFeature"
},
{
"$ref": "#/definitions/_WorkspaceExecuteCommandFeature"
},
{
"$ref": "#/definitions/_WorkspaceSymbolFeature"
},
{
"$ref": "#/definitions/_ClientRegisterCapabilityFeature"
},
{
"$ref": "#/definitions/_ClientUnregisterCapabilityFeature"
},
{
"$ref": "#/definitions/_WindowShowMessageRequestFeature"
},
{
"$ref": "#/definitions/_WorkspaceApplyEditFeature"
},
{
"$ref": "#/definitions/_WorkspaceConfigurationFeature"
},
{
"$ref": "#/definitions/_WorkspaceWorkspaceFoldersFeature"
},
{
"$ref": "#/definitions/_ExitFeature"
},
{
"$ref": "#/definitions/_InitializedFeature"
},
{
"$ref": "#/definitions/_TextDocumentDidChangeFeature"
},
{
"$ref": "#/definitions/_TextDocumentDidCloseFeature"
},
{
"$ref": "#/definitions/_TextDocumentDidOpenFeature"
},
{
"$ref": "#/definitions/_TextDocumentDidSaveFeature"
},
{
"$ref": "#/definitions/_TextDocumentWillSaveFeature"
},
{
"$ref": "#/definitions/_WorkspaceDidChangeConfigurationFeature"
},
{
"$ref": "#/definitions/_WorkspaceDidChangeWatchedFilesFeature"
},
{
"$ref": "#/definitions/_WorkspaceDidChangeWorkspaceFoldersFeature"
},
{
"$ref": "#/definitions/_CancelRequestFeature"
},
{
"$ref": "#/definitions/_TelemetryEventFeature"
},
{
"$ref": "#/definitions/_TextDocumentPublishDiagnosticsFeature"
},
{
"$ref": "#/definitions/_WindowLogMessageFeature"
},
{
"$ref": "#/definitions/_WindowShowMessageFeature"
}
]
},
"_CancelRequestFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_CancelRequestRequest"
}
},
"required": [
"request"
],
"type": "object"
},
"_CancelRequestRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"$/cancelRequest"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/CancelParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_ClientRegisterCapabilityFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_ClientRegisterCapabilityRequest"
},
"response": {
"anyOf": [
{
"$ref": "#/definitions/_ClientRegisterCapabilityResponse"
},
{
"$ref": "#/definitions/_ErrorResponse"
}
]
}
},
"required": [
"request",
"response"
],
"type": "object"
},
"_ClientRegisterCapabilityRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"client/registerCapability"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/RegistrationParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_ClientRegisterCapabilityResponse": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string",
"null"
]
},
"jsonrpc": {
"type": "string"
},
"result": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "object"
},
{
"type": "null"
}
],
"description": "The result of a request. This member is REQUIRED on success.\r\nThis member MUST NOT exist if there was an error invoking the method.",
"type": "null"
}
},
"required": [
"id",
"jsonrpc",
"result"
],
"type": "object"
},
"_ClientUnregisterCapabilityFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_ClientUnregisterCapabilityRequest"
},
"response": {
"anyOf": [
{
"$ref": "#/definitions/_ClientUnregisterCapabilityResponse"
},
{
"$ref": "#/definitions/_ErrorResponse"
}
]
}
},
"required": [
"request",
"response"
],
"type": "object"
},
"_ClientUnregisterCapabilityRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"client/unregisterCapability"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/UnregistrationParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_ClientUnregisterCapabilityResponse": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string",
"null"
]
},
"jsonrpc": {
"type": "string"
},
"result": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "object"
},
{
"type": "null"
}
],
"description": "The result of a request. This member is REQUIRED on success.\r\nThis member MUST NOT exist if there was an error invoking the method.",
"type": "null"
}
},
"required": [
"id",
"jsonrpc",
"result"
],
"type": "object"
},
"_CodeLensResolveFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_CodeLensResolveRequest"
},
"response": {
"anyOf": [
{
"$ref": "#/definitions/_CodeLensResolveResponse"
},
{
"$ref": "#/definitions/_ErrorResponse"
}
]
}
},
"required": [
"request",
"response"
],
"type": "object"
},
"_CodeLensResolveRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"codeLens/resolve"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/CodeLens",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_CodeLensResolveResponse": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string",
"null"
]
},
"jsonrpc": {
"type": "string"
},
"result": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "object"
},
{
"type": "null"
}
],
"description": "The result of a request. This member is REQUIRED on success.\r\nThis member MUST NOT exist if there was an error invoking the method."
}
},
"required": [
"id",
"jsonrpc",
"result"
],
"type": "object"
},
"_CompletionItemResolveFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_CompletionItemResolveRequest"
},
"response": {
"anyOf": [
{
"$ref": "#/definitions/_CompletionItemResolveResponse"
},
{
"$ref": "#/definitions/_ErrorResponse"
}
]
}
},
"required": [
"request",
"response"
],
"type": "object"
},
"_CompletionItemResolveRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"completionItem/resolve"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/CompletionItem",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_CompletionItemResolveResponse": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string",
"null"
]
},
"jsonrpc": {
"type": "string"
},
"result": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "object"
},
{
"type": "null"
}
],
"description": "The result of a request. This member is REQUIRED on success.\r\nThis member MUST NOT exist if there was an error invoking the method."
}
},
"required": [
"id",
"jsonrpc",
"result"
],
"type": "object"
},
"_DocumentLinkResolveFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_DocumentLinkResolveRequest"
},
"response": {
"anyOf": [
{
"$ref": "#/definitions/_DocumentLinkResolveResponse"
},
{
"$ref": "#/definitions/_ErrorResponse"
}
]
}
},
"required": [
"request",
"response"
],
"type": "object"
},
"_DocumentLinkResolveRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"documentLink/resolve"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/DocumentLink",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_DocumentLinkResolveResponse": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string",
"null"
]
},
"jsonrpc": {
"type": "string"
},
"result": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "object"
},
{
"type": "null"
}
],
"description": "The result of a request. This member is REQUIRED on success.\r\nThis member MUST NOT exist if there was an error invoking the method."
}
},
"required": [
"id",
"jsonrpc",
"result"
],
"type": "object"
},
"_ErrorResponse": {
"additionalProperties": false,
"properties": {
"error": {
"$ref": "#/definitions/ResponseErrorLiteral<any>",
"description": "The error object in case a request fails."
},
"id": {
"description": "The request id.",
"type": [
"number",
"string",
"null"
]
},
"jsonrpc": {
"type": "string"
}
},
"required": [
"error",
"id",
"jsonrpc"
],
"type": "object"
},
"_ExitFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_ExitRequest"
}
},
"required": [
"request"
],
"type": "object"
},
"_ExitRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"exit"
],
"type": "string"
},
"params": {
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method"
],
"type": "object"
},
"_InitializeFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_InitializeRequest"
},
"response": {
"anyOf": [
{
"$ref": "#/definitions/_InitializeResponse"
},
{
"$ref": "#/definitions/_ErrorResponse"
}
]
}
},
"required": [
"request",
"response"
],
"type": "object"
},
"_InitializeRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"initialize"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/InitializeParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_InitializeResponse": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string",
"null"
]
},
"jsonrpc": {
"type": "string"
},
"result": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "object"
},
{
"type": "null"
}
],
"description": "The result of a request. This member is REQUIRED on success.\r\nThis member MUST NOT exist if there was an error invoking the method."
}
},
"required": [
"id",
"jsonrpc",
"result"
],
"type": "object"
},
"_InitializedFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_InitializedRequest"
}
},
"required": [
"request"
],
"type": "object"
},
"_InitializedRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"initialized"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/InitializedParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_ShutdownFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_ShutdownRequest"
},
"response": {
"anyOf": [
{
"$ref": "#/definitions/_ShutdownResponse"
},
{
"$ref": "#/definitions/_ErrorResponse"
}
]
}
},
"required": [
"request",
"response"
],
"type": "object"
},
"_ShutdownRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"shutdown"
],
"type": "string"
},
"params": {
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method"
],
"type": "object"
},
"_ShutdownResponse": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string",
"null"
]
},
"jsonrpc": {
"type": "string"
},
"result": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "object"
},
{
"type": "null"
}
],
"description": "The result of a request. This member is REQUIRED on success.\r\nThis member MUST NOT exist if there was an error invoking the method.",
"type": "null"
}
},
"required": [
"id",
"jsonrpc",
"result"
],
"type": "object"
},
"_TelemetryEventFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_TelemetryEventRequest"
}
},
"required": [
"request"
],
"type": "object"
},
"_TelemetryEventRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"telemetry/event"
],
"type": "string"
},
"params": {
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method"
],
"type": "object"
},
"_TextDocumentCodeActionFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_TextDocumentCodeActionRequest"
},
"response": {
"anyOf": [
{
"$ref": "#/definitions/_TextDocumentCodeActionResponse"
},
{
"$ref": "#/definitions/_ErrorResponse"
}
]
}
},
"required": [
"request",
"response"
],
"type": "object"
},
"_TextDocumentCodeActionRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"textDocument/codeAction"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/CodeActionParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_TextDocumentCodeActionResponse": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string",
"null"
]
},
"jsonrpc": {
"type": "string"
},
"result": {
"anyOf": [
{
"items": {
"anyOf": [
{
"$ref": "#/definitions/Command"
},
{
"$ref": "#/definitions/CodeAction"
}
]
},
"type": "array"
},
{
"type": "null"
}
],
"description": "The result of a request. This member is REQUIRED on success.\r\nThis member MUST NOT exist if there was an error invoking the method."
}
},
"required": [
"id",
"jsonrpc",
"result"
],
"type": "object"
},
"_TextDocumentCodeLensFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_TextDocumentCodeLensRequest"
},
"response": {
"anyOf": [
{
"$ref": "#/definitions/_TextDocumentCodeLensResponse"
},
{
"$ref": "#/definitions/_ErrorResponse"
}
]
}
},
"required": [
"request",
"response"
],
"type": "object"
},
"_TextDocumentCodeLensRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"textDocument/codeLens"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/CodeLensParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_TextDocumentCodeLensResponse": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string",
"null"
]
},
"jsonrpc": {
"type": "string"
},
"result": {
"anyOf": [
{
"items": {
"$ref": "#/definitions/CodeLens"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "The result of a request. This member is REQUIRED on success.\r\nThis member MUST NOT exist if there was an error invoking the method."
}
},
"required": [
"id",
"jsonrpc",
"result"
],
"type": "object"
},
"_TextDocumentColorPresentationFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_TextDocumentColorPresentationRequest"
},
"response": {
"anyOf": [
{
"$ref": "#/definitions/_TextDocumentColorPresentationResponse"
},
{
"$ref": "#/definitions/_ErrorResponse"
}
]
}
},
"required": [
"request",
"response"
],
"type": "object"
},
"_TextDocumentColorPresentationRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"textDocument/colorPresentation"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/ColorPresentationParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_TextDocumentColorPresentationResponse": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string",
"null"
]
},
"jsonrpc": {
"type": "string"
},
"result": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "object"
},
{
"type": "null"
}
],
"description": "The result of a request. This member is REQUIRED on success.\r\nThis member MUST NOT exist if there was an error invoking the method.",
"items": {
"$ref": "#/definitions/ColorPresentation"
},
"type": "array"
}
},
"required": [
"id",
"jsonrpc",
"result"
],
"type": "object"
},
"_TextDocumentCompletionFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_TextDocumentCompletionRequest"
},
"response": {
"anyOf": [
{
"$ref": "#/definitions/_TextDocumentCompletionResponse"
},
{
"$ref": "#/definitions/_ErrorResponse"
}
]
}
},
"required": [
"request",
"response"
],
"type": "object"
},
"_TextDocumentCompletionRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"textDocument/completion"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/CompletionParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_TextDocumentCompletionResponse": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string",
"null"
]
},
"jsonrpc": {
"type": "string"
},
"result": {
"anyOf": [
{
"items": {
"$ref": "#/definitions/CompletionItem"
},
"type": "array"
},
{
"$ref": "#/definitions/CompletionList"
},
{
"type": "null"
}
],
"description": "The result of a request. This member is REQUIRED on success.\r\nThis member MUST NOT exist if there was an error invoking the method."
}
},
"required": [
"id",
"jsonrpc",
"result"
],
"type": "object"
},
"_TextDocumentDeclarationFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_TextDocumentDeclarationRequest"
},
"response": {
"anyOf": [
{
"$ref": "#/definitions/_TextDocumentDeclarationResponse"
},
{
"$ref": "#/definitions/_ErrorResponse"
}
]
}
},
"required": [
"request",
"response"
],
"type": "object"
},
"_TextDocumentDeclarationRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"textDocument/declaration"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/TextDocumentPositionParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_TextDocumentDeclarationResponse": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string",
"null"
]
},
"jsonrpc": {
"type": "string"
},
"result": {
"anyOf": [
{
"items": {
"$ref": "#/definitions/Location"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "The result of a request. This member is REQUIRED on success.\r\nThis member MUST NOT exist if there was an error invoking the method."
}
},
"required": [
"id",
"jsonrpc",
"result"
],
"type": "object"
},
"_TextDocumentDefinitionFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_TextDocumentDefinitionRequest"
},
"response": {
"anyOf": [
{
"$ref": "#/definitions/_TextDocumentDefinitionResponse"
},
{
"$ref": "#/definitions/_ErrorResponse"
}
]
}
},
"required": [
"request",
"response"
],
"type": "object"
},
"_TextDocumentDefinitionRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"textDocument/definition"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/TextDocumentPositionParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_TextDocumentDefinitionResponse": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string",
"null"
]
},
"jsonrpc": {
"type": "string"
},
"result": {
"anyOf": [
{
"items": {
"$ref": "#/definitions/Location"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "The result of a request. This member is REQUIRED on success.\r\nThis member MUST NOT exist if there was an error invoking the method."
}
},
"required": [
"id",
"jsonrpc",
"result"
],
"type": "object"
},
"_TextDocumentDidChangeFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_TextDocumentDidChangeRequest"
}
},
"required": [
"request"
],
"type": "object"
},
"_TextDocumentDidChangeRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"textDocument/didChange"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/DidChangeTextDocumentParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_TextDocumentDidCloseFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_TextDocumentDidCloseRequest"
}
},
"required": [
"request"
],
"type": "object"
},
"_TextDocumentDidCloseRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"textDocument/didClose"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/DidCloseTextDocumentParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_TextDocumentDidOpenFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_TextDocumentDidOpenRequest"
}
},
"required": [
"request"
],
"type": "object"
},
"_TextDocumentDidOpenRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"textDocument/didOpen"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/DidOpenTextDocumentParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_TextDocumentDidSaveFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_TextDocumentDidSaveRequest"
}
},
"required": [
"request"
],
"type": "object"
},
"_TextDocumentDidSaveRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"textDocument/didSave"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/DidSaveTextDocumentParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_TextDocumentDocumentColorFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_TextDocumentDocumentColorRequest"
},
"response": {
"anyOf": [
{
"$ref": "#/definitions/_TextDocumentDocumentColorResponse"
},
{
"$ref": "#/definitions/_ErrorResponse"
}
]
}
},
"required": [
"request",
"response"
],
"type": "object"
},
"_TextDocumentDocumentColorRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"textDocument/documentColor"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/DocumentColorParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_TextDocumentDocumentColorResponse": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string",
"null"
]
},
"jsonrpc": {
"type": "string"
},
"result": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "object"
},
{
"type": "null"
}
],
"description": "The result of a request. This member is REQUIRED on success.\r\nThis member MUST NOT exist if there was an error invoking the method.",
"items": {
"$ref": "#/definitions/ColorInformation"
},
"type": "array"
}
},
"required": [
"id",
"jsonrpc",
"result"
],
"type": "object"
},
"_TextDocumentDocumentHighlightFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_TextDocumentDocumentHighlightRequest"
},
"response": {
"anyOf": [
{
"$ref": "#/definitions/_TextDocumentDocumentHighlightResponse"
},
{
"$ref": "#/definitions/_ErrorResponse"
}
]
}
},
"required": [
"request",
"response"
],
"type": "object"
},
"_TextDocumentDocumentHighlightRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"textDocument/documentHighlight"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/TextDocumentPositionParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_TextDocumentDocumentHighlightResponse": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string",
"null"
]
},
"jsonrpc": {
"type": "string"
},
"result": {
"anyOf": [
{
"items": {
"$ref": "#/definitions/DocumentHighlight"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "The result of a request. This member is REQUIRED on success.\r\nThis member MUST NOT exist if there was an error invoking the method."
}
},
"required": [
"id",
"jsonrpc",
"result"
],
"type": "object"
},
"_TextDocumentDocumentLinkFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_TextDocumentDocumentLinkRequest"
},
"response": {
"anyOf": [
{
"$ref": "#/definitions/_TextDocumentDocumentLinkResponse"
},
{
"$ref": "#/definitions/_ErrorResponse"
}
]
}
},
"required": [
"request",
"response"
],
"type": "object"
},
"_TextDocumentDocumentLinkRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"textDocument/documentLink"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/DocumentLinkParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_TextDocumentDocumentLinkResponse": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string",
"null"
]
},
"jsonrpc": {
"type": "string"
},
"result": {
"anyOf": [
{
"items": {
"$ref": "#/definitions/DocumentLink"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "The result of a request. This member is REQUIRED on success.\r\nThis member MUST NOT exist if there was an error invoking the method."
}
},
"required": [
"id",
"jsonrpc",
"result"
],
"type": "object"
},
"_TextDocumentDocumentSymbolFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_TextDocumentDocumentSymbolRequest"
},
"response": {
"anyOf": [
{
"$ref": "#/definitions/_TextDocumentDocumentSymbolResponse"
},
{
"$ref": "#/definitions/_ErrorResponse"
}
]
}
},
"required": [
"request",
"response"
],
"type": "object"
},
"_TextDocumentDocumentSymbolRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"textDocument/documentSymbol"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/DocumentSymbolParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_TextDocumentDocumentSymbolResponse": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string",
"null"
]
},
"jsonrpc": {
"type": "string"
},
"result": {
"anyOf": [
{
"items": {
"$ref": "#/definitions/DocumentSymbol"
},
"type": "array"
},
{
"items": {
"$ref": "#/definitions/SymbolInformation"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "The result of a request. This member is REQUIRED on success.\r\nThis member MUST NOT exist if there was an error invoking the method."
}
},
"required": [
"id",
"jsonrpc",
"result"
],
"type": "object"
},
"_TextDocumentFoldingRangeFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_TextDocumentFoldingRangeRequest"
},
"response": {
"anyOf": [
{
"$ref": "#/definitions/_TextDocumentFoldingRangeResponse"
},
{
"$ref": "#/definitions/_ErrorResponse"
}
]
}
},
"required": [
"request",
"response"
],
"type": "object"
},
"_TextDocumentFoldingRangeRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"textDocument/foldingRange"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/FoldingRangeParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_TextDocumentFoldingRangeResponse": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string",
"null"
]
},
"jsonrpc": {
"type": "string"
},
"result": {
"anyOf": [
{
"items": {
"$ref": "#/definitions/FoldingRange"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "The result of a request. This member is REQUIRED on success.\r\nThis member MUST NOT exist if there was an error invoking the method."
}
},
"required": [
"id",
"jsonrpc",
"result"
],
"type": "object"
},
"_TextDocumentFormattingFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_TextDocumentFormattingRequest"
},
"response": {
"anyOf": [
{
"$ref": "#/definitions/_TextDocumentFormattingResponse"
},
{
"$ref": "#/definitions/_ErrorResponse"
}
]
}
},
"required": [
"request",
"response"
],
"type": "object"
},
"_TextDocumentFormattingRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"textDocument/formatting"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/DocumentFormattingParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_TextDocumentFormattingResponse": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string",
"null"
]
},
"jsonrpc": {
"type": "string"
},
"result": {
"anyOf": [
{
"items": {
"$ref": "#/definitions/TextEdit"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "The result of a request. This member is REQUIRED on success.\r\nThis member MUST NOT exist if there was an error invoking the method."
}
},
"required": [
"id",
"jsonrpc",
"result"
],
"type": "object"
},
"_TextDocumentHoverFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_TextDocumentHoverRequest"
},
"response": {
"anyOf": [
{
"$ref": "#/definitions/_TextDocumentHoverResponse"
},
{
"$ref": "#/definitions/_ErrorResponse"
}
]
}
},
"required": [
"request",
"response"
],
"type": "object"
},
"_TextDocumentHoverRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"textDocument/hover"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/TextDocumentPositionParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_TextDocumentHoverResponse": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string",
"null"
]
},
"jsonrpc": {
"type": "string"
},
"result": {
"anyOf": [
{
"$ref": "#/definitions/Hover"
},
{
"type": "null"
}
],
"description": "The result of a request. This member is REQUIRED on success.\r\nThis member MUST NOT exist if there was an error invoking the method."
}
},
"required": [
"id",
"jsonrpc",
"result"
],
"type": "object"
},
"_TextDocumentImplementationFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_TextDocumentImplementationRequest"
},
"response": {
"anyOf": [
{
"$ref": "#/definitions/_TextDocumentImplementationResponse"
},
{
"$ref": "#/definitions/_ErrorResponse"
}
]
}
},
"required": [
"request",
"response"
],
"type": "object"
},
"_TextDocumentImplementationRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"textDocument/implementation"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/TextDocumentPositionParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_TextDocumentImplementationResponse": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string",
"null"
]
},
"jsonrpc": {
"type": "string"
},
"result": {
"anyOf": [
{
"items": {
"$ref": "#/definitions/Location"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "The result of a request. This member is REQUIRED on success.\r\nThis member MUST NOT exist if there was an error invoking the method."
}
},
"required": [
"id",
"jsonrpc",
"result"
],
"type": "object"
},
"_TextDocumentOnTypeFormattingFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_TextDocumentOnTypeFormattingRequest"
},
"response": {
"anyOf": [
{
"$ref": "#/definitions/_TextDocumentOnTypeFormattingResponse"
},
{
"$ref": "#/definitions/_ErrorResponse"
}
]
}
},
"required": [
"request",
"response"
],
"type": "object"
},
"_TextDocumentOnTypeFormattingRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"textDocument/onTypeFormatting"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/DocumentOnTypeFormattingParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_TextDocumentOnTypeFormattingResponse": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string",
"null"
]
},
"jsonrpc": {
"type": "string"
},
"result": {
"anyOf": [
{
"items": {
"$ref": "#/definitions/TextEdit"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "The result of a request. This member is REQUIRED on success.\r\nThis member MUST NOT exist if there was an error invoking the method."
}
},
"required": [
"id",
"jsonrpc",
"result"
],
"type": "object"
},
"_TextDocumentPrepareRenameFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_TextDocumentPrepareRenameRequest"
},
"response": {
"anyOf": [
{
"$ref": "#/definitions/_TextDocumentPrepareRenameResponse"
},
{
"$ref": "#/definitions/_ErrorResponse"
}
]
}
},
"required": [
"request",
"response"
],
"type": "object"
},
"_TextDocumentPrepareRenameRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"textDocument/prepareRename"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/TextDocumentPositionParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_TextDocumentPrepareRenameResponse": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string",
"null"
]
},
"jsonrpc": {
"type": "string"
},
"result": {
"anyOf": [
{
"$ref": "#/definitions/Range"
},
{
"additionalProperties": false,
"properties": {
"placeholder": {
"type": "string"
},
"range": {
"$ref": "#/definitions/Range"
}
},
"required": [
"range",
"placeholder"
],
"type": "object"
},
{
"type": "null"
}
],
"description": "The result of a request. This member is REQUIRED on success.\r\nThis member MUST NOT exist if there was an error invoking the method."
}
},
"required": [
"id",
"jsonrpc",
"result"
],
"type": "object"
},
"_TextDocumentPublishDiagnosticsFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_TextDocumentPublishDiagnosticsRequest"
}
},
"required": [
"request"
],
"type": "object"
},
"_TextDocumentPublishDiagnosticsRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"textDocument/publishDiagnostics"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/PublishDiagnosticsParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_TextDocumentRangeFormattingFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_TextDocumentRangeFormattingRequest"
},
"response": {
"anyOf": [
{
"$ref": "#/definitions/_TextDocumentRangeFormattingResponse"
},
{
"$ref": "#/definitions/_ErrorResponse"
}
]
}
},
"required": [
"request",
"response"
],
"type": "object"
},
"_TextDocumentRangeFormattingRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"textDocument/rangeFormatting"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/DocumentRangeFormattingParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_TextDocumentRangeFormattingResponse": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string",
"null"
]
},
"jsonrpc": {
"type": "string"
},
"result": {
"anyOf": [
{
"items": {
"$ref": "#/definitions/TextEdit"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "The result of a request. This member is REQUIRED on success.\r\nThis member MUST NOT exist if there was an error invoking the method."
}
},
"required": [
"id",
"jsonrpc",
"result"
],
"type": "object"
},
"_TextDocumentReferencesFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_TextDocumentReferencesRequest"
},
"response": {
"anyOf": [
{
"$ref": "#/definitions/_TextDocumentReferencesResponse"
},
{
"$ref": "#/definitions/_ErrorResponse"
}
]
}
},
"required": [
"request",
"response"
],
"type": "object"
},
"_TextDocumentReferencesRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"textDocument/references"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/ReferenceParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_TextDocumentReferencesResponse": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string",
"null"
]
},
"jsonrpc": {
"type": "string"
},
"result": {
"anyOf": [
{
"items": {
"$ref": "#/definitions/Location"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "The result of a request. This member is REQUIRED on success.\r\nThis member MUST NOT exist if there was an error invoking the method."
}
},
"required": [
"id",
"jsonrpc",
"result"
],
"type": "object"
},
"_TextDocumentRenameFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_TextDocumentRenameRequest"
},
"response": {
"anyOf": [
{
"$ref": "#/definitions/_TextDocumentRenameResponse"
},
{
"$ref": "#/definitions/_ErrorResponse"
}
]
}
},
"required": [
"request",
"response"
],
"type": "object"
},
"_TextDocumentRenameRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"textDocument/rename"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/RenameParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_TextDocumentRenameResponse": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string",
"null"
]
},
"jsonrpc": {
"type": "string"
},
"result": {
"anyOf": [
{
"$ref": "#/definitions/WorkspaceEdit"
},
{
"type": "null"
}
],
"description": "The result of a request. This member is REQUIRED on success.\r\nThis member MUST NOT exist if there was an error invoking the method."
}
},
"required": [
"id",
"jsonrpc",
"result"
],
"type": "object"
},
"_TextDocumentSignatureHelpFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_TextDocumentSignatureHelpRequest"
},
"response": {
"anyOf": [
{
"$ref": "#/definitions/_TextDocumentSignatureHelpResponse"
},
{
"$ref": "#/definitions/_ErrorResponse"
}
]
}
},
"required": [
"request",
"response"
],
"type": "object"
},
"_TextDocumentSignatureHelpRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"textDocument/signatureHelp"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/TextDocumentPositionParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_TextDocumentSignatureHelpResponse": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string",
"null"
]
},
"jsonrpc": {
"type": "string"
},
"result": {
"anyOf": [
{
"$ref": "#/definitions/SignatureHelp"
},
{
"type": "null"
}
],
"description": "The result of a request. This member is REQUIRED on success.\r\nThis member MUST NOT exist if there was an error invoking the method."
}
},
"required": [
"id",
"jsonrpc",
"result"
],
"type": "object"
},
"_TextDocumentTypeDefinitionFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_TextDocumentTypeDefinitionRequest"
},
"response": {
"anyOf": [
{
"$ref": "#/definitions/_TextDocumentTypeDefinitionResponse"
},
{
"$ref": "#/definitions/_ErrorResponse"
}
]
}
},
"required": [
"request",
"response"
],
"type": "object"
},
"_TextDocumentTypeDefinitionRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"textDocument/typeDefinition"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/TextDocumentPositionParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_TextDocumentTypeDefinitionResponse": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string",
"null"
]
},
"jsonrpc": {
"type": "string"
},
"result": {
"anyOf": [
{
"items": {
"$ref": "#/definitions/Location"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "The result of a request. This member is REQUIRED on success.\r\nThis member MUST NOT exist if there was an error invoking the method."
}
},
"required": [
"id",
"jsonrpc",
"result"
],
"type": "object"
},
"_TextDocumentWillSaveFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_TextDocumentWillSaveRequest"
}
},
"required": [
"request"
],
"type": "object"
},
"_TextDocumentWillSaveRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"textDocument/willSave"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/WillSaveTextDocumentParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_TextDocumentWillSaveWaitUntilFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_TextDocumentWillSaveWaitUntilRequest"
}
},
"required": [
"request"
],
"type": "object"
},
"_TextDocumentWillSaveWaitUntilRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"textDocument/willSaveWaitUntil"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/WillSaveTextDocumentParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_WindowLogMessageFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_WindowLogMessageRequest"
}
},
"required": [
"request"
],
"type": "object"
},
"_WindowLogMessageRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"window/logMessage"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/LogMessageParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_WindowShowMessageFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_WindowShowMessageRequest"
}
},
"required": [
"request"
],
"type": "object"
},
"_WindowShowMessageRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"window/showMessage"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/ShowMessageParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_WindowShowMessageRequestFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_WindowShowMessageRequestRequest"
},
"response": {
"anyOf": [
{
"$ref": "#/definitions/_WindowShowMessageRequestResponse"
},
{
"$ref": "#/definitions/_ErrorResponse"
}
]
}
},
"required": [
"request",
"response"
],
"type": "object"
},
"_WindowShowMessageRequestRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"window/showMessageRequest"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/ShowMessageRequestParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_WindowShowMessageRequestResponse": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string",
"null"
]
},
"jsonrpc": {
"type": "string"
},
"result": {
"anyOf": [
{
"$ref": "#/definitions/MessageActionItem"
},
{
"type": "null"
}
],
"description": "The result of a request. This member is REQUIRED on success.\r\nThis member MUST NOT exist if there was an error invoking the method."
}
},
"required": [
"id",
"jsonrpc",
"result"
],
"type": "object"
},
"_WorkspaceApplyEditFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_WorkspaceApplyEditRequest"
},
"response": {
"anyOf": [
{
"$ref": "#/definitions/_WorkspaceApplyEditResponse"
},
{
"$ref": "#/definitions/_ErrorResponse"
}
]
}
},
"required": [
"request",
"response"
],
"type": "object"
},
"_WorkspaceApplyEditRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"workspace/applyEdit"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/ApplyWorkspaceEditParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_WorkspaceApplyEditResponse": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string",
"null"
]
},
"jsonrpc": {
"type": "string"
},
"result": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "object"
},
{
"type": "null"
}
],
"description": "The result of a request. This member is REQUIRED on success.\r\nThis member MUST NOT exist if there was an error invoking the method."
}
},
"required": [
"id",
"jsonrpc",
"result"
],
"type": "object"
},
"_WorkspaceConfigurationFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_WorkspaceConfigurationRequest"
},
"response": {
"anyOf": [
{
"$ref": "#/definitions/_WorkspaceConfigurationResponse"
},
{
"$ref": "#/definitions/_ErrorResponse"
}
]
}
},
"required": [
"request",
"response"
],
"type": "object"
},
"_WorkspaceConfigurationRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"workspace/configuration"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/ConfigurationParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_WorkspaceConfigurationResponse": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string",
"null"
]
},
"jsonrpc": {
"type": "string"
},
"result": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "object"
},
{
"type": "null"
}
],
"description": "The result of a request. This member is REQUIRED on success.\r\nThis member MUST NOT exist if there was an error invoking the method.",
"items": {
},
"type": "array"
}
},
"required": [
"id",
"jsonrpc",
"result"
],
"type": "object"
},
"_WorkspaceDidChangeConfigurationFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_WorkspaceDidChangeConfigurationRequest"
}
},
"required": [
"request"
],
"type": "object"
},
"_WorkspaceDidChangeConfigurationRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"workspace/didChangeConfiguration"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/DidChangeConfigurationParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_WorkspaceDidChangeWatchedFilesFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_WorkspaceDidChangeWatchedFilesRequest"
}
},
"required": [
"request"
],
"type": "object"
},
"_WorkspaceDidChangeWatchedFilesRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"workspace/didChangeWatchedFiles"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/DidChangeWatchedFilesParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_WorkspaceDidChangeWorkspaceFoldersFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_WorkspaceDidChangeWorkspaceFoldersRequest"
}
},
"required": [
"request"
],
"type": "object"
},
"_WorkspaceDidChangeWorkspaceFoldersRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"workspace/didChangeWorkspaceFolders"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/DidChangeWorkspaceFoldersParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_WorkspaceExecuteCommandFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_WorkspaceExecuteCommandRequest"
},
"response": {
"anyOf": [
{
"$ref": "#/definitions/_WorkspaceExecuteCommandResponse"
},
{
"$ref": "#/definitions/_ErrorResponse"
}
]
}
},
"required": [
"request",
"response"
],
"type": "object"
},
"_WorkspaceExecuteCommandRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"workspace/executeCommand"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/ExecuteCommandParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_WorkspaceExecuteCommandResponse": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string",
"null"
]
},
"jsonrpc": {
"type": "string"
},
"result": {
"anyOf": [
{
},
{
"type": "null"
}
],
"description": "The result of a request. This member is REQUIRED on success.\r\nThis member MUST NOT exist if there was an error invoking the method."
}
},
"required": [
"id",
"jsonrpc",
"result"
],
"type": "object"
},
"_WorkspaceSymbolFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_WorkspaceSymbolRequest"
},
"response": {
"anyOf": [
{
"$ref": "#/definitions/_WorkspaceSymbolResponse"
},
{
"$ref": "#/definitions/_ErrorResponse"
}
]
}
},
"required": [
"request",
"response"
],
"type": "object"
},
"_WorkspaceSymbolRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"workspace/symbol"
],
"type": "string"
},
"params": {
"$ref": "#/definitions/WorkspaceSymbolParams",
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method",
"params"
],
"type": "object"
},
"_WorkspaceSymbolResponse": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string",
"null"
]
},
"jsonrpc": {
"type": "string"
},
"result": {
"anyOf": [
{
"items": {
"$ref": "#/definitions/SymbolInformation"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "The result of a request. This member is REQUIRED on success.\r\nThis member MUST NOT exist if there was an error invoking the method."
}
},
"required": [
"id",
"jsonrpc",
"result"
],
"type": "object"
},
"_WorkspaceWorkspaceFoldersFeature": {
"additionalProperties": false,
"properties": {
"request": {
"$ref": "#/definitions/_WorkspaceWorkspaceFoldersRequest"
},
"response": {
"anyOf": [
{
"$ref": "#/definitions/_WorkspaceWorkspaceFoldersResponse"
},
{
"$ref": "#/definitions/_ErrorResponse"
}
]
}
},
"required": [
"request",
"response"
],
"type": "object"
},
"_WorkspaceWorkspaceFoldersRequest": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string"
]
},
"jsonrpc": {
"type": "string"
},
"method": {
"description": "The method to be invoked.",
"enum": [
"workspace/workspaceFolders"
],
"type": "string"
},
"params": {
"description": "The method's params."
}
},
"required": [
"id",
"jsonrpc",
"method"
],
"type": "object"
},
"_WorkspaceWorkspaceFoldersResponse": {
"additionalProperties": false,
"properties": {
"id": {
"description": "The request id.",
"type": [
"number",
"string",
"null"
]
},
"jsonrpc": {
"type": "string"
},
"result": {
"anyOf": [
{
"items": {
"$ref": "#/definitions/WorkspaceFolder"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "The result of a request. This member is REQUIRED on success.\r\nThis member MUST NOT exist if there was an error invoking the method."
}
},
"required": [
"id",
"jsonrpc",
"result"
],
"type": "object"
}
}
}
Copyright 2019 dead pixels collective
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<div style=\"font-size: 48px;\">Towards a JSON Schema for the Language Server Protocol</div>\n",
"\n",
"_Thoughts on a [machine-readable][], language-agnostic specification of the\n",
"[Language Server Protocol][] in [JSON Schema][]._\n",
"\n",
"**tl,dr: Using [ts-json-schema-generator][] with some code generated from the spec yields a fairly robust schema ([JSON](./generated.protocol.schema.json) or [YAML](./generated.protocol.schema.yml)).**\n",
"\n",
"[machine-readable]: https://github.com/microsoft/language-server-protocol/issues/67\n",
"[Language Server Protocol]: https://microsoft.github.io/language-server-protocol\n",
"[JSON Schema]: https://json-schema.org\n",
"[ts-json-schema-generator]: https://github.com/vega/ts-json-schema-generator\n",
"\n",
"> Viewable on:\n",
"> - [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gist/bollwyvl/7a128978b8ae89ab02bbd5b84d07a4b7/master?urlpath=lab%2Ftree%2FTowards%20a%20JSON%20Schema%20for%20the%20Language%20Server%20Protocol.ipynb)\n",
"> - [nbviewer](https://nbviewer.jupyter.org/gist/bollwyvl/7a128978b8ae89ab02bbd5b84d07a4b7/Towards%20a%20JSON%20Schema%20for%20the%20Language%20Server%20Protocol.ipynb)\n",
"> - [gist](https://gist.github.com/bollwyvl/7a128978b8ae89ab02bbd5b84d07a4b7)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Motivation\n",
"\n",
"The Language Server community would benefit from a more [machine-readable](https://github.com/microsoft/language-server-protocol/issues/67) description of the Language Server Protocol Specification.\n",
"\n",
"JSON Schema, with [implementations](https://json-schema.org/implementations.html) across a number of languages is a fine initial choice, and would ease the way toward other specifications."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# What is a useful level of schema?\n",
"\n",
"For the purposes of:\n",
"- automated testing\n",
"- language-indpendent validation\n",
"\n",
"A few top-level artifacts would be useful:\n",
"- standalone messages\n",
"- message sequences (e.g. `[request, response, ...]`)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# What is \"canonical\"?\n",
"The Language Server Protocol specification is basically split between:\n",
"- the canonical [spec](https://github.com/microsoft/language-server-protocol/blob/gh-pages/_specifications/specification-3-14.md)\n",
" - markdown\n",
" - apparently has no automated verification\n",
" - changes its structure over time\n",
"- the [reference implementation](https://github.com/microsoft/vscode-languageserver-node/blob/master/protocol/src/protocol.ts)\n",
" - typescript\n",
" - has robust automated testing\n",
" - widely adopted, even for non js/ts-adjacent languages"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## On versions\n",
"The two repos are released at different cadences, as are the tag and branch conventions. For this exploation, we'll look at two commits, basically what the author was able to pull down on `2019-10-19`."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"LSP_COMMIT = \"639528c\"\n",
"VLSPN_COMMIT = \"6a7e832\""
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"import json, jsonschema, pathlib, yaml, IPython, re, pandas, pyemojify, jinja2, copy, pytest"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Getting the spec"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"HEAD is now at 639528c Another attempt to fix the redirect.\n",
"release/3.13.0-210-g639528c\n",
"HEAD is now at 6a7e832 Clarify insertTextFormat default value\n",
"release/client/6.0.0-next.1-2-g6a7e832\n"
]
}
],
"source": [
"if not pathlib.Path(\"language-server-protocol\").exists():\n",
" !git clone https://github.com/microsoft/language-server-protocol.git\n",
"!cd language-server-protocol && git checkout -f {LSP_COMMIT} && git describe HEAD\n",
"\n",
"if not pathlib.Path(\"vscode-languageserver-node\").exists():\n",
" !git clone https://github.com/microsoft/vscode-languageserver-node.git\n",
"!cd vscode-languageserver-node && git checkout -f {VLSPN_COMMIT} && git describe HEAD"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Parsing the Spec"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Parsing the Markdown spec\n",
"The canonical document is represented in Markdown. It's _standardized enough_ to be parsed with text, though a more thorough parsing might prove required. At present, a simple version-based naming scheme is used for the current spec (`3.14`) and the next spec (`3,1`). Both change."
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"spec_md = pathlib.Path(\"language-server-protocol\") / \"_specifications\" / \"specification-3-14.md\"\n",
"spec = spec_md.read_text()"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"50 features defined\n"
]
}
],
"source": [
"md_features = spec.split(\"#### $ Notifications and Requests\")[1].split(\"### Implementation considerations\")[0].split(\"#### <a href\")[1:]\n",
"print(len(md_features), \"features defined\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Parsing the reference implementation\n",
"There are several, separately developed [implementations](https://github.com/vega/ts-json-schema-generator/issues/101) of TS-to-JSON-Schema, each with their own quirks. The most robust (and maintained) appears to be [ts-json-schema-generator](https://github.com/vega/ts-json-schema-generator)."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### The Generator\n",
"The most robust transformer is [vega/ts-json-schema-generator](https://github.com/vega/ts-json-schema-generator). We'll install it (from a fork where we'll add needed features based on the VLSPN code base) into the VLSPN environment, as well as all the dependencies."
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Already on 'master'\n",
"Your branch is up to date with 'origin/master'.\n",
"HEAD is now at 5efb7a4 whitespace\n",
"\u001b[2K\u001b[1G\u001b[1myarn install v1.15.2\u001b[22m\n",
"\u001b[2K\u001b[1G\u001b[2m[1/5]\u001b[22m Validating package.json...\n",
"\u001b[2K\u001b[1G\u001b[2m[2/5]\u001b[22m Resolving packages...\n",
"\u001b[1Gโ  \u001b[0K\u001b[2K\u001b[1G\u001b[2K\u001b[1G\u001b[32msuccess\u001b[39m Already up-to-date.\n",
"\u001b[2K\u001b[1GDone in 0.43s.\n",
"\u001b[2K\u001b[1G\u001b[1myarn run v1.15.2\u001b[22m\n",
"\u001b[2K\u001b[1G\u001b[2m$ tsc\u001b[22m\n",
"\u001b[2K\u001b[1GDone in 2.65s.\n",
"\u001b[K\u001b[?25haudited 334 packages in 4.137s/ postinstall: \u001b[7msill\u001b[0m \u001b[35minstall\u001b[0m executeActions\u001b[0m\u001b[K0m\u001b[K.18.\u001b[0m\u001b[KK\n",
"found \u001b[92m0\u001b[0m vulnerabilities\n",
"\n",
"\u001b[K\u001b[?25h \u001b[27m\u001b[90m...........\u001b[0m] - postinstall: \u001b[7msill\u001b[0m \u001b[35minstall\u001b[0m executeActions\u001b[0m\u001b[K0m\u001b[KlTre\u001b[0m\u001b[KK\n",
"> vscode-lsp@1.0.0 postinstall /home/weg/Documents/projects/lsp-json-schema/vscode-languageserver-node\n",
"> cd types && npm install && cd ../jsonrpc && npm install && cd ../protocol && npm install && cd ../server && npm install && cd ../client && npm install && cd ../client-tests && npm install && cd ..\n",
"\n",
"\u001b[K\u001b[?25hup to date in 0.417s....\u001b[0m] \\ prepare:types: \u001b[32minfo\u001b[0m \u001b[35mlifecycle\u001b[0m vscode-languageserver-type\u001b[0m\u001b[K\n",
"found \u001b[92m0\u001b[0m vulnerabilities\n",
"\n",
"\u001b[K\u001b[?25hup to date in 0.478s....\u001b[0m] - prepare:jsonrpc: \u001b[32minfo\u001b[0m \u001b[35mlifecycle\u001b[0m vscode-jsonrpc@5.0.0-nex\u001b[0m\u001b[K\n",
"found \u001b[92m0\u001b[0m vulnerabilities\n",
"\n",
"\u001b[K\u001b[?25haudited 2 packages in 0.761s] \\ prepare:protocol: \u001b[32minfo\u001b[0m \u001b[35mlifecycle\u001b[0m vscode-languageserver-p\u001b[0m\u001b[K\n",
"found \u001b[92m0\u001b[0m vulnerabilities\n",
"\n",
"\u001b[K\u001b[?25haudited 4 packages in 0.478s] \\ prepare:server: \u001b[32minfo\u001b[0m \u001b[35mlifecycle\u001b[0m vscode-languageserver@6.0\u001b[0m\u001b[K\n",
"found \u001b[92m0\u001b[0m vulnerabilities\n",
"\n",
"\u001b[K\u001b[?25haudited 28 packages in 1.403s \\ prepare:client: \u001b[32minfo\u001b[0m \u001b[35mlifecycle\u001b[0m vscode-languageclient@6.0\u001b[0m\u001b[K\n",
"found \u001b[92m0\u001b[0m vulnerabilities\n",
"\n",
"\u001b[K\u001b[?25h\u001b[37;40mnpm\u001b[0m \u001b[0m\u001b[30;43mWARN\u001b[0m\u001b[35m\u001b[0m text-extension@0.0.1 No descriptioneActions\u001b[0m\u001b[K0m\u001b[KepsI\u001b[0m\u001b[KK\n",
"\u001b[0m\u001b[37;40mnpm\u001b[0m \u001b[0m\u001b[30;43mWARN\u001b[0m\u001b[35m\u001b[0m text-extension@0.0.1 No repository field.\n",
"\u001b[0m\u001b[37;40mnpm\u001b[0m \u001b[0m\u001b[30;43mWARN\u001b[0m\u001b[35m\u001b[0m text-extension@0.0.1 No license field.\n",
"\u001b[0m\n",
"\u001b[K\u001b[?25haudited 93 packages in 0.745s - prepare:client-tests: \u001b[30;43mWARN\u001b[0m text-extension@0.0.1 No licen\u001b[0m\u001b[K[0m\u001b[K\n",
"found 1 \u001b[91mhigh\u001b[0m severity vulnerability\n",
" run `npm audit fix` to fix them, or `npm audit` for details\n",
"\u001b[K\u001b[?25hup to date in 15.65s....\u001b[0m] | prepare:vscode-languageserver-node: \u001b[32minfo\u001b[0m \u001b[35mlifecycle\u001b[0m vscod\u001b[0m\u001b[K[0m\u001b[K\n"
]
}
],
"source": [
"if not pathlib.Path(\"ts-json-schema-generator\").exists():\n",
" !git clone https://github.com/bollwyvl/ts-json-schema-generator\n",
"!cd ts-json-schema-generator && git checkout -f master && git reset --hard origin/master\n",
"!cd ts-json-schema-generator && jlpm && jlpm build\n",
"!cd vscode-languageserver-node && npm install --save --only=dev ../ts-json-schema-generator prettier && npm install"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Generating the schema"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" 3518 11230 125799 ../../naive.protocol.schema.json\n"
]
}
],
"source": [
"!rm naive.protocol.schema.json\n",
"!cd vscode-languageserver-node/protocol && ../node_modules/.bin/ts-json-schema-generator -c --path './src/protocol.ts' --expose all > ../../naive.protocol.schema.json && wc ../../naive.protocol.schema.json"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"application/json": {
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"ApplyWorkspaceEditParams": {
"additionalProperties": false,
"description": "The parameters passed via a apply workspace edit request.",
"properties": {
"edit": {
"$ref": "#/definitions/WorkspaceEdit",
"description": "The edits to apply."
},
"label": {
"description": "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.",
"type": "string"
}
},
"required": [
"edit"
],
"type": "object"
},
"ApplyWorkspaceEditResponse": {
"additionalProperties": false,
"description": "A response returned from the apply workspace edit request.",
"properties": {
"applied": {
"description": "Indicates whether the edit was applied or not.",
"type": "boolean"
},
"failedChange": {
"description": "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.",
"type": "number"
},
"failureReason": {
"description": "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.",
"type": "string"
}
},
"required": [
"applied"
],
"type": "object"
},
"ClientCapabilities": {
"additionalProperties": false,
"properties": {
"dynamicRegistration": {
"description": "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.",
"type": "boolean"
},
"experimental": {
"description": "Experimental client capabilities."
},
"textDocument": {
"$ref": "#/definitions/TextDocumentClientCapabilities",
"description": "Text document specific client capabilities."
},
"window": {
"description": "Window specific client capabilities.",
"type": "object"
},
"workspace": {
"$ref": "#/definitions/WorkspaceClientCapabilities",
"additionalProperties": false,
"description": "Workspace specific client capabilities.",
"properties": {
"configuration": {
"description": "The client supports `workspace/configuration` requests.",
"type": "boolean"
},
"workspaceFolders": {
"description": "The client has support for workspace folders",
"type": "boolean"
}
},
"type": "object"
}
},
"type": "object"
},
"CodeActionClientCapabilities": {
"additionalProperties": false,
"description": "The Client Capabilities of a [CodeActionRequest](#CodeActionRequest).",
"properties": {
"codeActionLiteralSupport": {
"additionalProperties": false,
"description": "The client support code action literals as a valid\nresponse of the `textDocument/codeAction` request.",
"properties": {
"codeActionKind": {
"additionalProperties": false,
"description": "The code action kind is support with the following value\nset.",
"properties": {
"valueSet": {
"description": "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.",
"items": {
"$ref": "#/definitions/CodeActionKind"
},
"type": "array"
}
},
"required": [
"valueSet"
],
"type": "object"
}
},
"required": [
"codeActionKind"
],
"type": "object"
},
"dynamicRegistration": {
"description": "Whether code action supports dynamic registration.",
"type": "boolean"
},
"isPreferredSupport": {
"description": "Whether code action supports the `isPreferred` property.",
"type": "boolean"
}
},
"type": "object"
},
"CodeActionContext": {
"additionalProperties": false,
"description": "Contains additional diagnostic information about the context in which\r\na [code action](#CodeActionProvider.provideCodeActions) is run. \n The CodeActionContext namespace provides helper functions to work with\r\n[CodeActionContext](#CodeActionContext) literals.",
"properties": {
"diagnostics": {
"description": "An array of diagnostics known on the client side overlapping the range provided to the\r\n`textDocument/codeAction` request. They are provied so that the server knows which\r\nerrors are currently presented to the user for the given range. There is no guarantee\r\nthat these accurately reflect the error state of the resource. The primary parameter\r\nto compute code actions is the provided range.",
"items": {
"$ref": "#/definitions/Diagnostic"
},
"type": "array"
},
"only": {
"description": "Requested kind of actions to return.\r\n\r\nActions not of this kind are filtered out by the client before being shown. So servers\r\ncan omit computing them.",
"items": {
"$ref": "#/definitions/CodeActionKind"
},
"type": "array"
}
},
"required": [
"diagnostics"
],
"type": "object"
},
"CodeActionKind": {
"description": "The kind of a code action.\r\n\r\nKinds are a hierarchical list of identifiers separated by `.`, e.g. `\"refactor.extract.function\"`.\r\n\r\nThe set of kinds is open and client needs to announce the kinds it supports to the server during\r\ninitialization. \n A set of predefined code action kinds",
"type": "string"
},
"CodeActionOptions": {
"additionalProperties": false,
"description": "Provider options for a [CodeActionRequest](#CodeActionRequest).",
"properties": {
"codeActionKinds": {
"description": "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.",
"items": {
"$ref": "#/definitions/CodeActionKind"
},
"type": "array"
},
"workDoneProgress": {
"type": "boolean"
}
},
"type": "object"
},
"CodeActionParams": {
"additionalProperties": false,
"description": "The parameters of a [CodeActionRequest](#CodeActionRequest).",
"properties": {
"context": {
"$ref": "#/definitions/CodeActionContext",
"description": "Context carrying additional information."
},
"partialResultToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report partial results (e.g. streaming) to\nthe client."
},
"range": {
"$ref": "#/definitions/Range",
"description": "The range for which the command was invoked."
},
"textDocument": {
"$ref": "#/definitions/TextDocumentIdentifier",
"description": "The document in which the command was invoked."
},
"workDoneToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report work done progress."
}
},
"required": [
"textDocument",
"range",
"context"
],
"type": "object"
},
"CodeActionRegistrationOptions": {
"additionalProperties": false,
"description": "Registration options for a [CodeActionRequest](#CodeActionRequest).",
"properties": {
"codeActionKinds": {
"description": "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.",
"items": {
"$ref": "#/definitions/CodeActionKind"
},
"type": "array"
},
"documentSelector": {
"anyOf": [
{
"$ref": "#/definitions/DocumentSelector"
},
{
"type": "null"
}
],
"description": "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."
},
"workDoneProgress": {
"type": "boolean"
}
},
"required": [
"documentSelector"
],
"type": "object"
},
"CodeLensClientCapabilities": {
"additionalProperties": false,
"description": "The client capabilities of a [CodeLensRequest](#CodeLensRequest).",
"properties": {
"dynamicRegistration": {
"description": "Whether code lens supports dynamic registration.",
"type": "boolean"
}
},
"type": "object"
},
"CodeLensOptions": {
"additionalProperties": false,
"description": "Code Lens provider options of a [CodeLensRequest](#CodeLensRequest).",
"properties": {
"resolveProvider": {
"description": "Code lens has a resolve provider as well.",
"type": "boolean"
},
"workDoneProgress": {
"type": "boolean"
}
},
"type": "object"
},
"CodeLensParams": {
"additionalProperties": false,
"description": "The parameters of a [CodeLensRequest](#CodeLensRequest).",
"properties": {
"partialResultToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report partial results (e.g. streaming) to\nthe client."
},
"textDocument": {
"$ref": "#/definitions/TextDocumentIdentifier",
"description": "The document to request code lens for."
},
"workDoneToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report work done progress."
}
},
"required": [
"textDocument"
],
"type": "object"
},
"CodeLensRegistrationOptions": {
"additionalProperties": false,
"description": "Registration options for a [CodeLensRequest](#CodeLensRequest).",
"properties": {
"documentSelector": {
"anyOf": [
{
"$ref": "#/definitions/DocumentSelector"
},
{
"type": "null"
}
],
"description": "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."
},
"resolveProvider": {
"description": "Code lens has a resolve provider as well.",
"type": "boolean"
},
"workDoneProgress": {
"type": "boolean"
}
},
"required": [
"documentSelector"
],
"type": "object"
},
"CompletionClientCapabilities": {
"additionalProperties": false,
"description": "Completion client capabilities",
"properties": {
"completionItem": {
"additionalProperties": false,
"description": "The client supports the following `CompletionItem` specific\ncapabilities.",
"properties": {
"commitCharactersSupport": {
"description": "Client supports commit characters on a completion item.",
"type": "boolean"
},
"deprecatedSupport": {
"description": "Client supports the deprecated property on a completion item.",
"type": "boolean"
},
"documentationFormat": {
"description": "Client supports the follow content formats for the documentation\nproperty. The order describes the preferred format of the client.",
"items": {
"$ref": "#/definitions/MarkupKind"
},
"type": "array"
},
"preselectSupport": {
"description": "Client supports the preselect property on a completion item.",
"type": "boolean"
},
"snippetSupport": {
"description": "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.",
"type": "boolean"
},
"tagSupport": {
"additionalProperties": false,
"description": "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.",
"properties": {
"valueSet": {
"description": "The tags supported by the client.",
"items": {
"$ref": "#/definitions/CompletionItemTag"
},
"type": "array"
}
},
"required": [
"valueSet"
],
"type": "object"
}
},
"type": "object"
},
"completionItemKind": {
"additionalProperties": false,
"properties": {
"valueSet": {
"description": "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.",
"items": {
"$ref": "#/definitions/CompletionItemKind"
},
"type": "array"
}
},
"type": "object"
},
"contextSupport": {
"description": "The client supports to send additional context information for a\n`textDocument/completion` requestion.",
"type": "boolean"
},
"dynamicRegistration": {
"description": "Whether completion supports dynamic registration.",
"type": "boolean"
}
},
"type": "object"
},
"CompletionContext": {
"additionalProperties": false,
"description": "Contains additional information about the context in which a completion request is triggered.",
"properties": {
"triggerCharacter": {
"description": "The trigger character (a single character) that has trigger code complete.\nIs undefined if `triggerKind !== CompletionTriggerKind.TriggerCharacter`",
"type": "string"
},
"triggerKind": {
"$ref": "#/definitions/CompletionTriggerKind",
"description": "How the completion was triggered."
}
},
"required": [
"triggerKind"
],
"type": "object"
},
"CompletionItemKind": {
"description": "The kind of a completion entry.",
"enum": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25
],
"type": "number"
},
"CompletionItemTag": {
"description": "Completion item tags are extra annotations that tweak the rendering of a completion\r\nitem.",
"enum": [
1
],
"type": "number"
},
"CompletionOptions": {
"additionalProperties": false,
"description": "Completion options.",
"properties": {
"allCommitCharacters": {
"description": "The list of all possible characters that commit a completion. This field can be used\nif clients don't support individual commmit characters per completion item. See\n`ClientCapabilities.textDocument.completion.completionItem.commitCharactersSupport`",
"items": {
"type": "string"
},
"type": "array"
},
"resolveProvider": {
"description": "The server provides support to resolve additional\ninformation for a completion item.",
"type": "boolean"
},
"triggerCharacters": {
"description": "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`.",
"items": {
"type": "string"
},
"type": "array"
},
"workDoneProgress": {
"type": "boolean"
}
},
"type": "object"
},
"CompletionParams": {
"additionalProperties": false,
"description": "Completion parameters",
"properties": {
"context": {
"$ref": "#/definitions/CompletionContext",
"description": "The completion context. This is only available it the client specifies\nto send this using the client capability `textDocument.completion.contextSupport === true`"
},
"partialResultToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report partial results (e.g. streaming) to\nthe client."
},
"position": {
"$ref": "#/definitions/Position",
"description": "The position inside the text document."
},
"textDocument": {
"$ref": "#/definitions/TextDocumentIdentifier",
"description": "The text document."
},
"workDoneToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report work done progress."
}
},
"required": [
"position",
"textDocument"
],
"type": "object"
},
"CompletionRegistrationOptions": {
"additionalProperties": false,
"description": "Registration options for a [CompletionRequest](#CompletionRequest).",
"properties": {
"allCommitCharacters": {
"description": "The list of all possible characters that commit a completion. This field can be used\nif clients don't support individual commmit characters per completion item. See\n`ClientCapabilities.textDocument.completion.completionItem.commitCharactersSupport`",
"items": {
"type": "string"
},
"type": "array"
},
"documentSelector": {
"anyOf": [
{
"$ref": "#/definitions/DocumentSelector"
},
{
"type": "null"
}
],
"description": "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."
},
"resolveProvider": {
"description": "The server provides support to resolve additional\ninformation for a completion item.",
"type": "boolean"
},
"triggerCharacters": {
"description": "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`.",
"items": {
"type": "string"
},
"type": "array"
},
"workDoneProgress": {
"type": "boolean"
}
},
"required": [
"documentSelector"
],
"type": "object"
},
"CompletionTriggerKind": {
"description": "How a completion was triggered",
"enum": [
1,
2,
3
],
"type": "number"
},
"CreateFile": {
"additionalProperties": false,
"description": "Create file operation.",
"properties": {
"kind": {
"description": "A create",
"enum": [
"create"
],
"type": "string"
},
"options": {
"$ref": "#/definitions/CreateFileOptions",
"description": "Additional options"
},
"uri": {
"$ref": "#/definitions/DocumentUri",
"description": "The resource to create."
}
},
"required": [
"kind",
"uri"
],
"type": "object"
},
"CreateFileOptions": {
"additionalProperties": false,
"description": "Options to create a file.",
"properties": {
"ignoreIfExists": {
"description": "Ignore if exists.",
"type": "boolean"
},
"overwrite": {
"description": "Overwrite existing file. Overwrite wins over `ignoreIfExists`",
"type": "boolean"
}
},
"type": "object"
},
"DeclarationClientCapabilities": {
"additionalProperties": false,
"description": "Since 3.14.0",
"properties": {
"dynamicRegistration": {
"description": "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.",
"type": "boolean"
},
"linkSupport": {
"description": "The client supports additional metadata in the form of declaration links.",
"type": "boolean"
}
},
"type": "object"
},
"DefinitionClientCapabilities": {
"additionalProperties": false,
"description": "Client Capabilities for a [DefinitionRequest](#DefinitionRequest).",
"properties": {
"dynamicRegistration": {
"description": "Whether definition supports dynamic registration.",
"type": "boolean"
},
"linkSupport": {
"description": "The client supports additional metadata in the form of definition links.",
"type": "boolean"
}
},
"type": "object"
},
"DefinitionOptions": {
"additionalProperties": false,
"description": "Server Capabilities for a [DefinitionRequest](#DefinitionRequest).",
"properties": {
"workDoneProgress": {
"type": "boolean"
}
},
"type": "object"
},
"DefinitionParams": {
"additionalProperties": false,
"description": "Parameters for a [DefinitionRequest](#DefinitionRequest).",
"properties": {
"partialResultToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report partial results (e.g. streaming) to\nthe client."
},
"position": {
"$ref": "#/definitions/Position",
"description": "The position inside the text document."
},
"textDocument": {
"$ref": "#/definitions/TextDocumentIdentifier",
"description": "The text document."
},
"workDoneToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report work done progress."
}
},
"required": [
"position",
"textDocument"
],
"type": "object"
},
"DefinitionRegistrationOptions": {
"additionalProperties": false,
"description": "Registration options for a [DefinitionRequest](#DefinitionRequest).",
"properties": {
"documentSelector": {
"anyOf": [
{
"$ref": "#/definitions/DocumentSelector"
},
{
"type": "null"
}
],
"description": "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."
},
"workDoneProgress": {
"type": "boolean"
}
},
"required": [
"documentSelector"
],
"type": "object"
},
"DeleteFile": {
"additionalProperties": false,
"description": "Delete file operation",
"properties": {
"kind": {
"description": "A delete",
"enum": [
"delete"
],
"type": "string"
},
"options": {
"$ref": "#/definitions/DeleteFileOptions",
"description": "Delete options."
},
"uri": {
"$ref": "#/definitions/DocumentUri",
"description": "The file to delete."
}
},
"required": [
"kind",
"uri"
],
"type": "object"
},
"DeleteFileOptions": {
"additionalProperties": false,
"description": "Delete file options",
"properties": {
"ignoreIfNotExists": {
"description": "Ignore the operation if the file doesn't exist.",
"type": "boolean"
},
"recursive": {
"description": "Delete the content recursively if a folder is denoted.",
"type": "boolean"
}
},
"type": "object"
},
"Diagnostic": {
"additionalProperties": false,
"description": "Represents a diagnostic, such as a compiler error or warning. Diagnostic objects\r\nare only valid in the scope of a resource. \n The Diagnostic namespace provides helper functions to work with\r\n[Diagnostic](#Diagnostic) literals.",
"properties": {
"code": {
"description": "The diagnostic's code, which usually appear in the user interface.",
"type": [
"number",
"string"
]
},
"message": {
"description": "The diagnostic's message. It usually appears in the user interface",
"type": "string"
},
"range": {
"$ref": "#/definitions/Range",
"description": "The range at which the message applies"
},
"relatedInformation": {
"description": "An array of related diagnostic information, e.g. when symbol-names within\r\na scope collide all definitions can be marked via this property.",
"items": {
"$ref": "#/definitions/DiagnosticRelatedInformation"
},
"type": "array"
},
"severity": {
"$ref": "#/definitions/DiagnosticSeverity",
"description": "The diagnostic's severity. Can be omitted. If omitted it is up to the\r\nclient to interpret diagnostics as error, warning, info or hint."
},
"source": {
"description": "A human-readable string describing the source of this\r\ndiagnostic, e.g. 'typescript' or 'super lint'. It usually\r\nappears in the user interface.",
"type": "string"
},
"tags": {
"description": "Additional metadata about the diagnostic.",
"items": {
"$ref": "#/definitions/DiagnosticTag"
},
"type": "array"
}
},
"required": [
"range",
"message"
],
"type": "object"
},
"DiagnosticRelatedInformation": {
"additionalProperties": false,
"description": "Represents a related message and source code location for a diagnostic. This should be\r\nused to point to code locations that cause or related to a diagnostics, e.g when duplicating\r\na symbol in a scope. \n The DiagnosticRelatedInformation namespace provides helper functions to work with\r\n[DiagnosticRelatedInformation](#DiagnosticRelatedInformation) literals.",
"properties": {
"location": {
"$ref": "#/definitions/Location",
"description": "The location of this related diagnostic information."
},
"message": {
"description": "The message of this related diagnostic information.",
"type": "string"
}
},
"required": [
"location",
"message"
],
"type": "object"
},
"DiagnosticSeverity": {
"description": "The diagnostic's severity.",
"enum": [
1,
2,
3,
4
],
"type": "number"
},
"DiagnosticTag": {
"description": "The diagnostic tags.",
"enum": [
1,
2
],
"type": "number"
},
"DidChangeConfigurationClientCapabilities": {
"additionalProperties": false,
"properties": {
"dynamicRegistration": {
"description": "Did change configuration notification supports dynamic registration.",
"type": "boolean"
}
},
"type": "object"
},
"DidChangeConfigurationParams": {
"additionalProperties": false,
"description": "The parameters of a change configuration notification.",
"properties": {
"settings": {
"description": "The actual changed settings"
}
},
"required": [
"settings"
],
"type": "object"
},
"DidChangeConfigurationRegistrationOptions": {
"additionalProperties": false,
"properties": {
"section": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
}
]
}
},
"type": "object"
},
"DidChangeTextDocumentParams": {
"additionalProperties": false,
"description": "The change text document notification's parameters.",
"properties": {
"contentChanges": {
"description": "The actual content changes. The content changes describe single state changes\nto the document. So if there are two content changes c1 and c2 for a document\nin state S then c1 move the document to S' and c2 to S''.",
"items": {
"$ref": "#/definitions/TextDocumentContentChangeEvent"
},
"type": "array"
},
"textDocument": {
"$ref": "#/definitions/VersionedTextDocumentIdentifier",
"description": "The document that did change. The version number points\nto the version after all provided content changes have\nbeen applied."
}
},
"required": [
"textDocument",
"contentChanges"
],
"type": "object"
},
"DidChangeWatchedFilesClientCapabilities": {
"additionalProperties": false,
"properties": {
"dynamicRegistration": {
"description": "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.",
"type": "boolean"
}
},
"type": "object"
},
"DidChangeWatchedFilesParams": {
"additionalProperties": false,
"description": "The watched files change notification's parameters.",
"properties": {
"changes": {
"description": "The actual file events.",
"items": {
"$ref": "#/definitions/FileEvent"
},
"type": "array"
}
},
"required": [
"changes"
],
"type": "object"
},
"DidChangeWatchedFilesRegistrationOptions": {
"additionalProperties": false,
"description": "Describe options to be used when registered for text document change events.",
"properties": {
"watchers": {
"description": "The watchers to register.",
"items": {
"$ref": "#/definitions/FileSystemWatcher"
},
"type": "array"
}
},
"required": [
"watchers"
],
"type": "object"
},
"DidCloseTextDocumentParams": {
"additionalProperties": false,
"description": "The parameters send in a close text document notification",
"properties": {
"textDocument": {
"$ref": "#/definitions/TextDocumentIdentifier",
"description": "The document that was closed."
}
},
"required": [
"textDocument"
],
"type": "object"
},
"DidOpenTextDocumentParams": {
"additionalProperties": false,
"description": "The parameters send in a open text document notification",
"properties": {
"textDocument": {
"$ref": "#/definitions/TextDocumentItem",
"description": "The document that was opened."
}
},
"required": [
"textDocument"
],
"type": "object"
},
"DidSaveTextDocumentParams": {
"additionalProperties": false,
"description": "The parameters send in a save text document notification",
"properties": {
"text": {
"description": "Optional the content when saved. Depends on the includeText value\nwhen the save notification was requested.",
"type": "string"
},
"textDocument": {
"$ref": "#/definitions/VersionedTextDocumentIdentifier",
"description": "The document that was closed."
}
},
"required": [
"textDocument"
],
"type": "object"
},
"DocumentColorClientCapabilities": {
"additionalProperties": false,
"properties": {
"dynamicRegistration": {
"description": "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.",
"type": "boolean"
}
},
"type": "object"
},
"DocumentFilter": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"language": {
"description": "A language id, like `typescript`.",
"type": "string"
},
"pattern": {
"description": "A glob pattern, like `*.{ts,js}`.",
"type": "string"
},
"scheme": {
"description": "A Uri [scheme](#Uri.scheme), like `file` or `untitled`.",
"type": "string"
}
},
"required": [
"language"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"language": {
"description": "A language id, like `typescript`.",
"type": "string"
},
"pattern": {
"description": "A glob pattern, like `*.{ts,js}`.",
"type": "string"
},
"scheme": {
"description": "A Uri [scheme](#Uri.scheme), like `file` or `untitled`.",
"type": "string"
}
},
"required": [
"scheme"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"language": {
"description": "A language id, like `typescript`.",
"type": "string"
},
"pattern": {
"description": "A glob pattern, like `*.{ts,js}`.",
"type": "string"
},
"scheme": {
"description": "A Uri [scheme](#Uri.scheme), like `file` or `untitled`.",
"type": "string"
}
},
"required": [
"pattern"
],
"type": "object"
}
],
"description": "A document filter denotes a document by different properties like\nthe [language](#TextDocument.languageId), the [scheme](#Uri.scheme) of\nits resource, or a glob-pattern that is applied to the [path](#TextDocument.fileName).\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 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 The DocumentFilter namespace provides helper functions to work with\n[DocumentFilter](#DocumentFilter) literals."
},
"DocumentFormattingClientCapabilities": {
"additionalProperties": false,
"description": "Client capabilities of a [DocumentFormattingRequest](#DocumentFormattingRequest).",
"properties": {
"dynamicRegistration": {
"description": "Whether formatting supports dynamic registration.",
"type": "boolean"
}
},
"type": "object"
},
"DocumentFormattingOptions": {
"additionalProperties": false,
"description": "Provider options for a [DocumentFormattingRequest](#DocumentFormattingRequest).",
"properties": {
"workDoneProgress": {
"type": "boolean"
}
},
"type": "object"
},
"DocumentFormattingParams": {
"additionalProperties": false,
"description": "The parameters of a [DocumentFormattingRequest](#DocumentFormattingRequest).",
"properties": {
"options": {
"$ref": "#/definitions/FormattingOptions",
"description": "The format options"
},
"textDocument": {
"$ref": "#/definitions/TextDocumentIdentifier",
"description": "The document to format."
},
"workDoneToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report work done progress."
}
},
"required": [
"textDocument",
"options"
],
"type": "object"
},
"DocumentFormattingRegistrationOptions": {
"additionalProperties": false,
"description": "Registration options for a [DocumentFormattingRequest](#DocumentFormattingRequest).",
"properties": {
"documentSelector": {
"anyOf": [
{
"$ref": "#/definitions/DocumentSelector"
},
{
"type": "null"
}
],
"description": "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."
},
"workDoneProgress": {
"type": "boolean"
}
},
"required": [
"documentSelector"
],
"type": "object"
},
"DocumentHighlightClientCapabilities": {
"additionalProperties": false,
"description": "Client Capabilities for a [DocumentHighlightRequest](#DocumentHighlightRequest).",
"properties": {
"dynamicRegistration": {
"description": "Whether document highlight supports dynamic registration.",
"type": "boolean"
}
},
"type": "object"
},
"DocumentHighlightOptions": {
"additionalProperties": false,
"description": "Provider options for a [DocumentHighlightRequest](#DocumentHighlightRequest).",
"properties": {
"workDoneProgress": {
"type": "boolean"
}
},
"type": "object"
},
"DocumentHighlightParams": {
"additionalProperties": false,
"description": "Parameters for a [DocumentHighlightRequest](#DocumentHighlightRequest).",
"properties": {
"partialResultToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report partial results (e.g. streaming) to\nthe client."
},
"position": {
"$ref": "#/definitions/Position",
"description": "The position inside the text document."
},
"textDocument": {
"$ref": "#/definitions/TextDocumentIdentifier",
"description": "The text document."
},
"workDoneToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report work done progress."
}
},
"required": [
"position",
"textDocument"
],
"type": "object"
},
"DocumentHighlightRegistrationOptions": {
"additionalProperties": false,
"description": "Registration options for a [DocumentHighlightRequest](#DocumentHighlightRequest).",
"properties": {
"documentSelector": {
"anyOf": [
{
"$ref": "#/definitions/DocumentSelector"
},
{
"type": "null"
}
],
"description": "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."
},
"workDoneProgress": {
"type": "boolean"
}
},
"required": [
"documentSelector"
],
"type": "object"
},
"DocumentLinkClientCapabilities": {
"additionalProperties": false,
"description": "The client capabilities of a [DocumentLinkRequest](#DocumentLinkRequest).",
"properties": {
"dynamicRegistration": {
"description": "Whether document link supports dynamic registration.",
"type": "boolean"
},
"tooltipSupport": {
"description": "Whether the client support the `tooltip` property on `DocumentLink`.",
"type": "boolean"
}
},
"type": "object"
},
"DocumentLinkOptions": {
"additionalProperties": false,
"description": "Provider options for a [DocumentLinkRequest](#DocumentLinkRequest).",
"properties": {
"resolveProvider": {
"description": "Document links have a resolve provider as well.",
"type": "boolean"
},
"workDoneProgress": {
"type": "boolean"
}
},
"type": "object"
},
"DocumentLinkParams": {
"additionalProperties": false,
"description": "The parameters of a [DocumentLinkRequest](#DocumentLinkRequest).",
"properties": {
"partialResultToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report partial results (e.g. streaming) to\nthe client."
},
"textDocument": {
"$ref": "#/definitions/TextDocumentIdentifier",
"description": "The document to provide document links for."
},
"workDoneToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report work done progress."
}
},
"required": [
"textDocument"
],
"type": "object"
},
"DocumentLinkRegistrationOptions": {
"additionalProperties": false,
"description": "Registration options for a [DocumentLinkRequest](#DocumentLinkRequest).",
"properties": {
"documentSelector": {
"anyOf": [
{
"$ref": "#/definitions/DocumentSelector"
},
{
"type": "null"
}
],
"description": "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."
},
"resolveProvider": {
"description": "Document links have a resolve provider as well.",
"type": "boolean"
},
"workDoneProgress": {
"type": "boolean"
}
},
"required": [
"documentSelector"
],
"type": "object"
},
"DocumentOnTypeFormattingClientCapabilities": {
"additionalProperties": false,
"description": "Client capabilities of a [DocumentOnTypeFormattingRequest](#DocumentOnTypeFormattingRequest).",
"properties": {
"dynamicRegistration": {
"description": "Whether on type formatting supports dynamic registration.",
"type": "boolean"
}
},
"type": "object"
},
"DocumentOnTypeFormattingOptions": {
"additionalProperties": false,
"description": "Provider options for a [DocumentOnTypeFormattingRequest](#DocumentOnTypeFormattingRequest).",
"properties": {
"firstTriggerCharacter": {
"description": "A character on which formatting should be triggered, like `}`.",
"type": "string"
},
"moreTriggerCharacter": {
"description": "More trigger characters.",
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"firstTriggerCharacter"
],
"type": "object"
},
"DocumentOnTypeFormattingParams": {
"additionalProperties": false,
"description": "The parameters of a [DocumentOnTypeFormattingRequest](#DocumentOnTypeFormattingRequest).",
"properties": {
"ch": {
"description": "The character that has been typed.",
"type": "string"
},
"options": {
"$ref": "#/definitions/FormattingOptions",
"description": "The format options."
},
"position": {
"$ref": "#/definitions/Position",
"description": "The position at which this request was send."
},
"textDocument": {
"$ref": "#/definitions/TextDocumentIdentifier",
"description": "The document to format."
}
},
"required": [
"textDocument",
"position",
"ch",
"options"
],
"type": "object"
},
"DocumentOnTypeFormattingRegistrationOptions": {
"additionalProperties": false,
"description": "Registration options for a [DocumentOnTypeFormattingRequest](#DocumentOnTypeFormattingRequest).",
"properties": {
"documentSelector": {
"anyOf": [
{
"$ref": "#/definitions/DocumentSelector"
},
{
"type": "null"
}
],
"description": "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."
},
"firstTriggerCharacter": {
"description": "A character on which formatting should be triggered, like `}`.",
"type": "string"
},
"moreTriggerCharacter": {
"description": "More trigger characters.",
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"documentSelector",
"firstTriggerCharacter"
],
"type": "object"
},
"DocumentRangeFormattingClientCapabilities": {
"additionalProperties": false,
"description": "Client capabilities of a [DocumentRangeFormattingRequest](#DocumentRangeFormattingRequest).",
"properties": {
"dynamicRegistration": {
"description": "Whether range formatting supports dynamic registration.",
"type": "boolean"
}
},
"type": "object"
},
"DocumentRangeFormattingOptions": {
"additionalProperties": false,
"description": "Provider options for a [DocumentRangeFormattingRequest](#DocumentRangeFormattingRequest).",
"properties": {
"workDoneProgress": {
"type": "boolean"
}
},
"type": "object"
},
"DocumentRangeFormattingParams": {
"additionalProperties": false,
"description": "The parameters of a [DocumentRangeFormattingRequest](#DocumentRangeFormattingRequest).",
"properties": {
"options": {
"$ref": "#/definitions/FormattingOptions",
"description": "The format options"
},
"range": {
"$ref": "#/definitions/Range",
"description": "The range to format"
},
"textDocument": {
"$ref": "#/definitions/TextDocumentIdentifier",
"description": "The document to format."
},
"workDoneToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report work done progress."
}
},
"required": [
"textDocument",
"range",
"options"
],
"type": "object"
},
"DocumentRangeFormattingRegistrationOptions": {
"additionalProperties": false,
"description": "Registration options for a [DocumentRangeFormattingRequest](#DocumentRangeFormattingRequest).",
"properties": {
"documentSelector": {
"anyOf": [
{
"$ref": "#/definitions/DocumentSelector"
},
{
"type": "null"
}
],
"description": "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."
},
"workDoneProgress": {
"type": "boolean"
}
},
"required": [
"documentSelector"
],
"type": "object"
},
"DocumentSelector": {
"description": "A document selector is the combination of one or many document filters. \n The DocumentSelector namespace provides helper functions to work with\n[DocumentSelector](#DocumentSelector)s.",
"items": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/definitions/DocumentFilter"
}
]
},
"type": "array"
},
"DocumentSymbolClientCapabilities": {
"additionalProperties": false,
"description": "Client Capabilities for a [DocumentSymbolRequest](#DocumentSymbolRequest).",
"properties": {
"dynamicRegistration": {
"description": "Whether document symbol supports dynamic registration.",
"type": "boolean"
},
"hierarchicalDocumentSymbolSupport": {
"description": "The client support hierarchical document symbols.",
"type": "boolean"
},
"symbolKind": {
"additionalProperties": false,
"description": "Specific capabilities for the `SymbolKind`.",
"properties": {
"valueSet": {
"description": "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.",
"items": {
"$ref": "#/definitions/SymbolKind"
},
"type": "array"
}
},
"type": "object"
}
},
"type": "object"
},
"DocumentSymbolOptions": {
"additionalProperties": false,
"description": "Provider options for a [DocumentSymbolRequest](#DocumentSymbolRequest).",
"properties": {
"workDoneProgress": {
"type": "boolean"
}
},
"type": "object"
},
"DocumentSymbolParams": {
"additionalProperties": false,
"description": "Parameters for a [DocumentSymbolRequest](#DocumentSymbolRequest).",
"properties": {
"partialResultToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report partial results (e.g. streaming) to\nthe client."
},
"textDocument": {
"$ref": "#/definitions/TextDocumentIdentifier",
"description": "The text document."
},
"workDoneToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report work done progress."
}
},
"required": [
"textDocument"
],
"type": "object"
},
"DocumentSymbolRegistrationOptions": {
"additionalProperties": false,
"description": "Registration options for a [DocumentSymbolRequest](#DocumentSymbolRequest).",
"properties": {
"documentSelector": {
"anyOf": [
{
"$ref": "#/definitions/DocumentSelector"
},
{
"type": "null"
}
],
"description": "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."
},
"workDoneProgress": {
"type": "boolean"
}
},
"required": [
"documentSelector"
],
"type": "object"
},
"DocumentUri": {
"description": "A tagging type for string properties that are actually URIs.",
"type": "string"
},
"ExecuteCommandClientCapabilities": {
"additionalProperties": false,
"description": "The client capabilities of a [ExecuteCommandRequest](#ExecuteCommandRequest).",
"properties": {
"dynamicRegistration": {
"description": "Execute command supports dynamic registration.",
"type": "boolean"
}
},
"type": "object"
},
"ExecuteCommandOptions": {
"additionalProperties": false,
"description": "The server capabilities of a [ExecuteCommandRequest](#ExecuteCommandRequest).",
"properties": {
"commands": {
"description": "The commands to be executed on the server",
"items": {
"type": "string"
},
"type": "array"
},
"workDoneProgress": {
"type": "boolean"
}
},
"required": [
"commands"
],
"type": "object"
},
"ExecuteCommandParams": {
"additionalProperties": false,
"description": "The parameters of a [ExecuteCommandRequest](#ExecuteCommandRequest).",
"properties": {
"arguments": {
"description": "Arguments that the command should be invoked with.",
"items": {},
"type": "array"
},
"command": {
"description": "The identifier of the actual command handler.",
"type": "string"
},
"workDoneToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report work done progress."
}
},
"required": [
"command"
],
"type": "object"
},
"ExecuteCommandRegistrationOptions": {
"additionalProperties": false,
"description": "Registration options for a [ExecuteCommandRequest](#ExecuteCommandRequest).",
"properties": {
"commands": {
"description": "The commands to be executed on the server",
"items": {
"type": "string"
},
"type": "array"
},
"workDoneProgress": {
"type": "boolean"
}
},
"required": [
"commands"
],
"type": "object"
},
"FailureHandlingKind": {
"enum": [
"abort",
"transactional",
"undo",
"textOnlyTransactional"
],
"type": "string"
},
"FileChangeType": {
"description": "The file event type",
"enum": [
1,
2,
3
],
"type": "number"
},
"FileEvent": {
"additionalProperties": false,
"description": "An event describing a file change.",
"properties": {
"type": {
"$ref": "#/definitions/FileChangeType",
"description": "The change type."
},
"uri": {
"$ref": "#/definitions/DocumentUri",
"description": "The file's uri."
}
},
"required": [
"uri",
"type"
],
"type": "object"
},
"FileSystemWatcher": {
"additionalProperties": false,
"properties": {
"globPattern": {
"description": "The glob pattern to watch. 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`)",
"type": "string"
},
"kind": {
"description": "The kind of events of interest. If omitted it defaults\nto WatchKind.Create | WatchKind.Change | WatchKind.Delete\nwhich is 7.",
"type": "number"
}
},
"required": [
"globPattern"
],
"type": "object"
},
"FoldingRangeClientCapabilities": {
"additionalProperties": false,
"properties": {
"dynamicRegistration": {
"description": "Whether implementation supports dynamic registration for folding range providers. If this is set to `true`\nthe client supports the new `FoldingRangeRegistrationOptions` return value for the corresponding server\ncapability as well.",
"type": "boolean"
},
"lineFoldingOnly": {
"description": "If set, the client signals that it only supports folding complete lines. If set, client will\nignore specified `startCharacter` and `endCharacter` properties in a FoldingRange.",
"type": "boolean"
},
"rangeLimit": {
"description": "The maximum number of folding ranges that the client prefers to receive per document. The value serves as a\nhint, servers are free to follow the limit.",
"type": "number"
}
},
"type": "object"
},
"FormattingOptions": {
"additionalProperties": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"not": {}
}
],
"description": "Signature for further properties."
},
"description": "Value-object describing what options formatting should use. \n The FormattingOptions namespace provides helper functions to work with\r\n[FormattingOptions](#FormattingOptions) literals.",
"properties": {
"insertFinalNewline": {
"description": "Insert a newline character at the end of the file if one does not exist.",
"type": "boolean"
},
"insertSpaces": {
"description": "Prefer spaces over tabs.",
"type": "boolean"
},
"tabSize": {
"description": "Size of a tab in spaces.",
"type": "number"
},
"trimFinalNewlines": {
"description": "Trim all newlines after the final newline at the end of the file.",
"type": "boolean"
},
"trimTrailingWhitespace": {
"description": "Trim trailing whitespaces on a line.",
"type": "boolean"
}
},
"required": [
"tabSize",
"insertSpaces"
],
"type": "object"
},
"HoverClientCapabilities": {
"additionalProperties": false,
"properties": {
"contentFormat": {
"description": "Client supports the follow content formats for the content\nproperty. The order describes the preferred format of the client.",
"items": {
"$ref": "#/definitions/MarkupKind"
},
"type": "array"
},
"dynamicRegistration": {
"description": "Whether hover supports dynamic registration.",
"type": "boolean"
}
},
"type": "object"
},
"HoverOptions": {
"additionalProperties": false,
"description": "Hover options.",
"properties": {
"workDoneProgress": {
"type": "boolean"
}
},
"type": "object"
},
"HoverParams": {
"additionalProperties": false,
"description": "Parameters for a [HoverRequest](#HoverRequest).",
"properties": {
"position": {
"$ref": "#/definitions/Position",
"description": "The position inside the text document."
},
"textDocument": {
"$ref": "#/definitions/TextDocumentIdentifier",
"description": "The text document."
},
"workDoneToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report work done progress."
}
},
"required": [
"position",
"textDocument"
],
"type": "object"
},
"HoverRegistrationOptions": {
"additionalProperties": false,
"description": "Registration options for a [HoverRequest](#HoverRequest).",
"properties": {
"documentSelector": {
"anyOf": [
{
"$ref": "#/definitions/DocumentSelector"
},
{
"type": "null"
}
],
"description": "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."
},
"workDoneProgress": {
"type": "boolean"
}
},
"required": [
"documentSelector"
],
"type": "object"
},
"ImplementationClientCapabilities": {
"additionalProperties": false,
"description": "Since 3.6.0",
"properties": {
"dynamicRegistration": {
"description": "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.",
"type": "boolean"
},
"linkSupport": {
"description": "The client supports additional metadata in the form of definition links.\n\nSince 3.14.0",
"type": "boolean"
}
},
"type": "object"
},
"InitializeError": {
"additionalProperties": false,
"description": "Known error codes for an `InitializeError`; \n The data type of the ResponseError if the\ninitialize request fails.",
"properties": {
"retry": {
"description": "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.",
"type": "boolean"
}
},
"required": [
"retry"
],
"type": "object"
},
"InitializeParams": {
"additionalProperties": false,
"properties": {
"capabilities": {
"$ref": "#/definitions/ClientCapabilities",
"description": "The capabilities provided by the client (editor or tool)"
},
"clientInfo": {
"additionalProperties": false,
"description": "Information about the client",
"properties": {
"name": {
"description": "The name of the client as defined by the client.",
"type": "string"
},
"version": {
"description": "The client's version as defined by the client.",
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
},
"initializationOptions": {
"description": "User provided initialization options."
},
"processId": {
"description": "The process Id of the parent process that started\nthe server.",
"type": [
"number",
"null"
]
},
"rootPath": {
"description": "The rootPath of the workspace. Is null\nif no folder is open.",
"type": [
"string",
"null"
]
},
"rootUri": {
"anyOf": [
{
"$ref": "#/definitions/DocumentUri"
},
{
"type": "null"
}
],
"description": "The rootUri of the workspace. Is null if no\nfolder is open. If both `rootPath` and `rootUri` are set\n`rootUri` wins."
},
"trace": {
"description": "The initial trace setting. If omitted trace is disabled ('off').",
"enum": [
"off",
"messages",
"verbose"
],
"type": "string"
},
"workDoneToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report work done progress."
},
"workspaceFolders": {
"anyOf": [
{
"items": {
"$ref": "#/definitions/WorkspaceFolder"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "The actual configured workspace folders."
}
},
"required": [
"capabilities",
"processId",
"rootUri",
"workspaceFolders"
],
"type": "object"
},
"InitializedParams": {
"additionalProperties": false,
"type": "object"
},
"Location": {
"additionalProperties": false,
"description": "Represents a location inside a resource, such as a line\r\ninside a text file. \n The Location namespace provides helper functions to work with\r\n[Location](#Location) literals.",
"properties": {
"range": {
"$ref": "#/definitions/Range"
},
"uri": {
"$ref": "#/definitions/DocumentUri"
}
},
"required": [
"uri",
"range"
],
"type": "object"
},
"LogMessageParams": {
"additionalProperties": false,
"description": "The log message parameters.",
"properties": {
"message": {
"description": "The actual message",
"type": "string"
},
"type": {
"$ref": "#/definitions/MessageType",
"description": "The message type. See {@link MessageType}"
}
},
"required": [
"type",
"message"
],
"type": "object"
},
"MarkupContent": {
"additionalProperties": false,
"description": "A `MarkupContent` literal represents a string value which content is interpreted base on its\r\nkind flag. Currently the protocol supports `plaintext` and `markdown` as markup kinds.\r\n\r\nIf the kind is `markdown` then the value can contain fenced code blocks like in GitHub issues.\r\nSee https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting\r\n\r\nHere is an example how such a string can be constructed using JavaScript / TypeScript:\r\n```ts\r\nlet markdown: MarkdownContent = {\r\n kind: MarkupKind.Markdown,\r\nvalue: [\r\n\t\t'# Header',\r\n\t\t'Some text',\r\n\t\t'```typescript',\r\n\t\t'someCode();',\r\n\t\t'```'\r\n].join('\\n')\r\n};\r\n```\r\n\r\n*Please Note* that clients might sanitize the return markdown. A client could decide to\r\nremove HTML from the markdown to avoid script execution.",
"properties": {
"kind": {
"$ref": "#/definitions/MarkupKind",
"description": "The type of the Markup"
},
"value": {
"description": "The content itself",
"type": "string"
}
},
"required": [
"kind",
"value"
],
"type": "object"
},
"MarkupKind": {
"description": "Describes the content type that a client supports in various\r\nresult literals like `Hover`, `ParameterInfo` or `CompletionItem`.\r\n\r\nPlease note that `MarkupKinds` must not start with a `$`. This kinds\r\nare reserved for internal usage.",
"enum": [
"plaintext",
"markdown"
],
"type": "string"
},
"MessageActionItem": {
"additionalProperties": false,
"properties": {
"title": {
"description": "A short title like 'Retry', 'Open Log' etc.",
"type": "string"
}
},
"required": [
"title"
],
"type": "object"
},
"MessageType": {
"description": "The message type",
"enum": [
1,
2,
3,
4
],
"type": "number"
},
"ParameterInformation": {
"additionalProperties": false,
"description": "Represents a parameter of a callable-signature. A parameter can\r\nhave a label and a doc-comment. \n The ParameterInformation namespace provides helper functions to work with\r\n[ParameterInformation](#ParameterInformation) literals.",
"properties": {
"documentation": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/definitions/MarkupContent"
}
],
"description": "The human-readable doc-comment of this signature. Will be shown\r\nin the UI but can be omitted."
},
"label": {
"anyOf": [
{
"type": "string"
},
{
"items": [
{
"type": "number"
},
{
"type": "number"
}
],
"maxItems": 2,
"minItems": 2,
"type": "array"
}
],
"description": "The label of this parameter information.\r\n\r\nEither a string or an inclusive start and exclusive end offsets within its containing\r\nsignature label. (see SignatureInformation.label). The offsets are based on a UTF-16\r\nstring representation as `Position` and `Range` does.\r\n\r\n*Note*: a label of type string should be a substring of its containing signature label.\r\nIts intended use case is to highlight the parameter label part in the `SignatureInformation.label`."
}
},
"required": [
"label"
],
"type": "object"
},
"PartialResultParams": {
"additionalProperties": false,
"properties": {
"partialResultToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report partial results (e.g. streaming) to\nthe client."
}
},
"type": "object"
},
"Position": {
"additionalProperties": false,
"description": "Position in a text document expressed as zero-based line and character offset.\r\nThe offsets are based on a UTF-16 string representation. So a string of the form\r\n`a๐€b` the character offset of the character `a` is 0, the character offset of `๐€`\r\nis 1 and the character offset of b is 3 since `๐€` is represented using two code\r\nunits in UTF-16.\r\n\r\nPositions are line end character agnostic. So you can not specify a position that\r\ndenotes `\\r|\\n` or `\\n|` where `|` represents the character offset. \n The Position namespace provides helper functions to work with\r\n[Position](#Position) literals.",
"properties": {
"character": {
"description": "Character offset on a line in a document (zero-based). Assuming that the line is\r\nrepresented as a string, the `character` value represents the gap between the\r\n`character` and `character + 1`.\r\n\r\nIf the character value is greater than the line length it defaults back to the\r\nline length.\r\nIf a line number is negative, it defaults to 0.",
"type": "number"
},
"line": {
"description": "Line position in a document (zero-based).\r\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.\r\nIf a line number is negative, it defaults to 0.",
"type": "number"
}
},
"required": [
"line",
"character"
],
"type": "object"
},
"PrepareRenameParams": {
"additionalProperties": false,
"properties": {
"position": {
"$ref": "#/definitions/Position",
"description": "The position inside the text document."
},
"textDocument": {
"$ref": "#/definitions/TextDocumentIdentifier",
"description": "The text document."
},
"workDoneToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report work done progress."
}
},
"required": [
"position",
"textDocument"
],
"type": "object"
},
"ProgressToken": {
"type": [
"number",
"string"
]
},
"PublishDiagnosticsClientCapabilities": {
"additionalProperties": false,
"description": "The publish diagnostic client capabilities.",
"properties": {
"relatedInformation": {
"description": "Whether the clients accepts diagnostics with related information.",
"type": "boolean"
},
"tagSupport": {
"additionalProperties": false,
"description": "Client supports the tag property to provide meta data about a diagnostic.\nClients supporting tags have to handle unknown tags gracefully.",
"properties": {
"valueSet": {
"description": "The tags supported by the client.",
"items": {
"$ref": "#/definitions/DiagnosticTag"
},
"type": "array"
}
},
"required": [
"valueSet"
],
"type": "object"
}
},
"type": "object"
},
"PublishDiagnosticsParams": {
"additionalProperties": false,
"description": "The publish diagnostic notification's parameters.",
"properties": {
"diagnostics": {
"description": "An array of diagnostic information items.",
"items": {
"$ref": "#/definitions/Diagnostic"
},
"type": "array"
},
"uri": {
"$ref": "#/definitions/DocumentUri",
"description": "The URI for which diagnostic information is reported."
},
"version": {
"description": "Optional the version number of the document the diagnostics are published for.",
"type": "number"
}
},
"required": [
"uri",
"diagnostics"
],
"type": "object"
},
"Range": {
"additionalProperties": false,
"description": "A range in a text document expressed as (zero-based) start and end positions.\r\n\r\nIf you want to specify a range that contains a line including the line ending\r\ncharacter(s) then use an end position denoting the start of the next line.\r\nFor example:\r\n```ts\r\n{\r\n start: { line: 5, character: 23 }\r\n end : { line 6, character : 0 }\r\n}\r\n``` \n The Range namespace provides helper functions to work with\r\n[Range](#Range) literals.",
"properties": {
"end": {
"$ref": "#/definitions/Position",
"description": "The range's end position."
},
"start": {
"$ref": "#/definitions/Position",
"description": "The range's start position"
}
},
"required": [
"start",
"end"
],
"type": "object"
},
"ReferenceClientCapabilities": {
"additionalProperties": false,
"description": "Client Capabilities for a [ReferencesRequest](#ReferencesRequest).",
"properties": {
"dynamicRegistration": {
"description": "Whether references supports dynamic registration.",
"type": "boolean"
}
},
"type": "object"
},
"ReferenceContext": {
"additionalProperties": false,
"description": "Value-object that contains additional information when\r\nrequesting references.",
"properties": {
"includeDeclaration": {
"description": "Include the declaration of the current symbol.",
"type": "boolean"
}
},
"required": [
"includeDeclaration"
],
"type": "object"
},
"ReferenceOptions": {
"additionalProperties": false,
"description": "Reference options.",
"properties": {
"workDoneProgress": {
"type": "boolean"
}
},
"type": "object"
},
"ReferenceParams": {
"additionalProperties": false,
"description": "Parameters for a [ReferencesRequest](#ReferencesRequest).",
"properties": {
"context": {
"$ref": "#/definitions/ReferenceContext"
},
"partialResultToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report partial results (e.g. streaming) to\nthe client."
},
"position": {
"$ref": "#/definitions/Position",
"description": "The position inside the text document."
},
"textDocument": {
"$ref": "#/definitions/TextDocumentIdentifier",
"description": "The text document."
},
"workDoneToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report work done progress."
}
},
"required": [
"context",
"position",
"textDocument"
],
"type": "object"
},
"ReferenceRegistrationOptions": {
"additionalProperties": false,
"description": "Registration options for a [ReferencesRequest](#ReferencesRequest).",
"properties": {
"documentSelector": {
"anyOf": [
{
"$ref": "#/definitions/DocumentSelector"
},
{
"type": "null"
}
],
"description": "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."
},
"workDoneProgress": {
"type": "boolean"
}
},
"required": [
"documentSelector"
],
"type": "object"
},
"Registration": {
"additionalProperties": false,
"description": "General parameters to to register for an notification or to register a provider.",
"properties": {
"id": {
"description": "The id used to register the request. The id can be used to deregister\nthe request again.",
"type": "string"
},
"method": {
"description": "The method to register for.",
"type": "string"
},
"registerOptions": {
"description": "Options necessary for the registration."
}
},
"required": [
"id",
"method"
],
"type": "object"
},
"RegistrationParams": {
"additionalProperties": false,
"properties": {
"registrations": {
"items": {
"$ref": "#/definitions/Registration"
},
"type": "array"
}
},
"required": [
"registrations"
],
"type": "object"
},
"RenameClientCapabilities": {
"additionalProperties": false,
"properties": {
"dynamicRegistration": {
"description": "Whether rename supports dynamic registration.",
"type": "boolean"
},
"prepareSupport": {
"description": "Client supports testing for validity of rename operations\nbefore execution.",
"type": "boolean"
}
},
"type": "object"
},
"RenameFile": {
"additionalProperties": false,
"description": "Rename file operation",
"properties": {
"kind": {
"description": "A rename",
"enum": [
"rename"
],
"type": "string"
},
"newUri": {
"$ref": "#/definitions/DocumentUri",
"description": "The new location."
},
"oldUri": {
"$ref": "#/definitions/DocumentUri",
"description": "The old (existing) location."
},
"options": {
"$ref": "#/definitions/RenameFileOptions",
"description": "Rename options."
}
},
"required": [
"kind",
"newUri",
"oldUri"
],
"type": "object"
},
"RenameFileOptions": {
"additionalProperties": false,
"description": "Rename file options",
"properties": {
"ignoreIfExists": {
"description": "Ignores if target exists.",
"type": "boolean"
},
"overwrite": {
"description": "Overwrite target if existing. Overwrite wins over `ignoreIfExists`",
"type": "boolean"
}
},
"type": "object"
},
"RenameOptions": {
"additionalProperties": false,
"description": "Provider options for a [RenameRequest](#RenameRequest).",
"properties": {
"prepareProvider": {
"description": "Renames should be checked and tested before being executed.",
"type": "boolean"
},
"workDoneProgress": {
"type": "boolean"
}
},
"type": "object"
},
"RenameParams": {
"additionalProperties": false,
"description": "The parameters of a [RenameRequest](#RenameRequest).",
"properties": {
"newName": {
"description": "The new name of the symbol. If the given name is not valid the\nrequest must return a [ResponseError](#ResponseError) with an\nappropriate message set.",
"type": "string"
},
"position": {
"$ref": "#/definitions/Position",
"description": "The position at which this request was sent."
},
"textDocument": {
"$ref": "#/definitions/TextDocumentIdentifier",
"description": "The document to rename."
},
"workDoneToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report work done progress."
}
},
"required": [
"textDocument",
"position",
"newName"
],
"type": "object"
},
"RenameRegistrationOptions": {
"additionalProperties": false,
"description": "Registration options for a [RenameRequest](#RenameRequest).",
"properties": {
"documentSelector": {
"anyOf": [
{
"$ref": "#/definitions/DocumentSelector"
},
{
"type": "null"
}
],
"description": "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."
},
"prepareProvider": {
"description": "Renames should be checked and tested before being executed.",
"type": "boolean"
},
"workDoneProgress": {
"type": "boolean"
}
},
"required": [
"documentSelector"
],
"type": "object"
},
"ResourceOperationKind": {
"description": "The kind of resource operations supported by the client.",
"enum": [
"create",
"rename",
"delete"
],
"type": "string"
},
"SaveOptions": {
"additionalProperties": false,
"description": "Save options.",
"properties": {
"includeText": {
"description": "The client is supposed to include the content on save.",
"type": "boolean"
}
},
"type": "object"
},
"SelectionRangeClientCapabilities": {
"additionalProperties": false,
"properties": {
"dynamicRegistration": {
"description": "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.",
"type": "boolean"
}
},
"type": "object"
},
"ShowMessageParams": {
"additionalProperties": false,
"description": "The parameters of a notification message.",
"properties": {
"message": {
"description": "The actual message",
"type": "string"
},
"type": {
"$ref": "#/definitions/MessageType",
"description": "The message type. See {@link MessageType}"
}
},
"required": [
"type",
"message"
],
"type": "object"
},
"ShowMessageRequestParams": {
"additionalProperties": false,
"properties": {
"actions": {
"description": "The message action items to present.",
"items": {
"$ref": "#/definitions/MessageActionItem"
},
"type": "array"
},
"message": {
"description": "The actual message",
"type": "string"
},
"type": {
"$ref": "#/definitions/MessageType",
"description": "The message type. See {@link MessageType}"
}
},
"required": [
"type",
"message"
],
"type": "object"
},
"SignatureHelp": {
"additionalProperties": false,
"description": "Signature help represents the signature of something\r\ncallable. There can be multiple signature but only one\r\nactive and only one active parameter.",
"properties": {
"activeParameter": {
"description": "The active parameter of the active signature. Set to `null`\r\nif the active signature has no parameters.",
"type": [
"number",
"null"
]
},
"activeSignature": {
"description": "The active signature. Set to `null` if no\r\nsignatures exist.",
"type": [
"number",
"null"
]
},
"signatures": {
"description": "One or more signatures.",
"items": {
"$ref": "#/definitions/SignatureInformation"
},
"type": "array"
}
},
"required": [
"signatures",
"activeSignature",
"activeParameter"
],
"type": "object"
},
"SignatureHelpClientCapabilities": {
"additionalProperties": false,
"description": "Client Capabilities for a [SignatureHelpRequest](#SignatureHelpRequest).",
"properties": {
"contextSupport": {
"description": "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`.",
"type": "boolean"
},
"dynamicRegistration": {
"description": "Whether signature help supports dynamic registration.",
"type": "boolean"
},
"signatureInformation": {
"additionalProperties": false,
"description": "The client supports the following `SignatureInformation`\nspecific properties.",
"properties": {
"documentationFormat": {
"description": "Client supports the follow content formats for the documentation\nproperty. The order describes the preferred format of the client.",
"items": {
"$ref": "#/definitions/MarkupKind"
},
"type": "array"
},
"parameterInformation": {
"additionalProperties": false,
"description": "Client capabilities specific to parameter information.",
"properties": {
"labelOffsetSupport": {
"description": "The client supports processing label offsets instead of a\nsimple label string.",
"type": "boolean"
}
},
"type": "object"
}
},
"type": "object"
}
},
"type": "object"
},
"SignatureHelpContext": {
"additionalProperties": false,
"description": "Additional information about the context in which a signature help request was triggered.",
"properties": {
"activeSignatureHelp": {
"$ref": "#/definitions/SignatureHelp",
"description": "The currently active `SignatureHelp`.\n\nThe `activeSignatureHelp` has its `SignatureHelp.activeSignature` field updated based on\nthe user navigating through available signatures."
},
"isRetrigger": {
"description": "`true` if signature help was already showing when it was triggered.\n\nRetriggers occur 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.",
"type": "boolean"
},
"triggerCharacter": {
"description": "Character that caused signature help to be triggered.\n\nThis is undefined when `triggerKind !== SignatureHelpTriggerKind.TriggerCharacter`",
"type": "string"
},
"triggerKind": {
"$ref": "#/definitions/SignatureHelpTriggerKind",
"description": "Action that caused signature help to be triggered."
}
},
"required": [
"triggerKind",
"isRetrigger"
],
"type": "object"
},
"SignatureHelpOptions": {
"additionalProperties": false,
"description": "Server Capabilities for a [SignatureHelpRequest](#SignatureHelpRequest).",
"properties": {
"retriggerCharacters": {
"description": "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.",
"items": {
"type": "string"
},
"type": "array"
},
"triggerCharacters": {
"description": "List of characters that trigger signature help.",
"items": {
"type": "string"
},
"type": "array"
},
"workDoneProgress": {
"type": "boolean"
}
},
"type": "object"
},
"SignatureHelpParams": {
"additionalProperties": false,
"description": "Parameters for a [SignatureHelpRequest](#SignatureHelpRequest).",
"properties": {
"context": {
"$ref": "#/definitions/SignatureHelpContext",
"description": "The signature help context. This is only available if the client specifies\nto send this using the client capability `textDocument.signatureHelp.contextSupport === true`"
},
"position": {
"$ref": "#/definitions/Position",
"description": "The position inside the text document."
},
"textDocument": {
"$ref": "#/definitions/TextDocumentIdentifier",
"description": "The text document."
},
"workDoneToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report work done progress."
}
},
"required": [
"position",
"textDocument"
],
"type": "object"
},
"SignatureHelpRegistrationOptions": {
"additionalProperties": false,
"description": "Registration options for a [SignatureHelpRequest](#SignatureHelpRequest).",
"properties": {
"documentSelector": {
"anyOf": [
{
"$ref": "#/definitions/DocumentSelector"
},
{
"type": "null"
}
],
"description": "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."
},
"retriggerCharacters": {
"description": "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.",
"items": {
"type": "string"
},
"type": "array"
},
"triggerCharacters": {
"description": "List of characters that trigger signature help.",
"items": {
"type": "string"
},
"type": "array"
},
"workDoneProgress": {
"type": "boolean"
}
},
"required": [
"documentSelector"
],
"type": "object"
},
"SignatureHelpTriggerKind": {
"description": "How a signature help was triggered.",
"enum": [
1,
2,
3
],
"type": "number"
},
"SignatureInformation": {
"additionalProperties": false,
"description": "Represents the signature of something callable. A signature\r\ncan have a label, like a function-name, a doc-comment, and\r\na set of parameters. \n The SignatureInformation namespace provides helper functions to work with\r\n[SignatureInformation](#SignatureInformation) literals.",
"properties": {
"documentation": {
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/definitions/MarkupContent"
}
],
"description": "The human-readable doc-comment of this signature. Will be shown\r\nin the UI but can be omitted."
},
"label": {
"description": "The label of this signature. Will be shown in\r\nthe UI.",
"type": "string"
},
"parameters": {
"description": "The parameters of this signature.",
"items": {
"$ref": "#/definitions/ParameterInformation"
},
"type": "array"
}
},
"required": [
"label"
],
"type": "object"
},
"StaticRegistrationOptions": {
"additionalProperties": false,
"description": "Static registration options to be returned in the initialize\nrequest. \n The StaticRegistrationOptions namespace provides helper functions to work with\n[StaticRegistrationOptions](#StaticRegistrationOptions) literals.",
"properties": {
"id": {
"description": "The id used to register the request. The id can be used to deregister\nthe request again. See also Registration#id.",
"type": "string"
}
},
"type": "object"
},
"SymbolKind": {
"description": "A symbol kind.",
"enum": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26
],
"type": "number"
},
"TextDocumentChangeRegistrationOptions": {
"additionalProperties": false,
"description": "Describe options to be used when registered for text document change events.",
"properties": {
"documentSelector": {
"anyOf": [
{
"$ref": "#/definitions/DocumentSelector"
},
{
"type": "null"
}
],
"description": "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."
},
"syncKind": {
"$ref": "#/definitions/TextDocumentSyncKind",
"description": "How documents are synced to the server."
}
},
"required": [
"documentSelector",
"syncKind"
],
"type": "object"
},
"TextDocumentClientCapabilities": {
"additionalProperties": false,
"description": "Text document specific client capabilities.",
"properties": {
"codeAction": {
"$ref": "#/definitions/CodeActionClientCapabilities",
"description": "Capabilities specific to the `textDocument/codeAction`"
},
"codeLens": {
"$ref": "#/definitions/CodeLensClientCapabilities",
"description": "Capabilities specific to the `textDocument/codeLens`"
},
"colorProvider": {
"$ref": "#/definitions/DocumentColorClientCapabilities",
"description": "Capabilities specific to the `textDocument/documentColor`"
},
"completion": {
"$ref": "#/definitions/CompletionClientCapabilities",
"description": "Capabilities specific to the `textDocument/completion`"
},
"declaration": {
"$ref": "#/definitions/DeclarationClientCapabilities",
"description": "Capabilities specific to the `textDocument/declaration`"
},
"definition": {
"$ref": "#/definitions/DefinitionClientCapabilities",
"description": "Capabilities specific to the `textDocument/definition`"
},
"documentHighlight": {
"$ref": "#/definitions/DocumentHighlightClientCapabilities",
"description": "Capabilities specific to the `textDocument/documentHighlight`"
},
"documentLink": {
"$ref": "#/definitions/DocumentLinkClientCapabilities",
"description": "Capabilities specific to the `textDocument/documentLink`"
},
"documentSymbol": {
"$ref": "#/definitions/DocumentSymbolClientCapabilities",
"description": "Capabilities specific to the `textDocument/documentSymbol`"
},
"foldingRange": {
"$ref": "#/definitions/FoldingRangeClientCapabilities",
"description": "Capabilities specific to `textDocument/foldingRange` requests."
},
"formatting": {
"$ref": "#/definitions/DocumentFormattingClientCapabilities",
"description": "Capabilities specific to the `textDocument/formatting`"
},
"hover": {
"$ref": "#/definitions/HoverClientCapabilities",
"description": "Capabilities specific to the `textDocument/hover`"
},
"implementation": {
"$ref": "#/definitions/ImplementationClientCapabilities",
"description": "Capabilities specific to the `textDocument/implementation`"
},
"onTypeFormatting": {
"$ref": "#/definitions/DocumentOnTypeFormattingClientCapabilities",
"description": "Capabilities specific to the `textDocument/onTypeFormatting`"
},
"publishDiagnostics": {
"$ref": "#/definitions/PublishDiagnosticsClientCapabilities",
"description": "Capabilities specific to `textDocument/publishDiagnostics`."
},
"rangeFormatting": {
"$ref": "#/definitions/DocumentRangeFormattingClientCapabilities",
"description": "Capabilities specific to the `textDocument/rangeFormatting`"
},
"references": {
"$ref": "#/definitions/ReferenceClientCapabilities",
"description": "Capabilities specific to the `textDocument/references`"
},
"rename": {
"$ref": "#/definitions/RenameClientCapabilities",
"description": "Capabilities specific to the `textDocument/rename`"
},
"selectionRange": {
"$ref": "#/definitions/SelectionRangeClientCapabilities",
"description": "Capabilities specific to `textDocument/selectionRange` requests"
},
"signatureHelp": {
"$ref": "#/definitions/SignatureHelpClientCapabilities",
"description": "Capabilities specific to the `textDocument/signatureHelp`"
},
"synchronization": {
"$ref": "#/definitions/TextDocumentSyncClientCapabilities",
"description": "Defines which synchronization capabilities the client supports."
},
"typeDefinition": {
"$ref": "#/definitions/TypeDefinitionClientCapabilities",
"description": "Capabilities specific to the `textDocument/typeDefinition`"
}
},
"type": "object"
},
"TextDocumentContentChangeEvent": {
"additionalProperties": false,
"description": "An event describing a change to a text document. If range and rangeLength are omitted\r\nthe new text is considered to be the full content of the document.",
"properties": {
"range": {
"$ref": "#/definitions/Range",
"description": "The range of the document that changed."
},
"rangeLength": {
"description": "The length of the range that got replaced.",
"type": "number"
},
"text": {
"description": "The new text of the document.",
"type": "string"
}
},
"required": [
"text"
],
"type": "object"
},
"TextDocumentEdit": {
"additionalProperties": false,
"description": "Describes textual changes on a text document. \n The TextDocumentEdit namespace provides helper function to create\r\nan edit that manipulates a text document.",
"properties": {
"edits": {
"description": "The edits to be applied.",
"items": {
"$ref": "#/definitions/TextEdit"
},
"type": "array"
},
"textDocument": {
"$ref": "#/definitions/VersionedTextDocumentIdentifier",
"description": "The text document to change."
}
},
"required": [
"textDocument",
"edits"
],
"type": "object"
},
"TextDocumentIdentifier": {
"additionalProperties": false,
"description": "A literal to identify a text document in the client. \n The TextDocumentIdentifier namespace provides helper functions to work with\r\n[TextDocumentIdentifier](#TextDocumentIdentifier) literals.",
"properties": {
"uri": {
"$ref": "#/definitions/DocumentUri",
"description": "The text document's uri."
}
},
"required": [
"uri"
],
"type": "object"
},
"TextDocumentItem": {
"additionalProperties": false,
"description": "An item to transfer a text document from the client to the\r\nserver. \n The TextDocumentItem namespace provides helper functions to work with\r\n[TextDocumentItem](#TextDocumentItem) literals.",
"properties": {
"languageId": {
"description": "The text document's language identifier",
"type": "string"
},
"text": {
"description": "The content of the opened text document.",
"type": "string"
},
"uri": {
"$ref": "#/definitions/DocumentUri",
"description": "The text document's uri."
},
"version": {
"description": "The version number of this document (it will increase after each\r\nchange, including undo/redo).",
"type": "number"
}
},
"required": [
"uri",
"languageId",
"version",
"text"
],
"type": "object"
},
"TextDocumentPositionParams": {
"additionalProperties": false,
"description": "A parameter literal used in requests to pass a text document and a position inside that\ndocument.",
"properties": {
"position": {
"$ref": "#/definitions/Position",
"description": "The position inside the text document."
},
"textDocument": {
"$ref": "#/definitions/TextDocumentIdentifier",
"description": "The text document."
}
},
"required": [
"textDocument",
"position"
],
"type": "object"
},
"TextDocumentRegistrationOptions": {
"additionalProperties": false,
"description": "General text document registration options. \n The TextDocumentRegistrationOptions namespace provides helper functions to work with\n[TextDocumentRegistrationOptions](#TextDocumentRegistrationOptions) literals.",
"properties": {
"documentSelector": {
"anyOf": [
{
"$ref": "#/definitions/DocumentSelector"
},
{
"type": "null"
}
],
"description": "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."
}
},
"required": [
"documentSelector"
],
"type": "object"
},
"TextDocumentSaveReason": {
"description": "Represents reasons why a text document is saved.",
"enum": [
1,
2,
3
],
"type": "number"
},
"TextDocumentSaveRegistrationOptions": {
"additionalProperties": false,
"description": "Save registration options.",
"properties": {
"documentSelector": {
"anyOf": [
{
"$ref": "#/definitions/DocumentSelector"
},
{
"type": "null"
}
],
"description": "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."
},
"includeText": {
"description": "The client is supposed to include the content on save.",
"type": "boolean"
}
},
"required": [
"documentSelector"
],
"type": "object"
},
"TextDocumentSyncClientCapabilities": {
"additionalProperties": false,
"properties": {
"didSave": {
"description": "The client supports did save notifications.",
"type": "boolean"
},
"dynamicRegistration": {
"description": "Whether text document synchronization supports dynamic registration.",
"type": "boolean"
},
"willSave": {
"description": "The client supports sending will save notifications.",
"type": "boolean"
},
"willSaveWaitUntil": {
"description": "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.",
"type": "boolean"
}
},
"type": "object"
},
"TextDocumentSyncKind": {
"description": "Defines how the host (editor) should sync\ndocument changes to the language server.",
"enum": [
0,
1,
2
],
"type": "number"
},
"TextDocumentSyncOptions": {
"additionalProperties": false,
"properties": {
"change": {
"$ref": "#/definitions/TextDocumentSyncKind",
"description": "Change notifications are sent to the server. See TextDocumentSyncKind.None, TextDocumentSyncKind.Full\nand TextDocumentSyncKind.Incremental. If omitted it defaults to TextDocumentSyncKind.None."
},
"openClose": {
"description": "Open and close notifications are sent to the server. If omitted open close notification should not\nbe sent.",
"type": "boolean"
},
"save": {
"$ref": "#/definitions/SaveOptions",
"description": "If present save notifications are sent to the server. If omitted the notification should not be\nsent."
},
"willSave": {
"description": "If present will save notifications are sent to the server. If omitted the notification should not be\nsent.",
"type": "boolean"
},
"willSaveWaitUntil": {
"description": "If present will save wait until requests are sent to the server. If omitted the request should not be\nsent.",
"type": "boolean"
}
},
"type": "object"
},
"TextEdit": {
"additionalProperties": false,
"description": "A text edit applicable to a text document. \n The TextEdit namespace provides helper function to create replace,\r\ninsert and delete edits more easily.",
"properties": {
"newText": {
"description": "The string to be inserted. For delete operations use an\r\nempty string.",
"type": "string"
},
"range": {
"$ref": "#/definitions/Range",
"description": "The range of the text document to be manipulated. To insert\r\ntext into a document create a range where start === end."
}
},
"required": [
"range",
"newText"
],
"type": "object"
},
"TypeDefinitionClientCapabilities": {
"additionalProperties": false,
"description": "Since 3.6.0",
"properties": {
"dynamicRegistration": {
"description": "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.",
"type": "boolean"
},
"linkSupport": {
"description": "The client supports additional metadata in the form of definition links.\n\nSince 3.14.0",
"type": "boolean"
}
},
"type": "object"
},
"Unregistration": {
"additionalProperties": false,
"description": "General parameters to unregister a request or notification.",
"properties": {
"id": {
"description": "The id used to unregister the request or notification. Usually an id\nprovided during the register request.",
"type": "string"
},
"method": {
"description": "The method to unregister for.",
"type": "string"
}
},
"required": [
"id",
"method"
],
"type": "object"
},
"UnregistrationParams": {
"additionalProperties": false,
"properties": {
"unregisterations": {
"items": {
"$ref": "#/definitions/Unregistration"
},
"type": "array"
}
},
"required": [
"unregisterations"
],
"type": "object"
},
"VersionedTextDocumentIdentifier": {
"additionalProperties": false,
"description": "An identifier to denote a specific version of a text document. \n The VersionedTextDocumentIdentifier namespace provides helper functions to work with\r\n[VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) literals.",
"properties": {
"uri": {
"$ref": "#/definitions/DocumentUri",
"description": "The text document's uri."
},
"version": {
"description": "The version number of this document. If a versioned text document identifier\r\nis sent from the server to the client and the file is not open in the editor\r\n(the server has not received an open notification before) the server can send\r\n`null` to indicate that the version is unknown and the content on disk is the\r\ntruth (as speced with document content ownership).",
"type": [
"number",
"null"
]
}
},
"required": [
"uri",
"version"
],
"type": "object"
},
"WillSaveTextDocumentParams": {
"additionalProperties": false,
"description": "The parameters send in a will save text document notification.",
"properties": {
"reason": {
"$ref": "#/definitions/TextDocumentSaveReason",
"description": "The 'TextDocumentSaveReason'."
},
"textDocument": {
"$ref": "#/definitions/TextDocumentIdentifier",
"description": "The document that will be saved."
}
},
"required": [
"textDocument",
"reason"
],
"type": "object"
},
"WorkDoneProgressOptions": {
"additionalProperties": false,
"description": "The WorkDoneProgressOptions namespace provides helper functions to work with\n[WorkDoneProgressOptions](#WorkDoneProgressOptions) literals.",
"properties": {
"workDoneProgress": {
"type": "boolean"
}
},
"type": "object"
},
"WorkDoneProgressParams": {
"additionalProperties": false,
"properties": {
"workDoneToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report work done progress."
}
},
"type": "object"
},
"WorkspaceClientCapabilities": {
"additionalProperties": false,
"description": "Workspace specific client capabilities.",
"properties": {
"applyEdit": {
"description": "The client supports applying batch edits\nto the workspace by supporting the request\n'workspace/applyEdit'",
"type": "boolean"
},
"didChangeConfiguration": {
"$ref": "#/definitions/DidChangeConfigurationClientCapabilities",
"description": "Capabilities specific to the `workspace/didChangeConfiguration` notification."
},
"didChangeWatchedFiles": {
"$ref": "#/definitions/DidChangeWatchedFilesClientCapabilities",
"description": "Capabilities specific to the `workspace/didChangeWatchedFiles` notification."
},
"executeCommand": {
"$ref": "#/definitions/ExecuteCommandClientCapabilities",
"description": "Capabilities specific to the `workspace/executeCommand` request."
},
"symbol": {
"$ref": "#/definitions/WorkspaceSymbolClientCapabilities",
"description": "Capabilities specific to the `workspace/symbol` request."
},
"workspaceEdit": {
"$ref": "#/definitions/WorkspaceEditClientCapabilities",
"description": "Capabilities specific to `WorkspaceEdit`s"
}
},
"type": "object"
},
"WorkspaceEdit": {
"additionalProperties": false,
"description": "A workspace edit represents changes to many resources managed in the workspace. The edit\r\nshould either provide `changes` or `documentChanges`. If documentChanges are present\r\nthey are preferred over `changes` if the client can handle versioned document edits.",
"properties": {
"changes": {
"additionalProperties": {
"items": {
"$ref": "#/definitions/TextEdit"
},
"type": "array"
},
"description": "Holds changes to existing resources.",
"type": "object"
},
"documentChanges": {
"description": "Depending on the client capability `workspace.workspaceEdit.resourceOperations` document changes\r\nare either an array of `TextDocumentEdit`s to express changes to n different text documents\r\nwhere each text document edit addresses a specific version of a text document. Or it can contain\r\nabove `TextDocumentEdit`s mixed with create, rename and delete file / folder operations.\r\n\r\nWhether a client supports versioned document edits is expressed via\r\n`workspace.workspaceEdit.documentChanges` client capability.\r\n\r\nIf a client neither supports `documentChanges` nor `workspace.workspaceEdit.resourceOperations` then\r\nonly plain `TextEdit`s using the `changes` property are supported.",
"items": {
"anyOf": [
{
"$ref": "#/definitions/TextDocumentEdit"
},
{
"$ref": "#/definitions/CreateFile"
},
{
"$ref": "#/definitions/RenameFile"
},
{
"$ref": "#/definitions/DeleteFile"
}
]
},
"type": "array"
}
},
"type": "object"
},
"WorkspaceEditClientCapabilities": {
"additionalProperties": false,
"properties": {
"documentChanges": {
"description": "The client supports versioned document changes in `WorkspaceEdit`s",
"type": "boolean"
},
"failureHandling": {
"$ref": "#/definitions/FailureHandlingKind",
"description": "The failure handling strategy of a client if applying the workspace edit\nfails."
},
"resourceOperations": {
"description": "The resource operations the client supports. Clients should at least\nsupport 'create', 'rename' and 'delete' files and folders.",
"items": {
"$ref": "#/definitions/ResourceOperationKind"
},
"type": "array"
}
},
"type": "object"
},
"WorkspaceFolder": {
"additionalProperties": false,
"properties": {
"name": {
"description": "The name of the workspace folder. Used to refer to this\nworkspace folder in thge user interface.",
"type": "string"
},
"uri": {
"description": "The associated URI for this workspace folder.",
"type": "string"
}
},
"required": [
"uri",
"name"
],
"type": "object"
},
"WorkspaceSymbolClientCapabilities": {
"additionalProperties": false,
"description": "Client capabilities for a [WorkspaceSymbolRequest](#WorkspaceSymbolRequest).",
"properties": {
"dynamicRegistration": {
"description": "Symbol request supports dynamic registration.",
"type": "boolean"
},
"symbolKind": {
"additionalProperties": false,
"description": "Specific capabilities for the `SymbolKind` in the `workspace/symbol` request.",
"properties": {
"valueSet": {
"description": "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.",
"items": {
"$ref": "#/definitions/SymbolKind"
},
"type": "array"
}
},
"type": "object"
}
},
"type": "object"
},
"WorkspaceSymbolOptions": {
"additionalProperties": false,
"description": "Server capabilities for a [WorkspaceSymbolRequest](#WorkspaceSymbolRequest).",
"properties": {
"workDoneProgress": {
"type": "boolean"
}
},
"type": "object"
},
"WorkspaceSymbolParams": {
"additionalProperties": false,
"description": "The parameters of a [WorkspaceSymbolRequest](#WorkspaceSymbolRequest).",
"properties": {
"partialResultToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report partial results (e.g. streaming) to\nthe client."
},
"query": {
"description": "A query string to filter symbols by. Clients may send an empty\nstring here to request all symbols.",
"type": "string"
},
"workDoneToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report work done progress."
}
},
"required": [
"query"
],
"type": "object"
},
"WorkspaceSymbolRegistrationOptions": {
"additionalProperties": false,
"description": "Registration options for a [WorkspaceSymbolRequest](#WorkspaceSymbolRequest).",
"properties": {
"workDoneProgress": {
"type": "boolean"
}
},
"type": "object"
},
"_ClientCapabilities": {
"additionalProperties": false,
"description": "Defines the capabilities provided by the client.",
"properties": {
"experimental": {
"description": "Experimental client capabilities."
},
"textDocument": {
"$ref": "#/definitions/TextDocumentClientCapabilities",
"description": "Text document specific client capabilities."
},
"window": {
"description": "Window specific client capabilities.",
"type": "object"
},
"workspace": {
"$ref": "#/definitions/WorkspaceClientCapabilities",
"description": "Workspace specific client capabilities."
}
},
"type": "object"
},
"_InitializeParams": {
"additionalProperties": false,
"description": "The initialize parameters",
"properties": {
"capabilities": {
"$ref": "#/definitions/ClientCapabilities",
"description": "The capabilities provided by the client (editor or tool)"
},
"clientInfo": {
"additionalProperties": false,
"description": "Information about the client",
"properties": {
"name": {
"description": "The name of the client as defined by the client.",
"type": "string"
},
"version": {
"description": "The client's version as defined by the client.",
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
},
"initializationOptions": {
"description": "User provided initialization options."
},
"processId": {
"description": "The process Id of the parent process that started\nthe server.",
"type": [
"number",
"null"
]
},
"rootPath": {
"description": "The rootPath of the workspace. Is null\nif no folder is open.",
"type": [
"string",
"null"
]
},
"rootUri": {
"anyOf": [
{
"$ref": "#/definitions/DocumentUri"
},
{
"type": "null"
}
],
"description": "The rootUri of the workspace. Is null if no\nfolder is open. If both `rootPath` and `rootUri` are set\n`rootUri` wins."
},
"trace": {
"description": "The initial trace setting. If omitted trace is disabled ('off').",
"enum": [
"off",
"messages",
"verbose"
],
"type": "string"
},
"workDoneToken": {
"$ref": "#/definitions/ProgressToken",
"description": "An optional token that a server can use to report work done progress."
}
},
"required": [
"processId",
"rootUri",
"capabilities"
],
"type": "object"
}
}
},
"text/plain": [
"<IPython.core.display.JSON object>"
]
},
"execution_count": 8,
"metadata": {
"application/json": {
"expanded": false,
"root": "root"
}
},
"output_type": "execute_result"
}
],
"source": [
"naive_schema = json.loads(pathlib.Path(\"naive.protocol.schema.json\").read_text())\n",
"IPython.display.JSON(naive_schema)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"> If you are reading this statically, don't worry, there will be schema to read later..."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Exploring the Spec\n",
"\n",
"To validate the robustness of combining the two parsed structures, we'll transform the raw markdown into a tabular format. First we break up the markdown with regexen."
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead tr th {\n",
" text-align: left;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr>\n",
" <th>type</th>\n",
" <th colspan=\"10\" halign=\"left\">โ†ฉ๏ธ</th>\n",
" <th>...</th>\n",
" <th colspan=\"5\" halign=\"left\">โžก๏ธ</th>\n",
" <th>โžก๏ธ โฌ…๏ธ</th>\n",
" <th colspan=\"4\" halign=\"left\">โฌ…๏ธ</th>\n",
" </tr>\n",
" <tr>\n",
" <th>method</th>\n",
" <th>codeLens/resolve</th>\n",
" <th>completionItem/resolve</th>\n",
" <th>documentLink/resolve</th>\n",
" <th>initialize</th>\n",
" <th>shutdown</th>\n",
" <th>textDocument/codeAction</th>\n",
" <th>textDocument/codeLens</th>\n",
" <th>textDocument/colorPresentation</th>\n",
" <th>textDocument/completion</th>\n",
" <th>textDocument/declaration</th>\n",
" <th>...</th>\n",
" <th>textDocument/didSave</th>\n",
" <th>textDocument/willSave</th>\n",
" <th>workspace/didChangeConfiguration</th>\n",
" <th>workspace/didChangeWatchedFiles</th>\n",
" <th>workspace/didChangeWorkspaceFolders</th>\n",
" <th>$/cancelRequest</th>\n",
" <th>telemetry/event</th>\n",
" <th>textDocument/publishDiagnostics</th>\n",
" <th>window/logMessage</th>\n",
" <th>window/showMessage</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>_raw_error</th>\n",
" <td>code and message set in case an exception happ...</td>\n",
" <td>code and message set in case an exception happ...</td>\n",
" <td>code and message set in case an exception happ...</td>\n",
" <td>None</td>\n",
" <td>code and message set in case an exception happ...</td>\n",
" <td>code and message set in case an exception happ...</td>\n",
" <td>code and message set in case an exception happ...</td>\n",
" <td>code and message set in case an exception happ...</td>\n",
" <td>code and message set in case an exception happ...</td>\n",
" <td>code and message set in case an exception happ...</td>\n",
" <td>...</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>title</th>\n",
" <td>Code Lens Resolve Request</td>\n",
" <td>Completion Item Resolve Request</td>\n",
" <td>Document Link Resolve Request</td>\n",
" <td>Initialize Request</td>\n",
" <td>Shutdown Request</td>\n",
" <td>Code Action Request</td>\n",
" <td>Code Lens Request</td>\n",
" <td>Color Presentation Request</td>\n",
" <td>Completion Request</td>\n",
" <td>Goto Declaration Request</td>\n",
" <td>...</td>\n",
" <td>DidSaveTextDocument Notification</td>\n",
" <td>WillSaveTextDocument Notification</td>\n",
" <td>DidChangeConfiguration Notification</td>\n",
" <td>DidChangeWatchedFiles Notification</td>\n",
" <td>DidChangeWorkspaceFolders Notification</td>\n",
" <td>Cancellation Support</td>\n",
" <td>Telemetry Notification</td>\n",
" <td>PublishDiagnostics Notification</td>\n",
" <td>LogMessage Notification</td>\n",
" <td>ShowMessage Notification</td>\n",
" </tr>\n",
" <tr>\n",
" <th>_raw_params</th>\n",
" <td>`CodeLens`</td>\n",
" <td>`CompletionItem`</td>\n",
" <td>`DocumentLink`</td>\n",
" <td>`InitializeParams` defined as follows:</td>\n",
" <td>void</td>\n",
" <td>`CodeActionParams` defined as follows:</td>\n",
" <td>`CodeLensParams` defined as follows:</td>\n",
" <td>`ColorPresentationParams` defined as follows</td>\n",
" <td>`CompletionParams` defined as follows:</td>\n",
" <td>[`TextDocumentPositionParams`](#textdocumentpo...</td>\n",
" <td>...</td>\n",
" <td>`DidSaveTextDocumentParams` defined as follows:</td>\n",
" <td>`WillSaveTextDocumentParams` defined as follows:</td>\n",
" <td>`DidChangeConfigurationParams` defined as foll...</td>\n",
" <td>`DidChangeWatchedFilesParams` defined as follows:</td>\n",
" <td>`DidChangeWorkspaceFoldersParams` defined as f...</td>\n",
" <td>`CancelParams` defined as follows:</td>\n",
" <td>'any'</td>\n",
" <td>`PublishDiagnosticsParams` defined as follows:</td>\n",
" <td>`LogMessageParams` defined as follows:</td>\n",
" <td>`ShowMessageParams` defined as follows:</td>\n",
" </tr>\n",
" <tr>\n",
" <th>_raw_result</th>\n",
" <td>`CodeLens`</td>\n",
" <td>`CompletionItem`</td>\n",
" <td>`DocumentLink`</td>\n",
" <td>`InitializeResult` defined as follows:</td>\n",
" <td>null</td>\n",
" <td>`(Command | CodeAction)[]` \\| `null` where `Co...</td>\n",
" <td>`CodeLens[]` \\| `null` defined as follows:</td>\n",
" <td>`ColorPresentation[]` defined as follows:</td>\n",
" <td>`CompletionItem[]` \\| `CompletionList` \\| `nul...</td>\n",
" <td>[`Location`](#location) \\| [`Location`](#locat...</td>\n",
" <td>...</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>4 rows ร— 50 columns</p>\n",
"</div>"
],
"text/plain": [
"type โ†ฉ๏ธ \\\n",
"method codeLens/resolve \n",
"_raw_error code and message set in case an exception happ... \n",
"title Code Lens Resolve Request \n",
"_raw_params `CodeLens` \n",
"_raw_result `CodeLens` \n",
"\n",
"type \\\n",
"method completionItem/resolve \n",
"_raw_error code and message set in case an exception happ... \n",
"title Completion Item Resolve Request \n",
"_raw_params `CompletionItem` \n",
"_raw_result `CompletionItem` \n",
"\n",
"type \\\n",
"method documentLink/resolve \n",
"_raw_error code and message set in case an exception happ... \n",
"title Document Link Resolve Request \n",
"_raw_params `DocumentLink` \n",
"_raw_result `DocumentLink` \n",
"\n",
"type \\\n",
"method initialize \n",
"_raw_error None \n",
"title Initialize Request \n",
"_raw_params `InitializeParams` defined as follows: \n",
"_raw_result `InitializeResult` defined as follows: \n",
"\n",
"type \\\n",
"method shutdown \n",
"_raw_error code and message set in case an exception happ... \n",
"title Shutdown Request \n",
"_raw_params void \n",
"_raw_result null \n",
"\n",
"type \\\n",
"method textDocument/codeAction \n",
"_raw_error code and message set in case an exception happ... \n",
"title Code Action Request \n",
"_raw_params `CodeActionParams` defined as follows: \n",
"_raw_result `(Command | CodeAction)[]` \\| `null` where `Co... \n",
"\n",
"type \\\n",
"method textDocument/codeLens \n",
"_raw_error code and message set in case an exception happ... \n",
"title Code Lens Request \n",
"_raw_params `CodeLensParams` defined as follows: \n",
"_raw_result `CodeLens[]` \\| `null` defined as follows: \n",
"\n",
"type \\\n",
"method textDocument/colorPresentation \n",
"_raw_error code and message set in case an exception happ... \n",
"title Color Presentation Request \n",
"_raw_params `ColorPresentationParams` defined as follows \n",
"_raw_result `ColorPresentation[]` defined as follows: \n",
"\n",
"type \\\n",
"method textDocument/completion \n",
"_raw_error code and message set in case an exception happ... \n",
"title Completion Request \n",
"_raw_params `CompletionParams` defined as follows: \n",
"_raw_result `CompletionItem[]` \\| `CompletionList` \\| `nul... \n",
"\n",
"type ... \\\n",
"method textDocument/declaration ... \n",
"_raw_error code and message set in case an exception happ... ... \n",
"title Goto Declaration Request ... \n",
"_raw_params [`TextDocumentPositionParams`](#textdocumentpo... ... \n",
"_raw_result [`Location`](#location) \\| [`Location`](#locat... ... \n",
"\n",
"type โžก๏ธ \\\n",
"method textDocument/didSave \n",
"_raw_error None \n",
"title DidSaveTextDocument Notification \n",
"_raw_params `DidSaveTextDocumentParams` defined as follows: \n",
"_raw_result None \n",
"\n",
"type \\\n",
"method textDocument/willSave \n",
"_raw_error None \n",
"title WillSaveTextDocument Notification \n",
"_raw_params `WillSaveTextDocumentParams` defined as follows: \n",
"_raw_result None \n",
"\n",
"type \\\n",
"method workspace/didChangeConfiguration \n",
"_raw_error None \n",
"title DidChangeConfiguration Notification \n",
"_raw_params `DidChangeConfigurationParams` defined as foll... \n",
"_raw_result None \n",
"\n",
"type \\\n",
"method workspace/didChangeWatchedFiles \n",
"_raw_error None \n",
"title DidChangeWatchedFiles Notification \n",
"_raw_params `DidChangeWatchedFilesParams` defined as follows: \n",
"_raw_result None \n",
"\n",
"type \\\n",
"method workspace/didChangeWorkspaceFolders \n",
"_raw_error None \n",
"title DidChangeWorkspaceFolders Notification \n",
"_raw_params `DidChangeWorkspaceFoldersParams` defined as f... \n",
"_raw_result None \n",
"\n",
"type โžก๏ธ โฌ…๏ธ โฌ…๏ธ \\\n",
"method $/cancelRequest telemetry/event \n",
"_raw_error None None \n",
"title Cancellation Support Telemetry Notification \n",
"_raw_params `CancelParams` defined as follows: 'any' \n",
"_raw_result None None \n",
"\n",
"type \\\n",
"method textDocument/publishDiagnostics \n",
"_raw_error None \n",
"title PublishDiagnostics Notification \n",
"_raw_params `PublishDiagnosticsParams` defined as follows: \n",
"_raw_result None \n",
"\n",
"type \\\n",
"method window/logMessage \n",
"_raw_error None \n",
"title LogMessage Notification \n",
"_raw_params `LogMessageParams` defined as follows: \n",
"_raw_result None \n",
"\n",
"type \n",
"method window/showMessage \n",
"_raw_error None \n",
"title ShowMessage Notification \n",
"_raw_params `ShowMessageParams` defined as follows: \n",
"_raw_result None \n",
"\n",
"[4 rows x 50 columns]"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df = pandas.DataFrame(md_features, columns=[\"_md\"])\n",
"md = df[\"_md\"]\n",
"df[\"method\"] = md.apply(lambda md: re.findall(r\"\"\"\\* method: '(.*)'\"\"\", md)[0])\n",
"df[\"_raw_params\"] = md.apply(lambda md: re.findall(r\"\"\"\\* params: (.*)\"\"\", md)[0])\n",
"df[\"title\"] = md.apply(lambda md: md.split(\">\")[1].split(\"<\")[0].strip().split(\"(\")[0].strip())\n",
"df[\"type\"] = md.apply(lambda md: pyemojify.emojify(md.split(\">\")[1].split(\"<\")[0].strip().split(\"(\")[1]).replace(\")\",\"\").strip())\n",
"df[\"_raw_result\"] = md.apply(lambda md: (re.findall(r\"\"\"\\* result: (.*)\"\"\", md, flags=re.M | re.I) or [None])[0])\n",
"df[\"_raw_error\"] = md.apply(lambda md: (re.findall(r\"\"\"\\* error: (.*)\"\"\", md, flags=re.M | re.I) or [None])[0])\n",
"df = df.sort_values([\"type\", \"method\"]).set_index([\"type\", \"method\"])\n",
"df[set(df.columns) - set([\"_md\"])].T"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We'd like some better types structure."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Results are more complicated, typographically, so we'll wait until we have the schema."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Joining to Schema\n",
"Perhaps we can use what we got from the naive schema..."
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
"def parse_params(rp, p, schema):\n",
" if p in schema[\"definitions\"]:\n",
" return schema[\"definitions\"][p]\n",
" if rp in ['void', 'none']:\n",
" return {\"type\": \"null\"}\n",
" if rp in [\"'any'\"]:\n",
" return {}\n",
" return None"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
"df[\"params\"] = df[\"_raw_params\"].apply(lambda rp: (re.findall(r'`(.*?)`', rp) or [None])[0])"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead tr th {\n",
" text-align: left;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr>\n",
" <th>type</th>\n",
" <th colspan=\"10\" halign=\"left\">โ†ฉ๏ธ</th>\n",
" <th>...</th>\n",
" <th colspan=\"5\" halign=\"left\">โžก๏ธ</th>\n",
" <th>โžก๏ธ โฌ…๏ธ</th>\n",
" <th colspan=\"4\" halign=\"left\">โฌ…๏ธ</th>\n",
" </tr>\n",
" <tr>\n",
" <th>method</th>\n",
" <th>codeLens/resolve</th>\n",
" <th>completionItem/resolve</th>\n",
" <th>documentLink/resolve</th>\n",
" <th>initialize</th>\n",
" <th>shutdown</th>\n",
" <th>textDocument/codeAction</th>\n",
" <th>textDocument/codeLens</th>\n",
" <th>textDocument/colorPresentation</th>\n",
" <th>textDocument/completion</th>\n",
" <th>textDocument/declaration</th>\n",
" <th>...</th>\n",
" <th>textDocument/didSave</th>\n",
" <th>textDocument/willSave</th>\n",
" <th>workspace/didChangeConfiguration</th>\n",
" <th>workspace/didChangeWatchedFiles</th>\n",
" <th>workspace/didChangeWorkspaceFolders</th>\n",
" <th>$/cancelRequest</th>\n",
" <th>telemetry/event</th>\n",
" <th>textDocument/publishDiagnostics</th>\n",
" <th>window/logMessage</th>\n",
" <th>window/showMessage</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>params_schema</th>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>{'additionalProperties': False, 'properties': ...</td>\n",
" <td>{'type': 'null'}</td>\n",
" <td>{'additionalProperties': False, 'description':...</td>\n",
" <td>{'additionalProperties': False, 'description':...</td>\n",
" <td>None</td>\n",
" <td>{'additionalProperties': False, 'description':...</td>\n",
" <td>{'additionalProperties': False, 'description':...</td>\n",
" <td>...</td>\n",
" <td>{'additionalProperties': False, 'description':...</td>\n",
" <td>{'additionalProperties': False, 'description':...</td>\n",
" <td>{'additionalProperties': False, 'description':...</td>\n",
" <td>{'additionalProperties': False, 'description':...</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>{}</td>\n",
" <td>{'additionalProperties': False, 'description':...</td>\n",
" <td>{'additionalProperties': False, 'description':...</td>\n",
" <td>{'additionalProperties': False, 'description':...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>params</th>\n",
" <td>CodeLens</td>\n",
" <td>CompletionItem</td>\n",
" <td>DocumentLink</td>\n",
" <td>InitializeParams</td>\n",
" <td>None</td>\n",
" <td>CodeActionParams</td>\n",
" <td>CodeLensParams</td>\n",
" <td>ColorPresentationParams</td>\n",
" <td>CompletionParams</td>\n",
" <td>TextDocumentPositionParams</td>\n",
" <td>...</td>\n",
" <td>DidSaveTextDocumentParams</td>\n",
" <td>WillSaveTextDocumentParams</td>\n",
" <td>DidChangeConfigurationParams</td>\n",
" <td>DidChangeWatchedFilesParams</td>\n",
" <td>DidChangeWorkspaceFoldersParams</td>\n",
" <td>CancelParams</td>\n",
" <td>None</td>\n",
" <td>PublishDiagnosticsParams</td>\n",
" <td>LogMessageParams</td>\n",
" <td>ShowMessageParams</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>2 rows ร— 50 columns</p>\n",
"</div>"
],
"text/plain": [
"type โ†ฉ๏ธ \\\n",
"method codeLens/resolve completionItem/resolve documentLink/resolve \n",
"params_schema None None None \n",
"params CodeLens CompletionItem DocumentLink \n",
"\n",
"type \\\n",
"method initialize \n",
"params_schema {'additionalProperties': False, 'properties': ... \n",
"params InitializeParams \n",
"\n",
"type \\\n",
"method shutdown \n",
"params_schema {'type': 'null'} \n",
"params None \n",
"\n",
"type \\\n",
"method textDocument/codeAction \n",
"params_schema {'additionalProperties': False, 'description':... \n",
"params CodeActionParams \n",
"\n",
"type \\\n",
"method textDocument/codeLens \n",
"params_schema {'additionalProperties': False, 'description':... \n",
"params CodeLensParams \n",
"\n",
"type \\\n",
"method textDocument/colorPresentation \n",
"params_schema None \n",
"params ColorPresentationParams \n",
"\n",
"type \\\n",
"method textDocument/completion \n",
"params_schema {'additionalProperties': False, 'description':... \n",
"params CompletionParams \n",
"\n",
"type ... \\\n",
"method textDocument/declaration ... \n",
"params_schema {'additionalProperties': False, 'description':... ... \n",
"params TextDocumentPositionParams ... \n",
"\n",
"type โžก๏ธ \\\n",
"method textDocument/didSave \n",
"params_schema {'additionalProperties': False, 'description':... \n",
"params DidSaveTextDocumentParams \n",
"\n",
"type \\\n",
"method textDocument/willSave \n",
"params_schema {'additionalProperties': False, 'description':... \n",
"params WillSaveTextDocumentParams \n",
"\n",
"type \\\n",
"method workspace/didChangeConfiguration \n",
"params_schema {'additionalProperties': False, 'description':... \n",
"params DidChangeConfigurationParams \n",
"\n",
"type \\\n",
"method workspace/didChangeWatchedFiles \n",
"params_schema {'additionalProperties': False, 'description':... \n",
"params DidChangeWatchedFilesParams \n",
"\n",
"type โžก๏ธ โฌ…๏ธ \\\n",
"method workspace/didChangeWorkspaceFolders $/cancelRequest \n",
"params_schema None None \n",
"params DidChangeWorkspaceFoldersParams CancelParams \n",
"\n",
"type โฌ…๏ธ \\\n",
"method telemetry/event \n",
"params_schema {} \n",
"params None \n",
"\n",
"type \\\n",
"method textDocument/publishDiagnostics \n",
"params_schema {'additionalProperties': False, 'description':... \n",
"params PublishDiagnosticsParams \n",
"\n",
"type \\\n",
"method window/logMessage \n",
"params_schema {'additionalProperties': False, 'description':... \n",
"params LogMessageParams \n",
"\n",
"type \n",
"method window/showMessage \n",
"params_schema {'additionalProperties': False, 'description':... \n",
"params ShowMessageParams \n",
"\n",
"[2 rows x 50 columns]"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df[\"params_schema\"] = [\n",
" parse_params(row[\"_raw_params\"], row[\"params\"], naive_schema)\n",
" for row in df[[\"_raw_params\", \"params\"]].to_dict(orient=\"records\")\n",
"]\n",
"df[[\"params_schema\", \"params\"]].T"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
"def parse_results(rr):\n",
" if rr in [None]:\n",
" return rr\n",
" r = (\n",
" rr.replace(\"defined as follows:\", \"\")\n",
" .replace(\"`\", \"\")\n",
" .replace(\"the selected\", \"\")\n",
" .replace(r\"\\|\", \"|\")\n",
" .replace(\"An array of DocumentLink\", \"DocumentLink[]\")\n",
" )\n",
" r = re.sub(r\"\\[(.*?)\\]\\(#.+\\)\", \"\\\\1\", r).strip()\n",
" for splitter in [' where ', ' describing ', ' as defined ', '. ', ' if ']:\n",
" r = r.split(splitter)[0].strip()\n",
" if r.endswith('.'):\n",
" r = r[:-1]\n",
" return r\n",
"df[\"result\"] = df[\"_raw_result\"].apply(lambda rr: parse_results(rr))"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th></th>\n",
" <th>_raw_result</th>\n",
" <th>result</th>\n",
" </tr>\n",
" <tr>\n",
" <th>type</th>\n",
" <th>method</th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th rowspan=\"29\" valign=\"top\">โ†ฉ๏ธ</th>\n",
" <th>codeLens/resolve</th>\n",
" <td>`CodeLens`</td>\n",
" <td>CodeLens</td>\n",
" </tr>\n",
" <tr>\n",
" <th>completionItem/resolve</th>\n",
" <td>`CompletionItem`</td>\n",
" <td>CompletionItem</td>\n",
" </tr>\n",
" <tr>\n",
" <th>documentLink/resolve</th>\n",
" <td>`DocumentLink`</td>\n",
" <td>DocumentLink</td>\n",
" </tr>\n",
" <tr>\n",
" <th>initialize</th>\n",
" <td>`InitializeResult` defined as follows:</td>\n",
" <td>InitializeResult</td>\n",
" </tr>\n",
" <tr>\n",
" <th>shutdown</th>\n",
" <td>null</td>\n",
" <td>null</td>\n",
" </tr>\n",
" <tr>\n",
" <th>textDocument/codeAction</th>\n",
" <td>`(Command | CodeAction)[]` \\| `null` where `Co...</td>\n",
" <td>(Command | CodeAction)[] | null</td>\n",
" </tr>\n",
" <tr>\n",
" <th>textDocument/codeLens</th>\n",
" <td>`CodeLens[]` \\| `null` defined as follows:</td>\n",
" <td>CodeLens[] | null</td>\n",
" </tr>\n",
" <tr>\n",
" <th>textDocument/colorPresentation</th>\n",
" <td>`ColorPresentation[]` defined as follows:</td>\n",
" <td>ColorPresentation[]</td>\n",
" </tr>\n",
" <tr>\n",
" <th>textDocument/completion</th>\n",
" <td>`CompletionItem[]` \\| `CompletionList` \\| `nul...</td>\n",
" <td>CompletionItem[] | CompletionList | null</td>\n",
" </tr>\n",
" <tr>\n",
" <th>textDocument/declaration</th>\n",
" <td>[`Location`](#location) \\| [`Location`](#locat...</td>\n",
" <td>Location[] |null</td>\n",
" </tr>\n",
" <tr>\n",
" <th>textDocument/definition</th>\n",
" <td>[`Location`](#location) \\| [`Location`](#locat...</td>\n",
" <td>Location[] | null</td>\n",
" </tr>\n",
" <tr>\n",
" <th>textDocument/documentColor</th>\n",
" <td>`ColorInformation[]` defined as follows:</td>\n",
" <td>ColorInformation[]</td>\n",
" </tr>\n",
" <tr>\n",
" <th>textDocument/documentHighlight</th>\n",
" <td>`DocumentHighlight[]` \\| `null` defined as fol...</td>\n",
" <td>DocumentHighlight[] | null</td>\n",
" </tr>\n",
" <tr>\n",
" <th>textDocument/documentLink</th>\n",
" <td>An array of `DocumentLink` \\| `null`.</td>\n",
" <td>DocumentLink[] | null</td>\n",
" </tr>\n",
" <tr>\n",
" <th>textDocument/documentSymbol</th>\n",
" <td>`DocumentSymbol[]` \\| `SymbolInformation[]` \\|...</td>\n",
" <td>DocumentSymbol[] | SymbolInformation[] | null</td>\n",
" </tr>\n",
" <tr>\n",
" <th>textDocument/foldingRange</th>\n",
" <td>`FoldingRange[] | null` defined as follows:</td>\n",
" <td>FoldingRange[] | null</td>\n",
" </tr>\n",
" <tr>\n",
" <th>textDocument/formatting</th>\n",
" <td>[`TextEdit[]`](#textedit) \\| `null` describing...</td>\n",
" <td>TextEdit[] | null</td>\n",
" </tr>\n",
" <tr>\n",
" <th>textDocument/hover</th>\n",
" <td>`Hover` \\| `null` defined as follows:</td>\n",
" <td>Hover | null</td>\n",
" </tr>\n",
" <tr>\n",
" <th>textDocument/implementation</th>\n",
" <td>[`Location`](#location) \\| [`Location`](#locat...</td>\n",
" <td>Location[] | null</td>\n",
" </tr>\n",
" <tr>\n",
" <th>textDocument/onTypeFormatting</th>\n",
" <td>[`TextEdit[]`](#textedit) \\| `null` describing...</td>\n",
" <td>TextEdit[] | null</td>\n",
" </tr>\n",
" <tr>\n",
" <th>textDocument/prepareRename</th>\n",
" <td>[`Range`](#range) \\| `{ range: Range, placehol...</td>\n",
" <td>Range | { range: Range, placeholder: string } ...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>textDocument/rangeFormatting</th>\n",
" <td>[`TextEdit[]`](#textedit) \\| `null` describing...</td>\n",
" <td>TextEdit[] | null</td>\n",
" </tr>\n",
" <tr>\n",
" <th>textDocument/references</th>\n",
" <td>[`Location`](#location)[] \\| `null`</td>\n",
" <td>Location[] | null</td>\n",
" </tr>\n",
" <tr>\n",
" <th>textDocument/rename</th>\n",
" <td>[`WorkspaceEdit`](#workspaceedit) \\| `null` de...</td>\n",
" <td>WorkspaceEdit | null</td>\n",
" </tr>\n",
" <tr>\n",
" <th>textDocument/signatureHelp</th>\n",
" <td>`SignatureHelp` \\| `null` defined as follows:</td>\n",
" <td>SignatureHelp | null</td>\n",
" </tr>\n",
" <tr>\n",
" <th>textDocument/typeDefinition</th>\n",
" <td>[`Location`](#location) \\| [`Location`](#locat...</td>\n",
" <td>Location[] | null</td>\n",
" </tr>\n",
" <tr>\n",
" <th>textDocument/willSaveWaitUntil</th>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>workspace/executeCommand</th>\n",
" <td>`any` \\| `null`</td>\n",
" <td>any | null</td>\n",
" </tr>\n",
" <tr>\n",
" <th>workspace/symbol</th>\n",
" <td>`SymbolInformation[]` \\| `null` as defined above.</td>\n",
" <td>SymbolInformation[] | null</td>\n",
" </tr>\n",
" <tr>\n",
" <th rowspan=\"6\" valign=\"top\">โ†ช๏ธ</th>\n",
" <th>client/registerCapability</th>\n",
" <td>void.</td>\n",
" <td>void</td>\n",
" </tr>\n",
" <tr>\n",
" <th>client/unregisterCapability</th>\n",
" <td>void.</td>\n",
" <td>void</td>\n",
" </tr>\n",
" <tr>\n",
" <th>window/showMessageRequest</th>\n",
" <td>the selected `MessageActionItem` \\| `null` if ...</td>\n",
" <td>MessageActionItem | null</td>\n",
" </tr>\n",
" <tr>\n",
" <th>workspace/applyEdit</th>\n",
" <td>`ApplyWorkspaceEditResponse` defined as follows:</td>\n",
" <td>ApplyWorkspaceEditResponse</td>\n",
" </tr>\n",
" <tr>\n",
" <th>workspace/configuration</th>\n",
" <td>any[]</td>\n",
" <td>any[]</td>\n",
" </tr>\n",
" <tr>\n",
" <th>workspace/workspaceFolders</th>\n",
" <td>`WorkspaceFolder[] | null` defined as follows:</td>\n",
" <td>WorkspaceFolder[] | null</td>\n",
" </tr>\n",
" <tr>\n",
" <th rowspan=\"10\" valign=\"top\">โžก๏ธ</th>\n",
" <th>exit</th>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>initialized</th>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>textDocument/didChange</th>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>textDocument/didClose</th>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>textDocument/didOpen</th>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>textDocument/didSave</th>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>textDocument/willSave</th>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>workspace/didChangeConfiguration</th>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>workspace/didChangeWatchedFiles</th>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>workspace/didChangeWorkspaceFolders</th>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>โžก๏ธ โฌ…๏ธ</th>\n",
" <th>$/cancelRequest</th>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th rowspan=\"4\" valign=\"top\">โฌ…๏ธ</th>\n",
" <th>telemetry/event</th>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>textDocument/publishDiagnostics</th>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>window/logMessage</th>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>window/showMessage</th>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" _raw_result \\\n",
"type method \n",
"โ†ฉ๏ธ codeLens/resolve `CodeLens` \n",
" completionItem/resolve `CompletionItem` \n",
" documentLink/resolve `DocumentLink` \n",
" initialize `InitializeResult` defined as follows: \n",
" shutdown null \n",
" textDocument/codeAction `(Command | CodeAction)[]` \\| `null` where `Co... \n",
" textDocument/codeLens `CodeLens[]` \\| `null` defined as follows: \n",
" textDocument/colorPresentation `ColorPresentation[]` defined as follows: \n",
" textDocument/completion `CompletionItem[]` \\| `CompletionList` \\| `nul... \n",
" textDocument/declaration [`Location`](#location) \\| [`Location`](#locat... \n",
" textDocument/definition [`Location`](#location) \\| [`Location`](#locat... \n",
" textDocument/documentColor `ColorInformation[]` defined as follows: \n",
" textDocument/documentHighlight `DocumentHighlight[]` \\| `null` defined as fol... \n",
" textDocument/documentLink An array of `DocumentLink` \\| `null`. \n",
" textDocument/documentSymbol `DocumentSymbol[]` \\| `SymbolInformation[]` \\|... \n",
" textDocument/foldingRange `FoldingRange[] | null` defined as follows: \n",
" textDocument/formatting [`TextEdit[]`](#textedit) \\| `null` describing... \n",
" textDocument/hover `Hover` \\| `null` defined as follows: \n",
" textDocument/implementation [`Location`](#location) \\| [`Location`](#locat... \n",
" textDocument/onTypeFormatting [`TextEdit[]`](#textedit) \\| `null` describing... \n",
" textDocument/prepareRename [`Range`](#range) \\| `{ range: Range, placehol... \n",
" textDocument/rangeFormatting [`TextEdit[]`](#textedit) \\| `null` describing... \n",
" textDocument/references [`Location`](#location)[] \\| `null` \n",
" textDocument/rename [`WorkspaceEdit`](#workspaceedit) \\| `null` de... \n",
" textDocument/signatureHelp `SignatureHelp` \\| `null` defined as follows: \n",
" textDocument/typeDefinition [`Location`](#location) \\| [`Location`](#locat... \n",
" textDocument/willSaveWaitUntil None \n",
" workspace/executeCommand `any` \\| `null` \n",
" workspace/symbol `SymbolInformation[]` \\| `null` as defined above. \n",
"โ†ช๏ธ client/registerCapability void. \n",
" client/unregisterCapability void. \n",
" window/showMessageRequest the selected `MessageActionItem` \\| `null` if ... \n",
" workspace/applyEdit `ApplyWorkspaceEditResponse` defined as follows: \n",
" workspace/configuration any[] \n",
" workspace/workspaceFolders `WorkspaceFolder[] | null` defined as follows: \n",
"โžก๏ธ exit None \n",
" initialized None \n",
" textDocument/didChange None \n",
" textDocument/didClose None \n",
" textDocument/didOpen None \n",
" textDocument/didSave None \n",
" textDocument/willSave None \n",
" workspace/didChangeConfiguration None \n",
" workspace/didChangeWatchedFiles None \n",
" workspace/didChangeWorkspaceFolders None \n",
"โžก๏ธ โฌ…๏ธ $/cancelRequest None \n",
"โฌ…๏ธ telemetry/event None \n",
" textDocument/publishDiagnostics None \n",
" window/logMessage None \n",
" window/showMessage None \n",
"\n",
" result \n",
"type method \n",
"โ†ฉ๏ธ codeLens/resolve CodeLens \n",
" completionItem/resolve CompletionItem \n",
" documentLink/resolve DocumentLink \n",
" initialize InitializeResult \n",
" shutdown null \n",
" textDocument/codeAction (Command | CodeAction)[] | null \n",
" textDocument/codeLens CodeLens[] | null \n",
" textDocument/colorPresentation ColorPresentation[] \n",
" textDocument/completion CompletionItem[] | CompletionList | null \n",
" textDocument/declaration Location[] |null \n",
" textDocument/definition Location[] | null \n",
" textDocument/documentColor ColorInformation[] \n",
" textDocument/documentHighlight DocumentHighlight[] | null \n",
" textDocument/documentLink DocumentLink[] | null \n",
" textDocument/documentSymbol DocumentSymbol[] | SymbolInformation[] | null \n",
" textDocument/foldingRange FoldingRange[] | null \n",
" textDocument/formatting TextEdit[] | null \n",
" textDocument/hover Hover | null \n",
" textDocument/implementation Location[] | null \n",
" textDocument/onTypeFormatting TextEdit[] | null \n",
" textDocument/prepareRename Range | { range: Range, placeholder: string } ... \n",
" textDocument/rangeFormatting TextEdit[] | null \n",
" textDocument/references Location[] | null \n",
" textDocument/rename WorkspaceEdit | null \n",
" textDocument/signatureHelp SignatureHelp | null \n",
" textDocument/typeDefinition Location[] | null \n",
" textDocument/willSaveWaitUntil None \n",
" workspace/executeCommand any | null \n",
" workspace/symbol SymbolInformation[] | null \n",
"โ†ช๏ธ client/registerCapability void \n",
" client/unregisterCapability void \n",
" window/showMessageRequest MessageActionItem | null \n",
" workspace/applyEdit ApplyWorkspaceEditResponse \n",
" workspace/configuration any[] \n",
" workspace/workspaceFolders WorkspaceFolder[] | null \n",
"โžก๏ธ exit None \n",
" initialized None \n",
" textDocument/didChange None \n",
" textDocument/didClose None \n",
" textDocument/didOpen None \n",
" textDocument/didSave None \n",
" textDocument/willSave None \n",
" workspace/didChangeConfiguration None \n",
" workspace/didChangeWatchedFiles None \n",
" workspace/didChangeWorkspaceFolders None \n",
"โžก๏ธ โฌ…๏ธ $/cancelRequest None \n",
"โฌ…๏ธ telemetry/event None \n",
" textDocument/publishDiagnostics None \n",
" window/logMessage None \n",
" window/showMessage None "
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df[[\"_raw_result\", \"result\"]]"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CodeLens\n",
"\t['CodeLens']\n",
"CompletionItem\n",
"\t['CompletionItem']\n",
"DocumentLink\n",
"\t['DocumentLink']\n",
"InitializeResult\n",
"\t['InitializeResult']\n",
"(Command | CodeAction)[] | null\n",
"\t['(Command | CodeAction)[] | null']\n",
"CodeLens[] | null\n",
"\t['CodeLens[] | null']\n",
"ColorPresentation[]\n",
"\t['ColorPresentation']\n",
"CompletionItem[] | CompletionList | null\n",
"\t['CompletionItem[] | CompletionList | null']\n",
"Location[] |null\n",
"\t['Location[] |null']\n",
"Location[] | null\n",
"\t['Location[] | null']\n",
"ColorInformation[]\n",
"\t['ColorInformation']\n",
"DocumentHighlight[] | null\n",
"\t['DocumentHighlight[] | null']\n",
"DocumentLink[] | null\n",
"\t['DocumentLink[] | null']\n",
"DocumentSymbol[] | SymbolInformation[] | null\n",
"\t['DocumentSymbol[] | SymbolInformation[] | null']\n",
"FoldingRange[] | null\n",
"\t['FoldingRange[] | null']\n",
"TextEdit[] | null\n",
"\t['TextEdit[] | null']\n",
"Hover | null\n",
"\t['Hover | null']\n",
"Location[] | null\n",
"\t['Location[] | null']\n",
"TextEdit[] | null\n",
"\t['TextEdit[] | null']\n",
"Range | { range: Range, placeholder: string } | null\n",
"\t['Range | { range: Range, placeholder: string } | null']\n",
"TextEdit[] | null\n",
"\t['TextEdit[] | null']\n",
"Location[] | null\n",
"\t['Location[] | null']\n",
"WorkspaceEdit | null\n",
"\t['WorkspaceEdit | null']\n",
"SignatureHelp | null\n",
"\t['SignatureHelp | null']\n",
"Location[] | null\n",
"\t['Location[] | null']\n",
"any | null\n",
"\t['any | null']\n",
"SymbolInformation[] | null\n",
"\t['SymbolInformation[] | null']\n",
"MessageActionItem | null\n",
"\t['MessageActionItem | null']\n",
"any[]\n",
"\t['any']\n",
"WorkspaceFolder[] | null\n",
"\t['WorkspaceFolder[] | null']\n"
]
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead tr th {\n",
" text-align: left;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr>\n",
" <th>type</th>\n",
" <th colspan=\"10\" halign=\"left\">โ†ฉ๏ธ</th>\n",
" <th>...</th>\n",
" <th colspan=\"5\" halign=\"left\">โžก๏ธ</th>\n",
" <th>โžก๏ธ โฌ…๏ธ</th>\n",
" <th colspan=\"4\" halign=\"left\">โฌ…๏ธ</th>\n",
" </tr>\n",
" <tr>\n",
" <th>method</th>\n",
" <th>codeLens/resolve</th>\n",
" <th>completionItem/resolve</th>\n",
" <th>documentLink/resolve</th>\n",
" <th>initialize</th>\n",
" <th>shutdown</th>\n",
" <th>textDocument/codeAction</th>\n",
" <th>textDocument/codeLens</th>\n",
" <th>textDocument/colorPresentation</th>\n",
" <th>textDocument/completion</th>\n",
" <th>textDocument/declaration</th>\n",
" <th>...</th>\n",
" <th>textDocument/didSave</th>\n",
" <th>textDocument/willSave</th>\n",
" <th>workspace/didChangeConfiguration</th>\n",
" <th>workspace/didChangeWatchedFiles</th>\n",
" <th>workspace/didChangeWorkspaceFolders</th>\n",
" <th>$/cancelRequest</th>\n",
" <th>telemetry/event</th>\n",
" <th>textDocument/publishDiagnostics</th>\n",
" <th>window/logMessage</th>\n",
" <th>window/showMessage</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>result</th>\n",
" <td>CodeLens</td>\n",
" <td>CompletionItem</td>\n",
" <td>DocumentLink</td>\n",
" <td>InitializeResult</td>\n",
" <td>null</td>\n",
" <td>(Command | CodeAction)[] | null</td>\n",
" <td>CodeLens[] | null</td>\n",
" <td>ColorPresentation[]</td>\n",
" <td>CompletionItem[] | CompletionList | null</td>\n",
" <td>Location[] |null</td>\n",
" <td>...</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>1 rows ร— 50 columns</p>\n",
"</div>"
],
"text/plain": [
"type โ†ฉ๏ธ \\\n",
"method codeLens/resolve completionItem/resolve documentLink/resolve \n",
"result CodeLens CompletionItem DocumentLink \n",
"\n",
"type \\\n",
"method initialize shutdown textDocument/codeAction \n",
"result InitializeResult null (Command | CodeAction)[] | null \n",
"\n",
"type \\\n",
"method textDocument/codeLens textDocument/colorPresentation \n",
"result CodeLens[] | null ColorPresentation[] \n",
"\n",
"type \\\n",
"method textDocument/completion textDocument/declaration \n",
"result CompletionItem[] | CompletionList | null Location[] |null \n",
"\n",
"type ... โžก๏ธ \\\n",
"method ... textDocument/didSave textDocument/willSave \n",
"result ... None None \n",
"\n",
"type \\\n",
"method workspace/didChangeConfiguration workspace/didChangeWatchedFiles \n",
"result None None \n",
"\n",
"type โžก๏ธ โฌ…๏ธ โฌ…๏ธ \\\n",
"method workspace/didChangeWorkspaceFolders $/cancelRequest telemetry/event \n",
"result None None None \n",
"\n",
"type \n",
"method textDocument/publishDiagnostics window/logMessage window/showMessage \n",
"result None None None \n",
"\n",
"[1 rows x 50 columns]"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"def result_to_schema(r, schema):\n",
" if not r:\n",
" return r\n",
" opts = []\n",
" if r in [\"void\", \"void.\"]:\n",
" return {\"type\": \"null\"}\n",
"\n",
" for sr in [sr.strip() for sr in r.split(\"\\|\")]:\n",
" is_arr = False\n",
" if sr.endswith(\"[]\"):\n",
" is_arr = True\n",
" sr = sr[:-2]\n",
" if sr.startswith(\"null\"):\n",
" sr = {\"type\": \"null\"}\n",
" elif sr.startswith(\"void\"):\n",
" sr = {\"type\": \"null\"}\n",
" elif sr in schema[\"definitions\"]:\n",
" sr = {\"$ref\": f\"#/definitions/{sr}\"}\n",
" if is_arr:\n",
" sr = {\"type\": \"array\", \"items\": sr}\n",
" opts += [sr]\n",
" if str in [type(sr) for sr in opts]:\n",
" print(r)\n",
" print(f\"\\t{opts}\")\n",
" return None\n",
" return {\"oneOf\": opts}\n",
"df[\"result_schema\"] = df[\"result\"].apply(lambda rr: result_to_schema(rr, naive_schema))\n",
"df[[\"result\"]].T"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The remaining things look tedious to parse, but doable. Perhaps there is a better way..."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## What's missing?"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th></th>\n",
" <th>_raw_params</th>\n",
" <th>params</th>\n",
" <th>params_schema</th>\n",
" </tr>\n",
" <tr>\n",
" <th>type</th>\n",
" <th>method</th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th rowspan=\"6\" valign=\"top\">โ†ฉ๏ธ</th>\n",
" <th>codeLens/resolve</th>\n",
" <td>`CodeLens`</td>\n",
" <td>CodeLens</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>completionItem/resolve</th>\n",
" <td>`CompletionItem`</td>\n",
" <td>CompletionItem</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>documentLink/resolve</th>\n",
" <td>`DocumentLink`</td>\n",
" <td>DocumentLink</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>textDocument/colorPresentation</th>\n",
" <td>`ColorPresentationParams` defined as follows</td>\n",
" <td>ColorPresentationParams</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>textDocument/documentColor</th>\n",
" <td>`DocumentColorParams` defined as follows</td>\n",
" <td>DocumentColorParams</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>textDocument/foldingRange</th>\n",
" <td>`FoldingRangeParams` defined as follows</td>\n",
" <td>FoldingRangeParams</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>โ†ช๏ธ</th>\n",
" <th>workspace/configuration</th>\n",
" <td>`ConfigurationParams` defined as follows</td>\n",
" <td>ConfigurationParams</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>โžก๏ธ</th>\n",
" <th>workspace/didChangeWorkspaceFolders</th>\n",
" <td>`DidChangeWorkspaceFoldersParams` defined as f...</td>\n",
" <td>DidChangeWorkspaceFoldersParams</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>โžก๏ธ โฌ…๏ธ</th>\n",
" <th>$/cancelRequest</th>\n",
" <td>`CancelParams` defined as follows:</td>\n",
" <td>CancelParams</td>\n",
" <td>None</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" _raw_params \\\n",
"type method \n",
"โ†ฉ๏ธ codeLens/resolve `CodeLens` \n",
" completionItem/resolve `CompletionItem` \n",
" documentLink/resolve `DocumentLink` \n",
" textDocument/colorPresentation `ColorPresentationParams` defined as follows \n",
" textDocument/documentColor `DocumentColorParams` defined as follows \n",
" textDocument/foldingRange `FoldingRangeParams` defined as follows \n",
"โ†ช๏ธ workspace/configuration `ConfigurationParams` defined as follows \n",
"โžก๏ธ workspace/didChangeWorkspaceFolders `DidChangeWorkspaceFoldersParams` defined as f... \n",
"โžก๏ธ โฌ…๏ธ $/cancelRequest `CancelParams` defined as follows: \n",
"\n",
" params \\\n",
"type method \n",
"โ†ฉ๏ธ codeLens/resolve CodeLens \n",
" completionItem/resolve CompletionItem \n",
" documentLink/resolve DocumentLink \n",
" textDocument/colorPresentation ColorPresentationParams \n",
" textDocument/documentColor DocumentColorParams \n",
" textDocument/foldingRange FoldingRangeParams \n",
"โ†ช๏ธ workspace/configuration ConfigurationParams \n",
"โžก๏ธ workspace/didChangeWorkspaceFolders DidChangeWorkspaceFoldersParams \n",
"โžก๏ธ โฌ…๏ธ $/cancelRequest CancelParams \n",
"\n",
" params_schema \n",
"type method \n",
"โ†ฉ๏ธ codeLens/resolve None \n",
" completionItem/resolve None \n",
" documentLink/resolve None \n",
" textDocument/colorPresentation None \n",
" textDocument/documentColor None \n",
" textDocument/foldingRange None \n",
"โ†ช๏ธ workspace/configuration None \n",
"โžก๏ธ workspace/didChangeWorkspaceFolders None \n",
"โžก๏ธ โฌ…๏ธ $/cancelRequest None "
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df[df[\"params_schema\"].apply(lambda x: x is None)][[\"_raw_params\", \"params\", \"params_schema\"]]"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/weg/Documents/projects/lsp-json-schema/envs/lsp-json-schema/lib/python3.7/site-packages/ipykernel_launcher.py:1: UserWarning: Boolean Series key will be reindexed to match DataFrame index.\n",
" \"\"\"Entry point for launching an IPython kernel.\n"
]
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th></th>\n",
" <th>_raw_result</th>\n",
" <th>result</th>\n",
" </tr>\n",
" <tr>\n",
" <th>type</th>\n",
" <th>method</th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
"Empty DataFrame\n",
"Columns: [_raw_result, result]\n",
"Index: []"
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df[df[\"result\"].apply(lambda x: x is None)][~df[\"_raw_result\"].isnull()][[\"_raw_result\", \"result\"]]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# `protocol-schema.ts`\n",
"\n",
"A straight parsing of `protocol.ts` doesn't yield enough information for the generator to create all the types needed. Before we look any further at brute-forcing a solution, let's create a TypeScript file that includes everything we might need. First, as the feature titles are incosistently narrative, let's make some titles derived from the method names."
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead tr th {\n",
" text-align: left;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr>\n",
" <th>type</th>\n",
" <th colspan=\"10\" halign=\"left\">โ†ฉ๏ธ</th>\n",
" <th>...</th>\n",
" <th colspan=\"5\" halign=\"left\">โžก๏ธ</th>\n",
" <th>โžก๏ธ โฌ…๏ธ</th>\n",
" <th colspan=\"4\" halign=\"left\">โฌ…๏ธ</th>\n",
" </tr>\n",
" <tr>\n",
" <th>method</th>\n",
" <th>codeLens/resolve</th>\n",
" <th>completionItem/resolve</th>\n",
" <th>documentLink/resolve</th>\n",
" <th>initialize</th>\n",
" <th>shutdown</th>\n",
" <th>textDocument/codeAction</th>\n",
" <th>textDocument/codeLens</th>\n",
" <th>textDocument/colorPresentation</th>\n",
" <th>textDocument/completion</th>\n",
" <th>textDocument/declaration</th>\n",
" <th>...</th>\n",
" <th>textDocument/didSave</th>\n",
" <th>textDocument/willSave</th>\n",
" <th>workspace/didChangeConfiguration</th>\n",
" <th>workspace/didChangeWatchedFiles</th>\n",
" <th>workspace/didChangeWorkspaceFolders</th>\n",
" <th>$/cancelRequest</th>\n",
" <th>telemetry/event</th>\n",
" <th>textDocument/publishDiagnostics</th>\n",
" <th>window/logMessage</th>\n",
" <th>window/showMessage</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>ns_title</th>\n",
" <td>CodeLensResolve</td>\n",
" <td>CompletionItemResolve</td>\n",
" <td>DocumentLinkResolve</td>\n",
" <td>Initialize</td>\n",
" <td>Shutdown</td>\n",
" <td>TextDocumentCodeAction</td>\n",
" <td>TextDocumentCodeLens</td>\n",
" <td>TextDocumentColorPresentation</td>\n",
" <td>TextDocumentCompletion</td>\n",
" <td>TextDocumentDeclaration</td>\n",
" <td>...</td>\n",
" <td>TextDocumentDidSave</td>\n",
" <td>TextDocumentWillSave</td>\n",
" <td>WorkspaceDidChangeConfiguration</td>\n",
" <td>WorkspaceDidChangeWatchedFiles</td>\n",
" <td>WorkspaceDidChangeWorkspaceFolders</td>\n",
" <td>CancelRequest</td>\n",
" <td>TelemetryEvent</td>\n",
" <td>TextDocumentPublishDiagnostics</td>\n",
" <td>WindowLogMessage</td>\n",
" <td>WindowShowMessage</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>1 rows ร— 50 columns</p>\n",
"</div>"
],
"text/plain": [
"type โ†ฉ๏ธ \\\n",
"method codeLens/resolve completionItem/resolve documentLink/resolve \n",
"ns_title CodeLensResolve CompletionItemResolve DocumentLinkResolve \n",
"\n",
"type \\\n",
"method initialize shutdown textDocument/codeAction textDocument/codeLens \n",
"ns_title Initialize Shutdown TextDocumentCodeAction TextDocumentCodeLens \n",
"\n",
"type \\\n",
"method textDocument/colorPresentation textDocument/completion \n",
"ns_title TextDocumentColorPresentation TextDocumentCompletion \n",
"\n",
"type ... โžก๏ธ \\\n",
"method textDocument/declaration ... textDocument/didSave \n",
"ns_title TextDocumentDeclaration ... TextDocumentDidSave \n",
"\n",
"type \\\n",
"method textDocument/willSave workspace/didChangeConfiguration \n",
"ns_title TextDocumentWillSave WorkspaceDidChangeConfiguration \n",
"\n",
"type \\\n",
"method workspace/didChangeWatchedFiles workspace/didChangeWorkspaceFolders \n",
"ns_title WorkspaceDidChangeWatchedFiles WorkspaceDidChangeWorkspaceFolders \n",
"\n",
"type โžก๏ธ โฌ…๏ธ โฌ…๏ธ \\\n",
"method $/cancelRequest telemetry/event textDocument/publishDiagnostics \n",
"ns_title CancelRequest TelemetryEvent TextDocumentPublishDiagnostics \n",
"\n",
"type \n",
"method window/logMessage window/showMessage \n",
"ns_title WindowLogMessage WindowShowMessage \n",
"\n",
"[1 rows x 50 columns]"
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"def method_title(m):\n",
" name = \"\".join([\n",
" b[0].upper() + b[1:]\n",
" for b in m.split('/')\n",
" if b != '$'\n",
" ])\n",
" return name\n",
" \n",
"df[\"ns_title\"] = list(df.reset_index()['method'].apply(method_title))\n",
"df[[\"ns_title\"]].T"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"As many of the results are unions, let's apply some string manipulation to put everything from `main.ts` in a namespace."
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [],
"source": [
"def ns_result(r):\n",
" if r is None:\n",
" return None\n",
" try:\n",
" r = re.sub(r'\\b([A-Z])', 'proto.\\\\1', r)\n",
" except Exception as err:\n",
" print(err, r)\n",
" return r\n",
"df[\"ns_result\"] = df[\"result\"].apply(ns_result)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This is not pretty, but gets the job done."
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [],
"source": [
"protocol_schema_ts = jinja2.Template(\"\"\"\n",
"{% macro feature(row) -%}_{{ row.ns_title }}Feature{%- endmacro %}\n",
"{% macro request(row) -%}_{{ row.ns_title }}Request{%- endmacro %}\n",
"{% macro result(row) -%}_{{ row.ns_title }}Response{%- endmacro %}\n",
"\n",
"import {RequestMessage} from 'vscode-jsonrpc';\n",
"import {ResponseMessage, ResponseErrorLiteral} from 'vscode-jsonrpc/lib/messages';\n",
"import * as proto from './main';\n",
"\n",
"// this didn't get exported anywhere\n",
"\n",
"export interface CancelParams {\n",
" /**\n",
" * The request id to cancel.\n",
" */\n",
" id: number | string;\n",
"}\n",
"\n",
"// couldn't find this either\n",
"\n",
"export interface _ErrorResponse extends Omit<ResponseMessage, 'result'>{\n",
" error: ResponseErrorLiteral<any>;\n",
"}\n",
"\n",
"export type _AnyFeature = {% for row in rows %}\n",
" | {{ feature(row) }}{% endfor %};\n",
"\n",
"export type _AnyRequest = {% for row in rows %}\n",
" | {{ request(row) }}{% endfor %};\n",
"\n",
"export type _AnyResponse = {% for row in rows %}\n",
" {% if row.result %}| {{ result(row) }}{% endif %}{% endfor %};\n",
"\n",
"{% for row in rows %}\n",
"export interface {{ request(row) }} extends RequestMessage {\n",
" method: '{{ row.method }}';\n",
" {%- if row.params %}\n",
" params: {% if row.params == 'CancelParams' %}CancelParams{% else %}proto.{{ row.params }}{% endif %};\n",
" {%- endif %}\n",
"}\n",
"\n",
"{% if row.result %}\n",
"export interface {{ result(row) }} extends Omit<ResponseMessage, 'error'> {\n",
" result: {{ row.ns_result }};\n",
"}\n",
"{% endif %}\n",
"\n",
"export interface {{ feature(row) }} {\n",
" request: {{ request(row) }};\n",
" {% if row.result %}response: {{ result(row) }} | _ErrorResponse;\n",
" {% endif %}\n",
"}\n",
"{% endfor %}\n",
"\n",
"\"\"\").render(rows=df.reset_index().to_dict(orient=\"records\"), ns_result=ns_result)\n",
"\n",
"pathlib.Path(\"vscode-languageserver-node/protocol/src/protocol-schema.ts\").write_text(protocol_schema_ts);"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Our generated code probably isn't very pretty. I don't event want to look, when we can make it... `prettier`."
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" 947 1759 25075 vscode-languageserver-node/protocol/src/protocol-schema.ts\n",
"protocol/src/protocol-schema.ts\u001b[2K\u001b[1Gprotocol/src/protocol-schema.ts 344ms\n",
" 811 1764 24007 vscode-languageserver-node/protocol/src/protocol-schema.ts\n"
]
}
],
"source": [
"!wc vscode-languageserver-node/protocol/src/protocol-schema.ts\n",
"!cd vscode-languageserver-node && ./node_modules/.bin/prettier --write protocol/src/protocol-schema.ts\n",
"!wc vscode-languageserver-node/protocol/src/protocol-schema.ts"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now, let's create a new schema, derived from out schema-targeted source."
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" 7958 20005 236588 generated.protocol.schema.json\n"
]
}
],
"source": [
"!rm generated.protocol.schema.json || echo \"nothing to remove yet!\"\n",
"!cd vscode-languageserver-node/protocol && ../node_modules/.bin/ts-json-schema-generator -c --path './src/protocol-schema.ts' --type '_AnyFeature' > ../../generated.protocol.schema.json\n",
"!wc generated.protocol.schema.json"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Provided that worked, we should now be able to parse it."
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(303, 'definitions')"
]
},
"execution_count": 23,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"generated_schema = json.loads(pathlib.Path(\"generated.protocol.schema.json\").read_text())\n",
"# synthetic_schema[\"definitions\"].update(naive_schema[\"definitions\"])\n",
"generated_schema[\"definitions\"] = dict(sorted(generated_schema[\"definitions\"].items()))\n",
"len(generated_schema[\"definitions\"]), \"definitions\""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"And validate it"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {},
"outputs": [],
"source": [
"validator = jsonschema.validators.Draft7Validator(generated_schema)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Seems okay!\n",
"\n",
"Let's re-apply what we've learned. We can now expect to find all of the request params under our made-up types."
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead tr th {\n",
" text-align: left;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr>\n",
" <th>type</th>\n",
" <th colspan=\"10\" halign=\"left\">โ†ฉ๏ธ</th>\n",
" <th>...</th>\n",
" <th colspan=\"5\" halign=\"left\">โžก๏ธ</th>\n",
" <th>โžก๏ธ โฌ…๏ธ</th>\n",
" <th colspan=\"4\" halign=\"left\">โฌ…๏ธ</th>\n",
" </tr>\n",
" <tr>\n",
" <th>method</th>\n",
" <th>codeLens/resolve</th>\n",
" <th>completionItem/resolve</th>\n",
" <th>documentLink/resolve</th>\n",
" <th>initialize</th>\n",
" <th>shutdown</th>\n",
" <th>textDocument/codeAction</th>\n",
" <th>textDocument/codeLens</th>\n",
" <th>textDocument/colorPresentation</th>\n",
" <th>textDocument/completion</th>\n",
" <th>textDocument/declaration</th>\n",
" <th>...</th>\n",
" <th>textDocument/didSave</th>\n",
" <th>textDocument/willSave</th>\n",
" <th>workspace/didChangeConfiguration</th>\n",
" <th>workspace/didChangeWatchedFiles</th>\n",
" <th>workspace/didChangeWorkspaceFolders</th>\n",
" <th>$/cancelRequest</th>\n",
" <th>telemetry/event</th>\n",
" <th>textDocument/publishDiagnostics</th>\n",
" <th>window/logMessage</th>\n",
" <th>window/showMessage</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>params</th>\n",
" <td>CodeLens</td>\n",
" <td>CompletionItem</td>\n",
" <td>DocumentLink</td>\n",
" <td>InitializeParams</td>\n",
" <td>None</td>\n",
" <td>CodeActionParams</td>\n",
" <td>CodeLensParams</td>\n",
" <td>ColorPresentationParams</td>\n",
" <td>CompletionParams</td>\n",
" <td>TextDocumentPositionParams</td>\n",
" <td>...</td>\n",
" <td>DidSaveTextDocumentParams</td>\n",
" <td>WillSaveTextDocumentParams</td>\n",
" <td>DidChangeConfigurationParams</td>\n",
" <td>DidChangeWatchedFilesParams</td>\n",
" <td>DidChangeWorkspaceFoldersParams</td>\n",
" <td>CancelParams</td>\n",
" <td>None</td>\n",
" <td>PublishDiagnosticsParams</td>\n",
" <td>LogMessageParams</td>\n",
" <td>ShowMessageParams</td>\n",
" </tr>\n",
" <tr>\n",
" <th>params_schema</th>\n",
" <td>{'$ref': '#/definitions/CodeLens', 'descriptio...</td>\n",
" <td>{'$ref': '#/definitions/CompletionItem', 'desc...</td>\n",
" <td>{'$ref': '#/definitions/DocumentLink', 'descri...</td>\n",
" <td>{'$ref': '#/definitions/InitializeParams', 'de...</td>\n",
" <td>{'description': 'The method's params.'}</td>\n",
" <td>{'$ref': '#/definitions/CodeActionParams', 'de...</td>\n",
" <td>{'$ref': '#/definitions/CodeLensParams', 'desc...</td>\n",
" <td>{'$ref': '#/definitions/ColorPresentationParam...</td>\n",
" <td>{'$ref': '#/definitions/CompletionParams', 'de...</td>\n",
" <td>{'$ref': '#/definitions/TextDocumentPositionPa...</td>\n",
" <td>...</td>\n",
" <td>{'$ref': '#/definitions/DidSaveTextDocumentPar...</td>\n",
" <td>{'$ref': '#/definitions/WillSaveTextDocumentPa...</td>\n",
" <td>{'$ref': '#/definitions/DidChangeConfiguration...</td>\n",
" <td>{'$ref': '#/definitions/DidChangeWatchedFilesP...</td>\n",
" <td>{'$ref': '#/definitions/DidChangeWorkspaceFold...</td>\n",
" <td>{'$ref': '#/definitions/CancelParams', 'descri...</td>\n",
" <td>{'description': 'The method's params.'}</td>\n",
" <td>{'$ref': '#/definitions/PublishDiagnosticsPara...</td>\n",
" <td>{'$ref': '#/definitions/LogMessageParams', 'de...</td>\n",
" <td>{'$ref': '#/definitions/ShowMessageParams', 'd...</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>2 rows ร— 50 columns</p>\n",
"</div>"
],
"text/plain": [
"type โ†ฉ๏ธ \\\n",
"method codeLens/resolve \n",
"params CodeLens \n",
"params_schema {'$ref': '#/definitions/CodeLens', 'descriptio... \n",
"\n",
"type \\\n",
"method completionItem/resolve \n",
"params CompletionItem \n",
"params_schema {'$ref': '#/definitions/CompletionItem', 'desc... \n",
"\n",
"type \\\n",
"method documentLink/resolve \n",
"params DocumentLink \n",
"params_schema {'$ref': '#/definitions/DocumentLink', 'descri... \n",
"\n",
"type \\\n",
"method initialize \n",
"params InitializeParams \n",
"params_schema {'$ref': '#/definitions/InitializeParams', 'de... \n",
"\n",
"type \\\n",
"method shutdown \n",
"params None \n",
"params_schema {'description': 'The method's params.'} \n",
"\n",
"type \\\n",
"method textDocument/codeAction \n",
"params CodeActionParams \n",
"params_schema {'$ref': '#/definitions/CodeActionParams', 'de... \n",
"\n",
"type \\\n",
"method textDocument/codeLens \n",
"params CodeLensParams \n",
"params_schema {'$ref': '#/definitions/CodeLensParams', 'desc... \n",
"\n",
"type \\\n",
"method textDocument/colorPresentation \n",
"params ColorPresentationParams \n",
"params_schema {'$ref': '#/definitions/ColorPresentationParam... \n",
"\n",
"type \\\n",
"method textDocument/completion \n",
"params CompletionParams \n",
"params_schema {'$ref': '#/definitions/CompletionParams', 'de... \n",
"\n",
"type ... \\\n",
"method textDocument/declaration ... \n",
"params TextDocumentPositionParams ... \n",
"params_schema {'$ref': '#/definitions/TextDocumentPositionPa... ... \n",
"\n",
"type โžก๏ธ \\\n",
"method textDocument/didSave \n",
"params DidSaveTextDocumentParams \n",
"params_schema {'$ref': '#/definitions/DidSaveTextDocumentPar... \n",
"\n",
"type \\\n",
"method textDocument/willSave \n",
"params WillSaveTextDocumentParams \n",
"params_schema {'$ref': '#/definitions/WillSaveTextDocumentPa... \n",
"\n",
"type \\\n",
"method workspace/didChangeConfiguration \n",
"params DidChangeConfigurationParams \n",
"params_schema {'$ref': '#/definitions/DidChangeConfiguration... \n",
"\n",
"type \\\n",
"method workspace/didChangeWatchedFiles \n",
"params DidChangeWatchedFilesParams \n",
"params_schema {'$ref': '#/definitions/DidChangeWatchedFilesP... \n",
"\n",
"type \\\n",
"method workspace/didChangeWorkspaceFolders \n",
"params DidChangeWorkspaceFoldersParams \n",
"params_schema {'$ref': '#/definitions/DidChangeWorkspaceFold... \n",
"\n",
"type โžก๏ธ โฌ…๏ธ \\\n",
"method $/cancelRequest \n",
"params CancelParams \n",
"params_schema {'$ref': '#/definitions/CancelParams', 'descri... \n",
"\n",
"type โฌ…๏ธ \\\n",
"method telemetry/event \n",
"params None \n",
"params_schema {'description': 'The method's params.'} \n",
"\n",
"type \\\n",
"method textDocument/publishDiagnostics \n",
"params PublishDiagnosticsParams \n",
"params_schema {'$ref': '#/definitions/PublishDiagnosticsPara... \n",
"\n",
"type \\\n",
"method window/logMessage \n",
"params LogMessageParams \n",
"params_schema {'$ref': '#/definitions/LogMessageParams', 'de... \n",
"\n",
"type \n",
"method window/showMessage \n",
"params ShowMessageParams \n",
"params_schema {'$ref': '#/definitions/ShowMessageParams', 'd... \n",
"\n",
"[2 rows x 50 columns]"
]
},
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df[\"params_schema\"] = df[\"ns_title\"].apply(\n",
" lambda x: generated_schema[\"definitions\"][f\"_{x}Request\"][\"properties\"][\"params\"] if f\"_{x}Request\" in generated_schema[\"definitions\"] else None\n",
")\n",
"df[[\"params\", \"params_schema\"]].T"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Similarly, all of the results."
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead tr th {\n",
" text-align: left;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr>\n",
" <th>type</th>\n",
" <th colspan=\"10\" halign=\"left\">โ†ฉ๏ธ</th>\n",
" <th>...</th>\n",
" <th colspan=\"5\" halign=\"left\">โžก๏ธ</th>\n",
" <th>โžก๏ธ โฌ…๏ธ</th>\n",
" <th colspan=\"4\" halign=\"left\">โฌ…๏ธ</th>\n",
" </tr>\n",
" <tr>\n",
" <th>method</th>\n",
" <th>codeLens/resolve</th>\n",
" <th>completionItem/resolve</th>\n",
" <th>documentLink/resolve</th>\n",
" <th>initialize</th>\n",
" <th>shutdown</th>\n",
" <th>textDocument/codeAction</th>\n",
" <th>textDocument/codeLens</th>\n",
" <th>textDocument/colorPresentation</th>\n",
" <th>textDocument/completion</th>\n",
" <th>textDocument/declaration</th>\n",
" <th>...</th>\n",
" <th>textDocument/didSave</th>\n",
" <th>textDocument/willSave</th>\n",
" <th>workspace/didChangeConfiguration</th>\n",
" <th>workspace/didChangeWatchedFiles</th>\n",
" <th>workspace/didChangeWorkspaceFolders</th>\n",
" <th>$/cancelRequest</th>\n",
" <th>telemetry/event</th>\n",
" <th>textDocument/publishDiagnostics</th>\n",
" <th>window/logMessage</th>\n",
" <th>window/showMessage</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>result</th>\n",
" <td>CodeLens</td>\n",
" <td>CompletionItem</td>\n",
" <td>DocumentLink</td>\n",
" <td>InitializeResult</td>\n",
" <td>null</td>\n",
" <td>(Command | CodeAction)[] | null</td>\n",
" <td>CodeLens[] | null</td>\n",
" <td>ColorPresentation[]</td>\n",
" <td>CompletionItem[] | CompletionList | null</td>\n",
" <td>Location[] |null</td>\n",
" <td>...</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>result_schema</th>\n",
" <td>{'anyOf': [{'type': 'string'}, {'type': 'numbe...</td>\n",
" <td>{'anyOf': [{'type': 'string'}, {'type': 'numbe...</td>\n",
" <td>{'anyOf': [{'type': 'string'}, {'type': 'numbe...</td>\n",
" <td>{'anyOf': [{'type': 'string'}, {'type': 'numbe...</td>\n",
" <td>{'anyOf': [{'type': 'string'}, {'type': 'numbe...</td>\n",
" <td>{'anyOf': [{'items': {'anyOf': [{'$ref': '#/de...</td>\n",
" <td>{'anyOf': [{'items': {'$ref': '#/definitions/C...</td>\n",
" <td>{'anyOf': [{'type': 'string'}, {'type': 'numbe...</td>\n",
" <td>{'anyOf': [{'items': {'$ref': '#/definitions/C...</td>\n",
" <td>{'anyOf': [{'items': {'$ref': '#/definitions/L...</td>\n",
" <td>...</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>2 rows ร— 50 columns</p>\n",
"</div>"
],
"text/plain": [
"type โ†ฉ๏ธ \\\n",
"method codeLens/resolve \n",
"result CodeLens \n",
"result_schema {'anyOf': [{'type': 'string'}, {'type': 'numbe... \n",
"\n",
"type \\\n",
"method completionItem/resolve \n",
"result CompletionItem \n",
"result_schema {'anyOf': [{'type': 'string'}, {'type': 'numbe... \n",
"\n",
"type \\\n",
"method documentLink/resolve \n",
"result DocumentLink \n",
"result_schema {'anyOf': [{'type': 'string'}, {'type': 'numbe... \n",
"\n",
"type \\\n",
"method initialize \n",
"result InitializeResult \n",
"result_schema {'anyOf': [{'type': 'string'}, {'type': 'numbe... \n",
"\n",
"type \\\n",
"method shutdown \n",
"result null \n",
"result_schema {'anyOf': [{'type': 'string'}, {'type': 'numbe... \n",
"\n",
"type \\\n",
"method textDocument/codeAction \n",
"result (Command | CodeAction)[] | null \n",
"result_schema {'anyOf': [{'items': {'anyOf': [{'$ref': '#/de... \n",
"\n",
"type \\\n",
"method textDocument/codeLens \n",
"result CodeLens[] | null \n",
"result_schema {'anyOf': [{'items': {'$ref': '#/definitions/C... \n",
"\n",
"type \\\n",
"method textDocument/colorPresentation \n",
"result ColorPresentation[] \n",
"result_schema {'anyOf': [{'type': 'string'}, {'type': 'numbe... \n",
"\n",
"type \\\n",
"method textDocument/completion \n",
"result CompletionItem[] | CompletionList | null \n",
"result_schema {'anyOf': [{'items': {'$ref': '#/definitions/C... \n",
"\n",
"type ... \\\n",
"method textDocument/declaration ... \n",
"result Location[] |null ... \n",
"result_schema {'anyOf': [{'items': {'$ref': '#/definitions/L... ... \n",
"\n",
"type โžก๏ธ \\\n",
"method textDocument/didSave textDocument/willSave \n",
"result None None \n",
"result_schema None None \n",
"\n",
"type \\\n",
"method workspace/didChangeConfiguration \n",
"result None \n",
"result_schema None \n",
"\n",
"type \\\n",
"method workspace/didChangeWatchedFiles \n",
"result None \n",
"result_schema None \n",
"\n",
"type โžก๏ธ โฌ…๏ธ \\\n",
"method workspace/didChangeWorkspaceFolders $/cancelRequest \n",
"result None None \n",
"result_schema None None \n",
"\n",
"type โฌ…๏ธ \\\n",
"method telemetry/event textDocument/publishDiagnostics \n",
"result None None \n",
"result_schema None None \n",
"\n",
"type \n",
"method window/logMessage window/showMessage \n",
"result None None \n",
"result_schema None None \n",
"\n",
"[2 rows x 50 columns]"
]
},
"execution_count": 26,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df[\"result_schema\"] = df[\"ns_title\"].apply(\n",
" lambda x: generated_schema[\"definitions\"][f\"_{x}Response\"][\"properties\"][\"result\"] if f\"_{x}Response\" in generated_schema[\"definitions\"] else None\n",
")\n",
"df[[\"result\", \"result_schema\"]].T"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## What's missing now?"
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th></th>\n",
" <th>_raw_params</th>\n",
" <th>params</th>\n",
" <th>params_schema</th>\n",
" </tr>\n",
" <tr>\n",
" <th>type</th>\n",
" <th>method</th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
"Empty DataFrame\n",
"Columns: [_raw_params, params, params_schema]\n",
"Index: []"
]
},
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"missing_params_from_generated_schema = df[df[\"params_schema\"].isnull()][[\"_raw_params\", \"params\", \"params_schema\"]]\n",
"missing_params_from_generated_schema"
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/weg/Documents/projects/lsp-json-schema/envs/lsp-json-schema/lib/python3.7/site-packages/ipykernel_launcher.py:1: UserWarning: Boolean Series key will be reindexed to match DataFrame index.\n",
" \"\"\"Entry point for launching an IPython kernel.\n"
]
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th></th>\n",
" <th>_raw_result</th>\n",
" <th>result</th>\n",
" <th>result_schema</th>\n",
" </tr>\n",
" <tr>\n",
" <th>type</th>\n",
" <th>method</th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
"Empty DataFrame\n",
"Columns: [_raw_result, result, result_schema]\n",
"Index: []"
]
},
"execution_count": 28,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"missing_results_from_generated_schema = df[df[\"result\"].isnull()][~df[\"_raw_result\"].isnull()][[\"_raw_result\", \"result\", \"result_schema\"]]\n",
"missing_results_from_generated_schema"
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {},
"outputs": [],
"source": [
"assert not len(missing_params_from_generated_schema) and not len(missing_results_from_generated_schema)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Looks like we got it all."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Validating things\n",
"First, let's validate something small: just a request to `initialize`."
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {},
"outputs": [],
"source": [
"def is_it_valid(name, instance):\n",
" subschema = copy.deepcopy(generated_schema)\n",
" subschema[\"$ref\"] = f\"#/definitions/{name}\"\n",
" jsonschema.validators.Draft7Validator(subschema).validate(instance)\n",
" print(f\"yep, it's a valid {name}.\")"
]
},
{
"cell_type": "code",
"execution_count": 31,
"metadata": {},
"outputs": [],
"source": [
"def is_it_invalid(name, instance, cause):\n",
" with pytest.raises(jsonschema.ValidationError, match=cause):\n",
" try:\n",
" is_it_valid(name, instance)\n",
" except jsonschema.ValidationError as err:\n",
" print(err.message)\n",
" raise err\n",
" print(f\"oh no, it's not a valid {name}!\")"
]
},
{
"cell_type": "code",
"execution_count": 32,
"metadata": {},
"outputs": [],
"source": [
"init_params_good = {\n",
" \"capabilities\": {},\n",
" \"processId\": 1,\n",
" \"workspaceFolders\": [],\n",
" \"rootUri\": \"file:///\"\n",
"}"
]
},
{
"cell_type": "code",
"execution_count": 33,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"yep, it's a valid InitializeParams.\n"
]
}
],
"source": [
"is_it_valid(\"InitializeParams\", init_params_good)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"It should catch something that's bad, like providing `capabilities`."
]
},
{
"cell_type": "code",
"execution_count": 34,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"'capabilities' is a required property\n",
"oh no, it's not a valid InitializeParams!\n"
]
}
],
"source": [
"init_params_bad = copy.deepcopy(init_params_good)\n",
"init_params_bad.pop(\"capabilities\")\n",
"is_it_invalid(\"InitializeParams\", init_params_bad, \"'capabilities' is a required property\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The same approach could be used for any of the \"real\" types. However, the default schema points at `_AnyFeature`, which allows us to validate a request/response pair. While this is a side-effect of trying to generate a minimal schema (ha), it is nonetheless useful. Pretty much the simplest `initialize` exchange would be:"
]
},
{
"cell_type": "code",
"execution_count": 35,
"metadata": {},
"outputs": [],
"source": [
"init_exchange_good = {\n",
" \"request\": {\n",
" \"jsonrpc\": \"2.0\",\n",
" \"id\": 0,\n",
" \"method\": \"initialize\",\n",
" \"params\": init_params_good\n",
" },\n",
" \"response\": {\n",
" \"jsonrpc\": \"2.0\",\n",
" \"id\": 0,\n",
" \"result\": {\n",
" \"capabilities\": {},\n",
" \"serverInfo\": {\"name\": \"test\"}\n",
" }\n",
" }\n",
"}"
]
},
{
"cell_type": "code",
"execution_count": 36,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"yep, it's a valid _AnyFeature.\n"
]
}
],
"source": [
"is_it_valid(\"_AnyFeature\", init_exchange_good)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"But we might explicitly care if it's a good `_InitializeFeature`"
]
},
{
"cell_type": "code",
"execution_count": 37,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"yep, it's a valid _InitializeFeature.\n"
]
}
],
"source": [
"is_it_valid(\"_InitializeFeature\", init_exchange_good)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Imagine we had forgotten the `workspaceFolders`..."
]
},
{
"cell_type": "code",
"execution_count": 38,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'request': {'jsonrpc': '2.0', 'id': 0, 'method': 'initialize', 'params': {'capabilities': {}, 'processId': 1, 'rootUri': 'file:///'}}, 'response': {'jsonrpc': '2.0', 'id': 0, 'result': {'capabilities': {}, 'serverInfo': {'name': 'test'}}}} is not valid under any of the given schemas\n",
"oh no, it's not a valid _AnyFeature!\n"
]
}
],
"source": [
"init_exchange_bad = copy.deepcopy(init_exchange_good)\n",
"init_exchange_bad[\"request\"][\"params\"].pop(\"workspaceFolders\")\n",
"is_it_invalid(\"_AnyFeature\", init_exchange_bad, \"is not valid\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Unfortunately, that error isn't _particularly_ helpful in telling us exactly _what_ went wrong, but it's probable that the schema could be restructured in such as way as to give better feedback."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Remaining Challenges and Opportunities\n",
"- spec\n",
" - if the specification format stays in Markdown\n",
" - a formatter, e.g. [prettier](https://github.com/prettier/prettier) \n",
" - would aid in keeping the formatting consistent\n",
" - a link checker\n",
" - would aid in keeping the document discoverable\n",
" - if an alternative format would be considered\n",
" - an RFC-style spec\n",
" - would aid in submission to an appropriate standards body (e.g. W3C, IETF)\n",
" - a modular spec definition (e.g. XMPP's [XEP](https://xmpp.org/extensions/))\n",
" - would allow for a more fine-grained discussion\n",
"- generator and/or reference implementation\n",
" - the use of the `namespace x {const y0 = z0;const y1 = z1;}` pattern is relatively opaque to the generator\n",
" - logically, this makes sense, as what's to really differentiate `1` from `1`, just in a different scheme?\n",
" - but it would be really nice to talk about the names\n",
"- do more with the schema\n",
" - it would be interesting to start wiring this up to [quickcheck](http://hackage.haskell.org/package/QuickCheck)-derived testing suite\n",
" - ...or an interactive protocol documentation mode, perhaps like [rjsf](https://rjsf-team.github.io/react-jsonschema-form/)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# The Schema\n",
"For posterity, here's the whole thing. It should also be available as [JSON](./generated.protocol.schema.json) or [YAML](./generated.protocol.schema.yml)."
]
},
{
"cell_type": "code",
"execution_count": 39,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"generated.protocol.schema.yml\u001b[2K\u001b[1Ggenerated.protocol.schema.yml 1359ms\n"
]
},
{
"data": {
"text/markdown": [
"```yaml\n",
"$ref: \"#/definitions/_AnyFeature\"\n",
"$schema: http://json-schema.org/draft-07/schema#\n",
"definitions:\n",
" ApplyWorkspaceEditParams:\n",
" additionalProperties: false\n",
" description: The parameters passed via a apply workspace edit request.\n",
" properties:\n",
" edit:\n",
" $ref: \"#/definitions/WorkspaceEdit\"\n",
" description: The edits to apply.\n",
" label:\n",
" description: \"An optional label of the workspace edit. This label is\n",
"\n",
" presented in the user interface for example on an undo\n",
"\n",
" stack to undo the workspace edit.\"\n",
" type: string\n",
" required:\n",
" - edit\n",
" type: object\n",
" ApplyWorkspaceEditResponse:\n",
" additionalProperties: false\n",
" description: A response returned from the apply workspace edit request.\n",
" properties:\n",
" applied:\n",
" description: Indicates whether the edit was applied or not.\n",
" type: boolean\n",
" failedChange:\n",
" description:\n",
" \"Depending on the client's failure handling strategy `failedChange`\n",
" might\n",
"\n",
" contain the index of the change that failed. This property is only available\n",
"\n",
" if the client signals a `failureHandlingStrategy` in its client capabilities.\"\n",
" type: number\n",
" failureReason:\n",
" description:\n",
" \"An optional textual description for why the edit was not applied.\n",
"\n",
" This may be used by the server for diagnostic logging or to provide\n",
"\n",
" a suitable error for a request that triggered the edit.\"\n",
" type: string\n",
" required:\n",
" - applied\n",
" type: object\n",
" CancelParams:\n",
" additionalProperties: false\n",
" properties:\n",
" id:\n",
" description: The request id to cancel.\n",
" type:\n",
" - number\n",
" - string\n",
" required:\n",
" - id\n",
" type: object\n",
" ClientCapabilities:\n",
" additionalProperties: false\n",
" properties:\n",
" dynamicRegistration:\n",
" description:\n",
" \"Whether implementation supports dynamic registration for selection\n",
" range providers. If this is set to `true`\n",
"\n",
" the client supports the new `SelectionRangeRegistrationOptions` return value\n",
" for the corresponding server\n",
"\n",
" capability as well.\"\n",
" type: boolean\n",
" experimental:\n",
" description: Experimental client capabilities.\n",
" textDocument:\n",
" $ref: \"#/definitions/TextDocumentClientCapabilities\"\n",
" description: Text document specific client capabilities.\n",
" window:\n",
" description: Window specific client capabilities.\n",
" type: object\n",
" workspace:\n",
" $ref: \"#/definitions/WorkspaceClientCapabilities\"\n",
" additionalProperties: false\n",
" description: Workspace specific client capabilities.\n",
" properties:\n",
" configuration:\n",
" description: The client supports `workspace/configuration` requests.\n",
" type: boolean\n",
" workspaceFolders:\n",
" description: The client has support for workspace folders\n",
" type: boolean\n",
" type: object\n",
" type: object\n",
" CodeAction:\n",
" additionalProperties: false\n",
" description:\n",
" \"A code action represents a change that can be performed in code,\\\n",
" \\ e.g. to fix a problem or\\r\\nto refactor code.\\r\\n\\r\\nA CodeAction must set\\\n",
" \\ either `edit` and/or a `command`. If both are supplied, the `edit` is applied\\\n",
" \\ first, then the `command` is executed.\"\n",
" properties:\n",
" command:\n",
" $ref: \"#/definitions/Command\"\n",
" description:\n",
" \"A command this code action executes. If a code action\\r\\nprovides\\\n",
" \\ a edit and a command, first the edit is\\r\\nexecuted and then the command.\"\n",
" diagnostics:\n",
" description: The diagnostics that this code action resolves.\n",
" items:\n",
" $ref: \"#/definitions/Diagnostic\"\n",
" type: array\n",
" edit:\n",
" $ref: \"#/definitions/WorkspaceEdit\"\n",
" description: The workspace edit this code action performs.\n",
" isPreferred:\n",
" description:\n",
" \"Marks this as a preferred action. Preferred actions are used\\\n",
" \\ by the `auto fix` command and can be targeted\\r\\nby keybindings.\\r\\n\\r\\\n",
" \\nA quick fix should be marked preferred if it properly addresses the underlying\\\n",
" \\ error.\\r\\nA refactoring should be marked preferred if it is the most reasonable\\\n",
" \\ choice of actions to take.\"\n",
" type: boolean\n",
" kind:\n",
" $ref: \"#/definitions/CodeActionKind\"\n",
" description: \"The kind of the code action.\\r\\n\\r\\nUsed to filter code actions.\"\n",
" title:\n",
" description: A short, human-readable, title for this code action.\n",
" type: string\n",
" required:\n",
" - title\n",
" type: object\n",
" CodeActionClientCapabilities:\n",
" additionalProperties: false\n",
" description: The Client Capabilities of a [CodeActionRequest](#CodeActionRequest).\n",
" properties:\n",
" codeActionLiteralSupport:\n",
" additionalProperties: false\n",
" description: \"The client support code action literals as a valid\n",
"\n",
" response of the `textDocument/codeAction` request.\"\n",
" properties:\n",
" codeActionKind:\n",
" additionalProperties: false\n",
" description:\n",
" \"The code action kind is support with the following value\n",
"\n",
" set.\"\n",
" properties:\n",
" valueSet:\n",
" description:\n",
" \"The code action kind values the client supports. When\n",
" this\n",
"\n",
" property exists the client also guarantees that it will\n",
"\n",
" handle values outside its set gracefully and falls back\n",
"\n",
" to a default value when unknown.\"\n",
" items:\n",
" $ref: \"#/definitions/CodeActionKind\"\n",
" type: array\n",
" required:\n",
" - valueSet\n",
" type: object\n",
" required:\n",
" - codeActionKind\n",
" type: object\n",
" dynamicRegistration:\n",
" description: Whether code action supports dynamic registration.\n",
" type: boolean\n",
" isPreferredSupport:\n",
" description: Whether code action supports the `isPreferred` property.\n",
" type: boolean\n",
" type: object\n",
" CodeActionContext:\n",
" additionalProperties: false\n",
" description:\n",
" \"Contains additional diagnostic information about the context in\\\n",
" \\ which\\r\\na [code action](#CodeActionProvider.provideCodeActions) is run. \\n\\\n",
" \\ The CodeActionContext namespace provides helper functions to work with\\r\\n\\\n",
" [CodeActionContext](#CodeActionContext) literals.\"\n",
" properties:\n",
" diagnostics:\n",
" description:\n",
" \"An array of diagnostics known on the client side overlapping\\\n",
" \\ the range provided to the\\r\\n`textDocument/codeAction` request. They are\\\n",
" \\ provied so that the server knows which\\r\\nerrors are currently presented\\\n",
" \\ to the user for the given range. There is no guarantee\\r\\nthat these accurately\\\n",
" \\ reflect the error state of the resource. The primary parameter\\r\\nto compute\\\n",
" \\ code actions is the provided range.\"\n",
" items:\n",
" $ref: \"#/definitions/Diagnostic\"\n",
" type: array\n",
" only:\n",
" description:\n",
" \"Requested kind of actions to return.\\r\\n\\r\\nActions not of this\\\n",
" \\ kind are filtered out by the client before being shown. So servers\\r\\n\\\n",
" can omit computing them.\"\n",
" items:\n",
" $ref: \"#/definitions/CodeActionKind\"\n",
" type: array\n",
" required:\n",
" - diagnostics\n",
" type: object\n",
" CodeActionKind:\n",
" description:\n",
" \"The kind of a code action.\\r\\n\\r\\nKinds are a hierarchical list\\\n",