From 086727ee6f66abdcc7050ee53504ba58e200ce40 Mon Sep 17 00:00:00 2001 From: Danny Tuppeny Date: Mon, 6 Jun 2022 14:27:48 +0000 Subject: [PATCH] [analysis_server] Migrate from using Markdown/TypeScript spec for LSP types to JSON model Change-Id: I58dbbbee48febc45304b27a95fedfef289479265 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247340 Commit-Queue: Brian Wilkerson Reviewed-by: Brian Wilkerson --- .../lib/lsp_protocol/protocol_generated.dart | 2350 ++- .../lib/src/lsp/handlers/handler_rename.dart | 13 +- .../src/computer/color_computer_test.dart | 1 + .../test/tool/lsp_spec/matchers.dart | 2 +- .../test/tool/lsp_spec/typescript_test.dart | 545 +- .../tool/lsp_spec/codegen_dart.dart | 139 +- .../tool/lsp_spec/generate_all.dart | 210 +- .../tool/lsp_spec/lsp_meta_model.json | 14316 ++++++++++++++++ .../tool/lsp_spec/lsp_meta_model.license.txt | 15 + .../tool/lsp_spec/meta_model_cleaner.dart | 352 + .../tool/lsp_spec/meta_model_reader.dart | 302 + .../tool/lsp_spec/typescript.dart | 79 +- .../tool/lsp_spec/typescript_parser.dart | 776 +- 13 files changed, 17193 insertions(+), 1907 deletions(-) create mode 100644 pkg/analysis_server/tool/lsp_spec/lsp_meta_model.json create mode 100644 pkg/analysis_server/tool/lsp_spec/lsp_meta_model.license.txt create mode 100644 pkg/analysis_server/tool/lsp_spec/meta_model_cleaner.dart create mode 100644 pkg/analysis_server/tool/lsp_spec/meta_model_reader.dart diff --git a/pkg/analysis_server/lib/lsp_protocol/protocol_generated.dart b/pkg/analysis_server/lib/lsp_protocol/protocol_generated.dart index 4421889b6bd..fdedb8f53d2 100644 --- a/pkg/analysis_server/lib/lsp_protocol/protocol_generated.dart +++ b/pkg/analysis_server/lib/lsp_protocol/protocol_generated.dart @@ -17,7 +17,8 @@ import 'package:analysis_server/src/protocol/protocol_internal.dart'; const jsonEncoder = JsonEncoder.withIndent(' '); /// A special text edit with an additional change annotation. -/// @since 3.16.0. +/// +/// @since 3.16.0. class AnnotatedTextEdit implements TextEdit, ToJsonable { static const jsonHandler = LspJsonHandler( AnnotatedTextEdit.canParse, @@ -43,7 +44,7 @@ class AnnotatedTextEdit implements TextEdit, ToJsonable { ); } - /// The actual annotation identifier. + /// The actual identifier of the change annotation final String annotationId; /// The string to be inserted. For delete operations use an empty string. @@ -149,6 +150,7 @@ class AnnotatedTextEdit implements TextEdit, ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// The parameters passed via a apply workspace edit request. class ApplyWorkspaceEditParams implements ToJsonable { static const jsonHandler = LspJsonHandler( ApplyWorkspaceEditParams.canParse, @@ -243,6 +245,9 @@ class ApplyWorkspaceEditParams implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// The result returned from the apply workspace edit request. +/// +/// @since 3.17 renamed from ApplyWorkspaceEditResponse class ApplyWorkspaceEditResult implements ToJsonable { static const jsonHandler = LspJsonHandler( ApplyWorkspaceEditResult.canParse, @@ -273,7 +278,7 @@ class ApplyWorkspaceEditResult implements ToJsonable { /// Depending on the client's failure handling strategy `failedChange` might /// contain the index of the change that failed. This property is only - /// available if the client signals a `failureHandling` strategy in its client + /// available if the client signals a `failureHandlingStrategy` in its client /// capabilities. final int? failedChange; @@ -365,6 +370,168 @@ class ApplyWorkspaceEditResult implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// A base for all symbol information. +class BaseSymbolInformation implements ToJsonable { + static const jsonHandler = LspJsonHandler( + BaseSymbolInformation.canParse, + BaseSymbolInformation.fromJson, + ); + + BaseSymbolInformation({ + this.containerName, + required this.kind, + required this.name, + this.tags, + }); + static BaseSymbolInformation fromJson(Map json) { + if (SymbolInformation.canParse(json, nullLspJsonReporter)) { + return SymbolInformation.fromJson(json); + } + if (WorkspaceSymbol.canParse(json, nullLspJsonReporter)) { + return WorkspaceSymbol.fromJson(json); + } + final containerNameJson = json['containerName']; + final containerName = containerNameJson as String?; + final kindJson = json['kind']; + final kind = SymbolKind.fromJson(kindJson as int); + final nameJson = json['name']; + final name = nameJson as String; + final tagsJson = json['tags']; + final tags = (tagsJson as List?) + ?.map((item) => SymbolTag.fromJson(item as int)) + .toList(); + return BaseSymbolInformation( + containerName: containerName, + kind: kind, + name: name, + tags: tags, + ); + } + + /// The name of the symbol containing this symbol. This information is for + /// user interface purposes (e.g. to render a qualifier in the user interface + /// if necessary). It can't be used to re-infer a hierarchy for the document + /// symbols. + final String? containerName; + + /// The kind of this symbol. + final SymbolKind kind; + + /// The name of this symbol. + final String name; + + /// Tags for this symbol. + /// + /// @since 3.16.0 + final List? tags; + + @override + Map toJson() { + var result = {}; + if (containerName != null) { + result['containerName'] = containerName; + } + result['kind'] = kind.toJson(); + result['name'] = name; + if (tags != null) { + result['tags'] = tags?.map((item) => item.toJson()).toList(); + } + return result; + } + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map) { + reporter.push('containerName'); + try { + final containerName = obj['containerName']; + if (containerName != null && containerName is! String) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('kind'); + try { + if (!obj.containsKey('kind')) { + reporter.reportError('must not be undefined'); + return false; + } + final kind = obj['kind']; + if (kind == null) { + reporter.reportError('must not be null'); + return false; + } + if (!SymbolKind.canParse(kind, reporter)) { + reporter.reportError('must be of type SymbolKind'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('name'); + try { + if (!obj.containsKey('name')) { + reporter.reportError('must not be undefined'); + return false; + } + final name = obj['name']; + if (name == null) { + reporter.reportError('must not be null'); + return false; + } + if (name is! String) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('tags'); + try { + final tags = obj['tags']; + if (tags != null && + (tags is! List || + tags.any((item) => !SymbolTag.canParse(item, reporter)))) { + reporter.reportError('must be of type List'); + return false; + } + } finally { + reporter.pop(); + } + return true; + } else { + reporter.reportError('must be of type BaseSymbolInformation'); + return false; + } + } + + @override + bool operator ==(Object other) { + if (other is BaseSymbolInformation && + other.runtimeType == BaseSymbolInformation) { + return containerName == other.containerName && + kind == other.kind && + name == other.name && + listEqual(tags, other.tags, (SymbolTag a, SymbolTag b) => a == b) && + true; + } + return false; + } + + @override + int get hashCode => Object.hash( + containerName, + kind, + name, + lspHashCode(tags), + ); + + @override + String toString() => jsonEncoder.convert(toJson()); +} + +/// @since 3.16.0 class CallHierarchyClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( CallHierarchyClientCapabilities.canParse, @@ -432,6 +599,9 @@ class CallHierarchyClientCapabilities implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Represents an incoming call, e.g. a caller of a method or constructor. +/// +/// @since 3.16.0 class CallHierarchyIncomingCall implements ToJsonable { static const jsonHandler = LspJsonHandler( CallHierarchyIncomingCall.canParse, @@ -459,7 +629,7 @@ class CallHierarchyIncomingCall implements ToJsonable { final CallHierarchyItem from; /// The ranges at which the calls appear. This is relative to the caller - /// denoted by [`this.from`](#CallHierarchyIncomingCall.from). + /// denoted by `this.from`. final List fromRanges; @override @@ -538,6 +708,9 @@ class CallHierarchyIncomingCall implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// The parameter of a `callHierarchy/incomingCalls` request. +/// +/// @since 3.16.0 class CallHierarchyIncomingCallsParams implements PartialResultParams, WorkDoneProgressParams, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -674,6 +847,10 @@ class CallHierarchyIncomingCallsParams String toString() => jsonEncoder.convert(toJson()); } +/// Represents programming constructs like functions or constructors in the +/// context of call hierarchy. +/// +/// @since 3.16.0 class CallHierarchyItem implements ToJsonable { static const jsonHandler = LspJsonHandler( CallHierarchyItem.canParse, @@ -740,8 +917,7 @@ class CallHierarchyItem implements ToJsonable { final Range range; /// The range that should be selected and revealed when this symbol is being - /// picked, e.g. the name of a function. Must be contained by the - /// [`range`](#CallHierarchyItem.range). + /// picked, e.g. the name of a function. Must be contained by the `range`. final Range selectionRange; /// Tags for this item. @@ -923,6 +1099,9 @@ class CallHierarchyItem implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Call hierarchy options used during static registration. +/// +/// @since 3.16.0 class CallHierarchyOptions implements WorkDoneProgressOptions, ToJsonable { static const jsonHandler = LspJsonHandler( CallHierarchyOptions.canParse, @@ -990,6 +1169,10 @@ class CallHierarchyOptions implements WorkDoneProgressOptions, ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Represents an outgoing call, e.g. calling a getter from a method or a method +/// from a constructor etc. +/// +/// @since 3.16.0 class CallHierarchyOutgoingCall implements ToJsonable { static const jsonHandler = LspJsonHandler( CallHierarchyOutgoingCall.canParse, @@ -1014,7 +1197,8 @@ class CallHierarchyOutgoingCall implements ToJsonable { } /// The range at which this item is called. This is the range relative to the - /// caller, e.g the item passed to `callHierarchy/outgoingCalls` request. + /// caller, e.g the item passed to `provideCallHierarchyOutgoingCalls` and not + /// `this.to`. final List fromRanges; /// The item that is called. @@ -1096,6 +1280,9 @@ class CallHierarchyOutgoingCall implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// The parameter of a `callHierarchy/outgoingCalls` request. +/// +/// @since 3.16.0 class CallHierarchyOutgoingCallsParams implements PartialResultParams, WorkDoneProgressParams, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -1232,6 +1419,9 @@ class CallHierarchyOutgoingCallsParams String toString() => jsonEncoder.convert(toJson()); } +/// The parameter of a `textDocument/prepareCallHierarchy` request. +/// +/// @since 3.16.0 class CallHierarchyPrepareParams implements TextDocumentPositionParams, WorkDoneProgressParams, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -1368,6 +1558,9 @@ class CallHierarchyPrepareParams String toString() => jsonEncoder.convert(toJson()); } +/// Call hierarchy options used during static or dynamic registration. +/// +/// @since 3.16.0 class CallHierarchyRegistrationOptions implements CallHierarchyOptions, @@ -1575,7 +1768,8 @@ class CancelParams implements ToJsonable { } /// Additional information that describes document changes. -/// @since 3.16.0 +/// +/// @since 3.16.0 class ChangeAnnotation implements ToJsonable { static const jsonHandler = LspJsonHandler( ChangeAnnotation.canParse, @@ -1695,6 +1889,7 @@ class ChangeAnnotation implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Defines the capabilities provided by the client. class ClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( ClientCapabilities.canParse, @@ -1750,11 +1945,13 @@ class ClientCapabilities implements ToJsonable { final Object? experimental; /// General client capabilities. - /// @since 3.16.0 + /// + /// @since 3.16.0 final GeneralClientCapabilities? general; /// Capabilities specific to the notebook document support. - /// @since 3.17.0 + /// + /// @since 3.17.0 final NotebookDocumentClientCapabilities? notebookDocument; /// Text document specific client capabilities. @@ -1951,7 +2148,8 @@ class CodeAction implements ToJsonable { /// A data entry field that is preserved on a code action between a /// `textDocument/codeAction` and a `codeAction/resolve` request. - /// @since 3.16.0 + /// + /// @since 3.16.0 final Object? data; /// The diagnostics that this code action resolves. @@ -1962,17 +2160,21 @@ class CodeAction implements ToJsonable { /// Clients should follow the following guidelines regarding disabled code /// actions: /// - /// - Disabled code actions are not shown in automatic lightbulbs code - /// action menus. + /// - Disabled code actions are not shown in automatic + /// [lightbulbs](https://code.visualstudio.com/docs/editor/editingevolved#_code-action) + /// code action menus. /// - /// - Disabled actions are shown as faded out in the code action menu when - /// the user request a more specific type of code action, such as - /// refactorings. + /// - Disabled actions are shown as faded out in the code action menu when + /// the user requests a more specific type + /// of code action, such as refactorings. /// - /// - If the user has a keybinding that auto applies a code action and only - /// a disabled code actions are returned, the client should show the user - /// an error message with `reason` in the editor. - /// @since 3.16.0 + /// - If the user has a + /// [keybinding](https://code.visualstudio.com/docs/editor/refactoring#_keybindings-for-code-actions) + /// that auto applies a code action and only disabled code actions are + /// returned, the client should show the user an + /// error message with `reason` in the editor. + /// + /// @since 3.16.0 final CodeActionDisabled? disabled; /// The workspace edit this code action performs. @@ -1984,7 +2186,8 @@ class CodeAction implements ToJsonable { /// A quick fix should be marked preferred if it properly addresses the /// underlying error. A refactoring should be marked preferred if it is the /// most reasonable choice of actions to take. - /// @since 3.15.0 + /// + /// @since 3.15.0 final bool? isPreferred; /// The kind of the code action. @@ -2148,6 +2351,7 @@ class CodeAction implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// The Client Capabilities of a CodeActionRequest. class CodeActionClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( CodeActionClientCapabilities.canParse, @@ -2195,19 +2399,23 @@ class CodeActionClientCapabilities implements ToJsonable { ); } - /// The client supports code action literals as a valid response of the - /// `textDocument/codeAction` request. - /// @since 3.8.0 + /// The client support code action literals of type `CodeAction` as a valid + /// response of the `textDocument/codeAction` request. If the property is not + /// set the request can only return `Command` literals. + /// + /// @since 3.8.0 final CodeActionClientCapabilitiesCodeActionLiteralSupport? codeActionLiteralSupport; /// Whether code action supports the `data` property which is preserved /// between a `textDocument/codeAction` and a `codeAction/resolve` request. - /// @since 3.16.0 + /// + /// @since 3.16.0 final bool? dataSupport; /// Whether code action supports the `disabled` property. - /// @since 3.16.0 + /// + /// @since 3.16.0 final bool? disabledSupport; /// Whether code action supports dynamic registration. @@ -2217,16 +2425,19 @@ class CodeActionClientCapabilities implements ToJsonable { /// resource operations returned via the `CodeAction#edit` property by for /// example presenting the workspace edit in the user interface and asking for /// confirmation. - /// @since 3.16.0 + /// + /// @since 3.16.0 final bool? honorsChangeAnnotations; /// Whether code action supports the `isPreferred` property. - /// @since 3.15.0 + /// + /// @since 3.15.0 final bool? isPreferredSupport; /// Whether the client supports resolving additional code action properties /// via a separate `codeAction/resolve` request. - /// @since 3.16.0 + /// + /// @since 3.16.0 final CodeActionClientCapabilitiesResolveSupport? resolveSupport; @override @@ -2393,7 +2604,7 @@ class CodeActionClientCapabilitiesCodeActionLiteralSupport ); } - /// The code action kind is supported with the following value set. + /// The code action kind is support with the following value set. final CodeActionLiteralSupportCodeActionKind codeActionKind; @override @@ -2575,7 +2786,8 @@ class CodeActionContext implements ToJsonable { final List? only; /// The reason why code actions were requested. - /// @since 3.17.0 + /// + /// @since 3.17.0 final CodeActionTriggerKind? triggerKind; @override @@ -2738,7 +2950,7 @@ class CodeActionDisabled implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } -/// A set of predefined code action kinds. +/// A set of predefined code action kinds class CodeActionKind implements ToJsonable { const CodeActionKind(this._value); const CodeActionKind.fromJson(this._value); @@ -2752,13 +2964,13 @@ class CodeActionKind implements ToJsonable { /// Empty kind. static const Empty = CodeActionKind(''); - /// Base kind for quickfix actions: 'quickfix'. + /// Base kind for quickfix actions: 'quickfix' static const QuickFix = CodeActionKind('quickfix'); - /// Base kind for refactoring actions: 'refactor'. + /// Base kind for refactoring actions: 'refactor' static const Refactor = CodeActionKind('refactor'); - /// Base kind for refactoring extraction actions: 'refactor.extract'. + /// Base kind for refactoring extraction actions: 'refactor.extract' /// /// Example extract actions: /// @@ -2769,7 +2981,7 @@ class CodeActionKind implements ToJsonable { /// - ... static const RefactorExtract = CodeActionKind('refactor.extract'); - /// Base kind for refactoring inline actions: 'refactor.inline'. + /// Base kind for refactoring inline actions: 'refactor.inline' /// /// Example inline actions: /// @@ -2779,7 +2991,7 @@ class CodeActionKind implements ToJsonable { /// - ... static const RefactorInline = CodeActionKind('refactor.inline'); - /// Base kind for refactoring rewrite actions: 'refactor.rewrite'. + /// Base kind for refactoring rewrite actions: 'refactor.rewrite' /// /// Example rewrite actions: /// @@ -2791,19 +3003,21 @@ class CodeActionKind implements ToJsonable { /// - ... static const RefactorRewrite = CodeActionKind('refactor.rewrite'); - /// Base kind for source actions: `source`. + /// Base kind for source actions: `source` /// /// Source code actions apply to the entire file. static const Source = CodeActionKind('source'); - /// Base kind for a 'fix all' source action: `source.fixAll`. - /// 'Fix all' actions automatically fix errors that have a clear fix that do - /// not require user input. They should not suppress errors or perform unsafe + /// Base kind for auto-fix source actions: `source.fixAll`. + /// + /// Fix all actions automatically fix errors that have a clear fix that do not + /// require user input. They should not suppress errors or perform unsafe /// fixes such as generating new types or classes. - /// @since 3.17.0 + /// + /// @since 3.15.0 static const SourceFixAll = CodeActionKind('source.fixAll'); - /// Base kind for an organize imports source action: `source.organizeImports`. + /// Base kind for an organize imports source action: `source.organizeImports` static const SourceOrganizeImports = CodeActionKind('source.organizeImports'); @override @@ -2899,6 +3113,7 @@ class CodeActionLiteralSupportCodeActionKind implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Provider options for a CodeActionRequest. class CodeActionOptions implements WorkDoneProgressOptions, ToJsonable { static const jsonHandler = LspJsonHandler( CodeActionOptions.canParse, @@ -2937,7 +3152,8 @@ class CodeActionOptions implements WorkDoneProgressOptions, ToJsonable { /// The server provides support to resolve additional information for a code /// action. - /// @since 3.16.0 + /// + /// @since 3.16.0 final bool? resolveProvider; @override final bool? workDoneProgress; @@ -3023,7 +3239,7 @@ class CodeActionOptions implements WorkDoneProgressOptions, ToJsonable { String toString() => jsonEncoder.convert(toJson()); } -/// Params for the CodeActionRequest +/// The parameters of a CodeActionRequest. class CodeActionParams implements PartialResultParams, WorkDoneProgressParams, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -3218,6 +3434,7 @@ class CodeActionParams String toString() => jsonEncoder.convert(toJson()); } +/// Registration options for a CodeActionRequest. class CodeActionRegistrationOptions implements CodeActionOptions, TextDocumentRegistrationOptions, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -3267,7 +3484,8 @@ class CodeActionRegistrationOptions /// The server provides support to resolve additional information for a code /// action. - /// @since 3.16.0 + /// + /// @since 3.16.0 @override final bool? resolveProvider; @override @@ -3382,7 +3600,8 @@ class CodeActionRegistrationOptions } /// The reason why code actions were requested. -/// @since 3.17.0 +/// +/// @since 3.17.0 class CodeActionTriggerKind implements ToJsonable { const CodeActionTriggerKind(this._value); const CodeActionTriggerKind.fromJson(this._value); @@ -3417,7 +3636,8 @@ class CodeActionTriggerKind implements ToJsonable { } /// Structure to capture a description for an error code. -/// @since 3.16.0 +/// +/// @since 3.16.0 class CodeDescription implements ToJsonable { static const jsonHandler = LspJsonHandler( CodeDescription.canParse, @@ -3523,8 +3743,8 @@ class CodeLens implements ToJsonable { /// The command this code lens represents. final Command? command; - /// A data entry field that is preserved on a code lens item between a code - /// lens and a code lens resolve request. + /// A data entry field that is preserved on a code lens item between a + /// CodeLensRequest and a CodeLensResolveRequest final Object? data; /// The range in which this code lens is valid. Should only span a single @@ -3603,6 +3823,7 @@ class CodeLens implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// The client capabilities of a CodeLensRequest. class CodeLensClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( CodeLensClientCapabilities.canParse, @@ -3667,6 +3888,7 @@ class CodeLensClientCapabilities implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Code Lens provider options of a CodeLensRequest. class CodeLensOptions implements WorkDoneProgressOptions, ToJsonable { static const jsonHandler = LspJsonHandler( CodeLensOptions.canParse, @@ -3757,6 +3979,7 @@ class CodeLensOptions implements WorkDoneProgressOptions, ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// The parameters of a CodeLensRequest. class CodeLensParams implements PartialResultParams, WorkDoneProgressParams, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -3894,6 +4117,7 @@ class CodeLensParams String toString() => jsonEncoder.convert(toJson()); } +/// Registration options for a CodeLensRequest. class CodeLensRegistrationOptions implements CodeLensOptions, TextDocumentRegistrationOptions, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -4022,6 +4246,7 @@ class CodeLensRegistrationOptions String toString() => jsonEncoder.convert(toJson()); } +/// @since 3.16.0 class CodeLensWorkspaceClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( CodeLensWorkspaceClientCapabilities.canParse, @@ -4251,6 +4476,7 @@ class Color implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Represents a color range from a document. class ColorInformation implements ToJsonable { static const jsonHandler = LspJsonHandler( ColorInformation.canParse, @@ -4378,9 +4604,9 @@ class ColorPresentation implements ToJsonable { ); } - /// An optional array of additional text edits ([TextEdit]) that are applied - /// when selecting this color presentation. Edits must not overlap with the - /// main [edit](#ColorPresentation.textEdit) nor with themselves. + /// An optional array of additional text edits that are applied when selecting + /// this color presentation. Edits must not overlap with the main edit nor + /// with themselves. final List? additionalTextEdits; /// The label of this color presentation. It will be shown on the color picker @@ -4388,9 +4614,8 @@ class ColorPresentation implements ToJsonable { /// this color presentation. final String label; - /// An edit ([TextEdit]) which is applied to a document when selecting this - /// presentation for the color. When `falsy` the - /// [label](#ColorPresentation.label) is used. + /// An edit which is applied to a document when selecting this presentation + /// for the color. When `falsy` the label is used. final TextEdit? textEdit; @override @@ -4480,6 +4705,7 @@ class ColorPresentation implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Parameters for a ColorPresentationRequest. class ColorPresentationParams implements PartialResultParams, WorkDoneProgressParams, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -4527,7 +4753,7 @@ class ColorPresentationParams ); } - /// The color information to request presentations for. + /// The color to request presentations for. final Color color; /// An optional token that a server can use to report partial results (e.g. @@ -4674,6 +4900,10 @@ class ColorPresentationParams String toString() => jsonEncoder.convert(toJson()); } +/// Represents a reference to a command. Provides a title which will be used to +/// represent a command in the UI and, optionally, +/// an array of arguments which will be passed to the command handler function +/// when invoked. class Command implements ToJsonable { static const jsonHandler = LspJsonHandler( Command.canParse, @@ -4799,6 +5029,7 @@ class Command implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Completion client capabilities class CompletionClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( CompletionClientCapabilities.canParse, @@ -4852,7 +5083,8 @@ class CompletionClientCapabilities implements ToJsonable { final CompletionClientCapabilitiesCompletionItemKind? completionItemKind; /// The client supports the following `CompletionList` specific capabilities. - /// @since 3.17.0 + /// + /// @since 3.17.0 final CompletionClientCapabilitiesCompletionList? completionList; /// The client supports to send additional context information for a @@ -4862,9 +5094,11 @@ class CompletionClientCapabilities implements ToJsonable { /// Whether completion supports dynamic registration. final bool? dynamicRegistration; - /// The client's default when the completion item doesn't provide a - /// `insertTextMode` property. - /// @since 3.17.0 + /// Defines how the client handles whitespace and indentation when accepting a + /// completion item that uses multi line text in either `insertText` or + /// `textEdit`. + /// + /// @since 3.17.0 final InsertTextMode? insertTextMode; @override @@ -5070,24 +5304,27 @@ class CompletionClientCapabilitiesCompletionItem implements ToJsonable { /// Client supports the deprecated property on a completion item. final bool? deprecatedSupport; - /// Client supports the follow content formats for the documentation property. - /// The order describes the preferred format of the client. + /// Client supports the following content formats for the documentation + /// property. The order describes the preferred format of the client. final List? documentationFormat; - /// Client supports insert replace edit to control different behavior if a + /// Client support insert replace edit to control different behavior if a /// completion item is inserted in the text or should replace text. - /// @since 3.16.0 + /// + /// @since 3.16.0 final bool? insertReplaceSupport; /// The client supports the `insertTextMode` property on a completion item to /// override the whitespace handling mode as defined by the client (see /// `insertTextMode`). - /// @since 3.16.0 + /// + /// @since 3.16.0 final CompletionItemInsertTextModeSupport? insertTextModeSupport; /// The client has support for completion item label details (see also /// `CompletionItemLabelDetails`). - /// @since 3.17.0 + /// + /// @since 3.17.0 final bool? labelDetailsSupport; /// Client supports the preselect property on a completion item. @@ -5095,23 +5332,25 @@ class CompletionClientCapabilitiesCompletionItem implements ToJsonable { /// Indicates which properties a client can resolve lazily on a completion /// item. Before version 3.16.0 only the predefined properties `documentation` - /// and `detail` could be resolved lazily. - /// @since 3.16.0 + /// and `details` could be resolved lazily. + /// + /// @since 3.16.0 final CompletionItemResolveSupport? resolveSupport; /// Client supports snippets as insert text. /// /// A snippet can define tab stops and placeholders with `$1`, `$2` and /// `${3:foo}`. `$0` defines the final tab stop, it defaults to the end of the - /// snippet. Placeholders with equal identifiers are linked, that is typing in - /// one will update others too. + /// snippet. Placeholders with equal identifiers are linked, + /// that is typing in one will update others too. final bool? snippetSupport; /// Client supports the tag property on a completion item. Clients supporting /// tags have to handle unknown tags gracefully. Clients especially need to /// preserve unknown tags when sending a completion item back to the server in /// a resolve call. - /// @since 3.15.0 + /// + /// @since 3.15.0 final CompletionItemTagSupport? tagSupport; @override @@ -5412,7 +5651,8 @@ class CompletionClientCapabilitiesCompletionList implements ToJsonable { /// The value lists the supported property names of the /// `CompletionList.itemDefaults` object. If omitted no properties are /// supported. - /// @since 3.17.0 + /// + /// @since 3.17.0 final List? itemDefaults; @override @@ -5561,6 +5801,8 @@ class CompletionContext implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// A completion item represents a text snippet that is proposed to complete +/// text that is being typed. class CompletionItem implements ToJsonable { static const jsonHandler = LspJsonHandler( CompletionItem.canParse, @@ -5706,11 +5948,11 @@ class CompletionItem implements ToJsonable { final List? commitCharacters; /// A data entry field that is preserved on a completion item between a - /// completion and a completion resolve request. + /// CompletionRequest and a CompletionResolveRequest. final CompletionItemResolutionInfo? data; /// Indicates if this item is deprecated. - /// @deprecated Use `tags` instead if supported. + /// @deprecated Use `tags` instead. final bool? deprecated; /// A human-readable string with additional information about this item, like @@ -5721,12 +5963,11 @@ class CompletionItem implements ToJsonable { final Either2? documentation; /// A string that should be used when filtering a set of completion items. - /// When `falsy` the label is used as the filter text for this item. + /// When `falsy` the label is used. final String? filterText; /// A string that should be inserted into a document when selecting this - /// completion. When `falsy` the label is used as the insert text for this - /// item. + /// completion. When `falsy` the label is used. /// /// The `insertText` is subject to interpretation by the client side. Some /// tools might not take the string literally. For example VS Code when code @@ -5745,15 +5986,14 @@ class CompletionItem implements ToJsonable { final InsertTextFormat? insertTextFormat; /// How whitespace and indentation is handled during completion item - /// insertion. If not provided the client's default value depends on the + /// insertion. If not provided the clients default value depends on the /// `textDocument.completion.insertTextMode` client capability. - /// @since 3.16.0 @since 3.17.0 - support for - /// `textDocument.completion.insertTextMode` + /// + /// @since 3.16.0 final InsertTextMode? insertTextMode; /// The kind of this completion item. Based of the kind an icon is chosen by - /// the editor. The standardized set of available values is defined in - /// `CompletionItemKind`. + /// the editor. final CompletionItemKind? kind; /// The label of this completion item. @@ -5766,37 +6006,35 @@ class CompletionItem implements ToJsonable { final String label; /// Additional details for the label - /// @since 3.17.0 + /// + /// @since 3.17.0 final CompletionItemLabelDetails? labelDetails; /// Select this item when showing. /// /// *Note* that only one completion item can be selected and that the tool / - /// client decides which item that is. The rule is that the *first* item of - /// those that match best is selected. + /// client decides which item that is. The rule is that the *first* + /// item of those that match best is selected. final bool? preselect; /// A string that should be used when comparing this item with other items. - /// When `falsy` the label is used as the sort text for this item. + /// When `falsy` the label is used. final String? sortText; /// Tags for this completion item. - /// @since 3.15.0 + /// + /// @since 3.15.0 final List? tags; /// An edit which is applied to a document when selecting this completion. - /// When an edit is provided the value of `insertText` is ignored. - /// - /// *Note:* The range of the edit must be a single line range and it must - /// contain the position at which completion has been requested. + /// When an edit is provided the value of insertText is ignored. /// /// Most editors support two different operations when accepting a completion /// item. One is to insert a completion text and the other is to replace an /// existing text with a completion text. Since this can usually not be /// predetermined by a server it can report both ranges. Clients need to - /// signal support for `InsertReplaceEdit`s via the - /// `textDocument.completion.completionItem.insertReplaceSupport` client - /// capability property. + /// signal support for `InsertReplaceEdits` via the + /// `textDocument.completion.insertReplaceSupport` client capability property. /// /// *Note 1:* The text edit's range as well as both ranges from an insert /// replace edit must be a [single line] and they must contain the position at @@ -5804,7 +6042,8 @@ class CompletionItem implements ToJsonable { /// *Note 2:* If an `InsertReplaceEdit` is returned the edit's insert range /// must be a prefix of the edit's replace range, that means it must be /// contained and starting at the same position. - /// @since 3.16.0 additional type `InsertReplaceEdit` + /// + /// @since 3.16.0 additional type `InsertReplaceEdit` final Either2? textEdit; /// The edit text used if the completion item is part of a CompletionList and @@ -5815,7 +6054,8 @@ class CompletionItem implements ToJsonable { /// /// If not provided and a list's default range is provided the label property /// is used as a text. - /// @since 3.17.0 + /// + /// @since 3.17.0 final String? textEditText; @override @@ -6386,7 +6626,8 @@ class CompletionItemKind implements ToJsonable { } /// Additional details for a completion item label. -/// @since 3.17.0 +/// +/// @since 3.17.0 class CompletionItemLabelDetails implements ToJsonable { static const jsonHandler = LspJsonHandler( CompletionItemLabelDetails.canParse, @@ -6409,13 +6650,14 @@ class CompletionItemLabelDetails implements ToJsonable { } /// An optional string which is rendered less prominently after {@link - /// CompletionItemLabelDetails.detail}. Should be used for fully qualified - /// names or file path. + /// CompletionItem.detail}. Should be used for fully qualified names and file + /// paths. final String? description; /// An optional string which is rendered less prominently directly after - /// {@link CompletionItem.label label}, without any spacing. Should be used - /// for function signatures or type annotations. + /// {@link CompletionItem.label label}, + /// without any spacing. Should be used for function signatures and type + /// annotations. final String? detail; @override @@ -6555,7 +6797,8 @@ class CompletionItemResolveSupport implements ToJsonable { /// Completion item tags are extra annotations that tweak the rendering of a /// completion item. -/// @since 3.15.0 +/// +/// @since 3.15.0 class CompletionItemTag implements ToJsonable { const CompletionItemTag(this._value); const CompletionItemTag.fromJson(this._value); @@ -6659,8 +6902,7 @@ class CompletionItemTagSupport implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } -/// Represents a collection of completion items ([CompletionItem]) to be -/// presented in the editor. +/// Represents a collection of completion items to be presented in the editor. class CompletionList implements ToJsonable { static const jsonHandler = LspJsonHandler( CompletionList.canParse, @@ -6691,8 +6933,8 @@ class CompletionList implements ToJsonable { ); } - /// This list is not complete. Further typing should result in recomputing - /// this list. + /// This list it not complete. Further typing results in recomputing this + /// list. /// /// Recomputed lists have all their items replaced (not appended) in the /// incomplete completion sessions. @@ -6708,7 +6950,8 @@ class CompletionList implements ToJsonable { /// /// Servers are only allowed to return default values if the client signals /// support for this via the `completionList.itemDefaults` capability. - /// @since 3.17.0 + /// + /// @since 3.17.0 final CompletionListItemDefaults? itemDefaults; /// The completion items. @@ -6854,23 +7097,28 @@ class CompletionListItemDefaults implements ToJsonable { } /// A default commit character set. - /// @since 3.17.0 + /// + /// @since 3.17.0 final List? commitCharacters; /// A default data value. - /// @since 3.17.0 + /// + /// @since 3.17.0 final Object? data; - /// A default edit range - /// @since 3.17.0 + /// A default edit range. + /// + /// @since 3.17.0 final Either2? editRange; - /// A default insert text format - /// @since 3.17.0 + /// A default insert text format. + /// + /// @since 3.17.0 final InsertTextFormat? insertTextFormat; - /// A default insert text mode - /// @since 3.17.0 + /// A default insert text mode. + /// + /// @since 3.17.0 final InsertTextMode? insertTextMode; @override @@ -7024,16 +7272,18 @@ class CompletionOptions implements WorkDoneProgressOptions, ToJsonable { /// The list of all possible characters that commit a completion. This field /// can be used if clients don't support individual commit characters per - /// completion item. See client capability - /// `completion.completionItem.commitCharactersSupport`. + /// completion item. See + /// `ClientCapabilities.textDocument.completion.completionItem.commitCharactersSupport` /// /// If a server provides both `allCommitCharacters` and commit characters on /// an individual completion item the ones on the completion item win. - /// @since 3.2.0 + /// + /// @since 3.2.0 final List? allCommitCharacters; /// The server supports the following `CompletionItem` specific capabilities. - /// @since 3.17.0 + /// + /// @since 3.17.0 final CompletionOptionsCompletionItem? completionItem; /// The server provides support to resolve additional information for a @@ -7189,7 +7439,8 @@ class CompletionOptionsCompletionItem implements ToJsonable { /// The server has support for completion item label details (see also /// `CompletionItemLabelDetails`) when receiving a completion item in a /// resolve call. - /// @since 3.17.0 + /// + /// @since 3.17.0 final bool? labelDetailsSupport; @override @@ -7236,6 +7487,7 @@ class CompletionOptionsCompletionItem implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Completion parameters class CompletionParams implements PartialResultParams, @@ -7289,8 +7541,9 @@ class CompletionParams ); } - /// The completion context. This is only available if the client specifies to - /// send this using the client capability `completion.contextSupport === true` + /// The completion context. This is only available it the client specifies to + /// send this using the client capability + /// `textDocument.completion.contextSupport === true` final CompletionContext? context; /// An optional token that a server can use to report partial results (e.g. @@ -7432,6 +7685,7 @@ class CompletionParams String toString() => jsonEncoder.convert(toJson()); } +/// Registration options for a CompletionRequest. class CompletionRegistrationOptions implements CompletionOptions, TextDocumentRegistrationOptions, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -7482,17 +7736,19 @@ class CompletionRegistrationOptions /// The list of all possible characters that commit a completion. This field /// can be used if clients don't support individual commit characters per - /// completion item. See client capability - /// `completion.completionItem.commitCharactersSupport`. + /// completion item. See + /// `ClientCapabilities.textDocument.completion.completionItem.commitCharactersSupport` /// /// If a server provides both `allCommitCharacters` and commit characters on /// an individual completion item the ones on the completion item win. - /// @since 3.2.0 + /// + /// @since 3.2.0 @override final List? allCommitCharacters; /// The server supports the following `CompletionItem` specific capabilities. - /// @since 3.17.0 + /// + /// @since 3.17.0 @override final CompletionOptionsCompletionItem? completionItem; @@ -7688,7 +7944,7 @@ class CompletionTriggerKind implements ToJsonable { /// `triggerCharacters` properties of the `CompletionRegistrationOptions`. static const TriggerCharacter = CompletionTriggerKind._(2); - /// Completion was re-triggered as the current completion list is incomplete. + /// Completion was re-triggered as current completion list is incomplete static const TriggerForIncompleteCompletions = CompletionTriggerKind._(3); @override @@ -7791,6 +8047,7 @@ class ConfigurationItem implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// The parameters of a configuration request. class ConfigurationParams implements ToJsonable { static const jsonHandler = LspJsonHandler( ConfigurationParams.canParse, @@ -7865,8 +8122,8 @@ class ConfigurationParams implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } -/// Create file operation -class CreateFile implements ToJsonable { +/// Create file operation. +class CreateFile implements ResourceOperation, ToJsonable { static const jsonHandler = LspJsonHandler( CreateFile.canParse, CreateFile.fromJson, @@ -7902,10 +8159,13 @@ class CreateFile implements ToJsonable { } /// An optional annotation identifier describing the operation. - /// @since 3.16.0 + /// + /// @since 3.16.0 + @override final String? annotationId; /// A create + @override final String kind; /// Additional options @@ -8108,7 +8368,8 @@ class CreateFileOptions implements ToJsonable { /// The parameters sent in notifications/requests for user-initiated creation of /// files. -/// @since 3.16.0 +/// +/// @since 3.16.0 class CreateFilesParams implements ToJsonable { static const jsonHandler = LspJsonHandler( CreateFilesParams.canParse, @@ -8183,6 +8444,7 @@ class CreateFilesParams implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// @since 3.14.0 class DeclarationClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( DeclarationClientCapabilities.canParse, @@ -8645,6 +8907,7 @@ class DeclarationRegistrationOptions String toString() => jsonEncoder.convert(toJson()); } +/// Client Capabilities for a DefinitionRequest. class DefinitionClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( DefinitionClientCapabilities.canParse, @@ -8670,7 +8933,8 @@ class DefinitionClientCapabilities implements ToJsonable { final bool? dynamicRegistration; /// The client supports additional metadata in the form of definition links. - /// @since 3.14.0 + /// + /// @since 3.14.0 final bool? linkSupport; @override @@ -8735,6 +8999,7 @@ class DefinitionClientCapabilities implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Server Capabilities for a DefinitionRequest. class DefinitionOptions implements WorkDoneProgressOptions, ToJsonable { static const jsonHandler = LspJsonHandler( DefinitionOptions.canParse, @@ -8801,6 +9066,7 @@ class DefinitionOptions implements WorkDoneProgressOptions, ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Parameters for a DefinitionRequest. class DefinitionParams implements PartialResultParams, @@ -8972,6 +9238,7 @@ class DefinitionParams String toString() => jsonEncoder.convert(toJson()); } +/// Registration options for a DefinitionRequest. class DefinitionRegistrationOptions implements DefinitionOptions, TextDocumentRegistrationOptions, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -9078,7 +9345,7 @@ class DefinitionRegistrationOptions } /// Delete file operation -class DeleteFile implements ToJsonable { +class DeleteFile implements ResourceOperation, ToJsonable { static const jsonHandler = LspJsonHandler( DeleteFile.canParse, DeleteFile.fromJson, @@ -9114,10 +9381,13 @@ class DeleteFile implements ToJsonable { } /// An optional annotation identifier describing the operation. - /// @since 3.16.0 + /// + /// @since 3.16.0 + @override final String? annotationId; /// A delete + @override final String kind; /// Delete options. @@ -9320,7 +9590,8 @@ class DeleteFileOptions implements ToJsonable { /// The parameters sent in notifications/requests for user-initiated deletes of /// files. -/// @since 3.16.0 +/// +/// @since 3.16.0 class DeleteFilesParams implements ToJsonable { static const jsonHandler = LspJsonHandler( DeleteFilesParams.canParse, @@ -9395,6 +9666,8 @@ class DeleteFilesParams implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Represents a diagnostic, such as a compiler error or warning. Diagnostic +/// objects are only valid in the scope of a resource. class Diagnostic implements ToJsonable { static const jsonHandler = LspJsonHandler( Diagnostic.canParse, @@ -9453,23 +9726,26 @@ class Diagnostic implements ToJsonable { ); } - /// The diagnostic's code, which might appear in the user interface. + /// The diagnostic's code, which usually appear in the user interface. final String? code; - /// An optional property to describe the error code. - /// @since 3.16.0 + /// An optional property to describe the error code. Requires the code field + /// (above) to be present/not null. + /// + /// @since 3.16.0 final CodeDescription? codeDescription; /// A data entry field that is preserved between a /// `textDocument/publishDiagnostics` notification and /// `textDocument/codeAction` request. - /// @since 3.16.0 + /// + /// @since 3.16.0 final Object? data; - /// The diagnostic's message. + /// The diagnostic's message. It usually appears in the user interface final String message; - /// The range at which the message applies. + /// The range at which the message applies final Range range; /// An array of related diagnostic information, e.g. when symbol-names within @@ -9481,11 +9757,12 @@ class Diagnostic implements ToJsonable { final DiagnosticSeverity? severity; /// A human-readable string describing the source of this diagnostic, e.g. - /// 'typescript' or 'super lint'. + /// 'typescript' or 'super lint'. It usually appears in the user interface. final String? source; /// Additional metadata about the diagnostic. - /// @since 3.15.0 + /// + /// @since 3.15.0 final List? tags; @override @@ -9672,7 +9949,8 @@ class Diagnostic implements ToJsonable { } /// Client capabilities specific to diagnostic pull requests. -/// @since 3.17.0 +/// +/// @since 3.17.0 class DiagnosticClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( DiagnosticClientCapabilities.canParse, @@ -9767,7 +10045,8 @@ class DiagnosticClientCapabilities implements ToJsonable { } /// Diagnostic options. -/// @since 3.17.0 +/// +/// @since 3.17.0 class DiagnosticOptions implements WorkDoneProgressOptions, ToJsonable { static const jsonHandler = LspJsonHandler( DiagnosticOptions.canParse, @@ -9919,7 +10198,8 @@ class DiagnosticOptions implements WorkDoneProgressOptions, ToJsonable { } /// Diagnostic registration options. -/// @since 3.17.0 +/// +/// @since 3.17.0 class DiagnosticRegistrationOptions implements DiagnosticOptions, @@ -10139,7 +10419,7 @@ class DiagnosticRegistrationOptions } /// Represents a related message and source code location for a diagnostic. This -/// should be used to point to code locations that cause or are related to a +/// should be used to point to code locations that cause or related to a /// diagnostics, e.g when duplicating a symbol in a scope. class DiagnosticRelatedInformation implements ToJsonable { static const jsonHandler = LspJsonHandler( @@ -10241,7 +10521,8 @@ class DiagnosticRelatedInformation implements ToJsonable { } /// Cancellation data returned from a diagnostic request. -/// @since 3.17.0 +/// +/// @since 3.17.0 class DiagnosticServerCancellationData implements ToJsonable { static const jsonHandler = LspJsonHandler( DiagnosticServerCancellationData.canParse, @@ -10311,6 +10592,7 @@ class DiagnosticServerCancellationData implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// The diagnostic's severity. class DiagnosticSeverity implements ToJsonable { const DiagnosticSeverity(this._value); const DiagnosticSeverity.fromJson(this._value); @@ -10348,7 +10630,8 @@ class DiagnosticSeverity implements ToJsonable { } /// The diagnostic tags. -/// @since 3.15.0 +/// +/// @since 3.15.0 class DiagnosticTag implements ToJsonable { const DiagnosticTag(this._value); const DiagnosticTag.fromJson(this._value); @@ -10385,7 +10668,8 @@ class DiagnosticTag implements ToJsonable { } /// Workspace client capabilities specific to diagnostic pull requests. -/// @since 3.17.0 +/// +/// @since 3.17.0 class DiagnosticWorkspaceClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( DiagnosticWorkspaceClientCapabilities.canParse, @@ -10524,6 +10808,7 @@ class DidChangeConfigurationClientCapabilities implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// The parameters of a change configuration notification. class DidChangeConfigurationParams implements ToJsonable { static const jsonHandler = LspJsonHandler( DidChangeConfigurationParams.canParse, @@ -10577,7 +10862,8 @@ class DidChangeConfigurationParams implements ToJsonable { } /// The params sent in a change notebook document notification. -/// @since 3.17.0 +/// +/// @since 3.17.0 class DidChangeNotebookDocumentParams implements ToJsonable { static const jsonHandler = LspJsonHandler( DidChangeNotebookDocumentParams.canParse, @@ -10603,19 +10889,25 @@ class DidChangeNotebookDocumentParams implements ToJsonable { /// The actual changes to the notebook document. /// - /// The change describes single state change to the notebook document. So it - /// moves a notebook document, its cells and its cell text document contents - /// from state S to S'. + /// The changes describe single state changes to the notebook document. So if + /// there are two changes c1 (at array index 0) and c2 (at array index 1) for + /// a notebook in state S then c1 moves the notebook from S to S' and c2 from + /// S' to S''. So c1 is computed on the state S and c2 is computed on the + /// state S'. /// /// To mirror the content of a notebook using change events use the following /// approach: /// - start with the same initial content - /// - apply the 'notebookDocument/didChange' notifications in the order + /// - apply the 'notebookDocument/didChange' notifications in the order you + /// receive them. + /// - apply the `NotebookChangeEvent`s in a single notification in the order /// you receive them. final NotebookDocumentChangeEvent change; /// The notebook document that did change. The version number points to the - /// version after all provided changes have been applied. + /// version after all provided changes have been applied. If only the text + /// document content of a cell changes the notebook version doesn't + /// necessarily have to change. final VersionedNotebookDocumentIdentifier notebookDocument; @override @@ -10694,6 +10986,7 @@ class DidChangeNotebookDocumentParams implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// The change text document notification's parameters. class DidChangeTextDocumentParams implements ToJsonable { static const jsonHandler = LspJsonHandler( DidChangeTextDocumentParams.canParse, @@ -10737,9 +11030,10 @@ class DidChangeTextDocumentParams implements ToJsonable { /// approach: /// - start with the same initial content /// - apply the 'textDocument/didChange' notifications in the order you - /// receive them. - /// - apply the `TextDocumentContentChangeEvent`s in a single notification - /// in the order you receive them. + /// receive them. + /// - apply the `TextDocumentContentChangeEvent`s in a single notification in + /// the order + /// you receive them. final List< Either2> contentChanges; @@ -10863,8 +11157,11 @@ class DidChangeWatchedFilesClientCapabilities implements ToJsonable { /// for file changes from the server side. final bool? dynamicRegistration; - /// Whether the client has support for relative patterns or not. - /// @since 3.17.0 + /// Whether the client has support for {@link RelativePattern relative + /// pattern} + /// or not. + /// + /// @since 3.17.0 final bool? relativePatternSupport; @override @@ -10930,6 +11227,7 @@ class DidChangeWatchedFilesClientCapabilities implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// The watched files change notification's parameters. class DidChangeWatchedFilesParams implements ToJsonable { static const jsonHandler = LspJsonHandler( DidChangeWatchedFilesParams.canParse, @@ -11005,7 +11303,7 @@ class DidChangeWatchedFilesParams implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } -/// Describe options to be used when registering for file system change events. +/// Describe options to be used when registered for text document change events. class DidChangeWatchedFilesRegistrationOptions implements ToJsonable { static const jsonHandler = LspJsonHandler( DidChangeWatchedFilesRegistrationOptions.canParse, @@ -11084,6 +11382,7 @@ class DidChangeWatchedFilesRegistrationOptions implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// The parameters of a `workspace/didChangeWorkspaceFolders` notification. class DidChangeWorkspaceFoldersParams implements ToJsonable { static const jsonHandler = LspJsonHandler( DidChangeWorkspaceFoldersParams.canParse, @@ -11156,7 +11455,8 @@ class DidChangeWorkspaceFoldersParams implements ToJsonable { } /// The params sent in a close notebook document notification. -/// @since 3.17.0 +/// +/// @since 3.17.0 class DidCloseNotebookDocumentParams implements ToJsonable { static const jsonHandler = LspJsonHandler( DidCloseNotebookDocumentParams.canParse, @@ -11267,6 +11567,7 @@ class DidCloseNotebookDocumentParams implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// The parameters sent in a close text document notification class DidCloseTextDocumentParams implements ToJsonable { static const jsonHandler = LspJsonHandler( DidCloseTextDocumentParams.canParse, @@ -11338,8 +11639,9 @@ class DidCloseTextDocumentParams implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } -/// The params sent in a open notebook document notification. -/// @since 3.17.0 +/// The params sent in an open notebook document notification. +/// +/// @since 3.17.0 class DidOpenNotebookDocumentParams implements ToJsonable { static const jsonHandler = LspJsonHandler( DidOpenNotebookDocumentParams.canParse, @@ -11448,6 +11750,7 @@ class DidOpenNotebookDocumentParams implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// The parameters sent in an open text document notification class DidOpenTextDocumentParams implements ToJsonable { static const jsonHandler = LspJsonHandler( DidOpenTextDocumentParams.canParse, @@ -11520,7 +11823,8 @@ class DidOpenTextDocumentParams implements ToJsonable { } /// The params sent in a save notebook document notification. -/// @since 3.17.0 +/// +/// @since 3.17.0 class DidSaveNotebookDocumentParams implements ToJsonable { static const jsonHandler = LspJsonHandler( DidSaveNotebookDocumentParams.canParse, @@ -11592,6 +11896,7 @@ class DidSaveNotebookDocumentParams implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// The parameters sent in a save text document notification class DidSaveTextDocumentParams implements ToJsonable { static const jsonHandler = LspJsonHandler( DidSaveTextDocumentParams.canParse, @@ -11704,7 +12009,9 @@ class DocumentColorClientCapabilities implements ToJsonable { ); } - /// Whether document color supports dynamic registration. + /// Whether implementation supports dynamic registration. If this is set to + /// `true` the client supports the new `DocumentColorRegistrationOptions` + /// return value for the corresponding server capability as well. final bool? dynamicRegistration; @override @@ -11818,6 +12125,7 @@ class DocumentColorOptions implements WorkDoneProgressOptions, ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Parameters for a DocumentColorRequest. class DocumentColorParams implements PartialResultParams, WorkDoneProgressParams, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -12090,7 +12398,8 @@ class DocumentColorRegistrationOptions } /// Parameters of the document diagnostic request. -/// @since 3.17.0 +/// +/// @since 3.17.0 class DocumentDiagnosticParams implements PartialResultParams, WorkDoneProgressParams, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -12273,40 +12582,9 @@ class DocumentDiagnosticParams String toString() => jsonEncoder.convert(toJson()); } -/// The document diagnostic report kinds. -/// @since 3.17.0 -class DocumentDiagnosticReportKind implements ToJsonable { - const DocumentDiagnosticReportKind(this._value); - const DocumentDiagnosticReportKind.fromJson(this._value); - - final String _value; - - static bool canParse(Object? obj, LspJsonReporter reporter) { - return obj is String; - } - - /// A diagnostic report with a full set of problems. - static const Full = DocumentDiagnosticReportKind('full'); - - /// A report indicating that the last returned report is still accurate. - static const Unchanged = DocumentDiagnosticReportKind('unchanged'); - - @override - Object toJson() => _value; - - @override - String toString() => _value.toString(); - - @override - int get hashCode => _value.hashCode; - - @override - bool operator ==(Object other) => - other is DocumentDiagnosticReportKind && other._value == _value; -} - /// A partial result for a document diagnostic report. -/// @since 3.17.0 +/// +/// @since 3.17.0 class DocumentDiagnosticReportPartialResult implements ToJsonable { static const jsonHandler = LspJsonHandler( DocumentDiagnosticReportPartialResult.canParse, @@ -12410,6 +12688,7 @@ class DocumentDiagnosticReportPartialResult implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Client capabilities of a DocumentFormattingRequest. class DocumentFormattingClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( DocumentFormattingClientCapabilities.canParse, @@ -12476,6 +12755,7 @@ class DocumentFormattingClientCapabilities implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Provider options for a DocumentFormattingRequest. class DocumentFormattingOptions implements WorkDoneProgressOptions, ToJsonable { static const jsonHandler = LspJsonHandler( DocumentFormattingOptions.canParse, @@ -12544,6 +12824,7 @@ class DocumentFormattingOptions implements WorkDoneProgressOptions, ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// The parameters of a DocumentFormattingRequest. class DocumentFormattingParams implements WorkDoneProgressParams, ToJsonable { static const jsonHandler = LspJsonHandler( DocumentFormattingParams.canParse, @@ -12678,6 +12959,7 @@ class DocumentFormattingParams implements WorkDoneProgressParams, ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Registration options for a DocumentFormattingRequest. class DocumentFormattingRegistrationOptions implements DocumentFormattingOptions, @@ -12814,7 +13096,7 @@ class DocumentHighlight implements ToJsonable { ); } - /// The highlight kind, default is DocumentHighlightKind.Text. + /// The highlight kind, default is text. final DocumentHighlightKind? kind; /// The range this highlight applies to. @@ -12885,6 +13167,7 @@ class DocumentHighlight implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Client Capabilities for a DocumentHighlightRequest. class DocumentHighlightClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( DocumentHighlightClientCapabilities.canParse, @@ -12985,6 +13268,7 @@ class DocumentHighlightKind implements ToJsonable { other is DocumentHighlightKind && other._value == _value; } +/// Provider options for a DocumentHighlightRequest. class DocumentHighlightOptions implements WorkDoneProgressOptions, ToJsonable { static const jsonHandler = LspJsonHandler( DocumentHighlightOptions.canParse, @@ -13053,6 +13337,7 @@ class DocumentHighlightOptions implements WorkDoneProgressOptions, ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Parameters for a DocumentHighlightRequest. class DocumentHighlightParams implements PartialResultParams, @@ -13225,6 +13510,7 @@ class DocumentHighlightParams String toString() => jsonEncoder.convert(toJson()); } +/// Registration options for a DocumentHighlightRequest. class DocumentHighlightRegistrationOptions implements DocumentHighlightOptions, @@ -13380,9 +13666,10 @@ class DocumentLink implements ToJsonable { /// /// If a tooltip is provided, is will be displayed in a string that includes /// instructions on how to trigger the link, such as `{0} (ctrl + click)`. The - /// specific instructions vary depending on OS, user settings, and - /// localization. - /// @since 3.15.0 + /// specific instructions vary depending on OS, + /// user settings, and localization. + /// + /// @since 3.15.0 final String? tooltip; @override @@ -13472,6 +13759,7 @@ class DocumentLink implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// The client capabilities of a DocumentLinkRequest. class DocumentLinkClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( DocumentLinkClientCapabilities.canParse, @@ -13497,7 +13785,8 @@ class DocumentLinkClientCapabilities implements ToJsonable { final bool? dynamicRegistration; /// Whether the client supports the `tooltip` property on `DocumentLink`. - /// @since 3.15.0 + /// + /// @since 3.15.0 final bool? tooltipSupport; @override @@ -13562,6 +13851,7 @@ class DocumentLinkClientCapabilities implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Provider options for a DocumentLinkRequest. class DocumentLinkOptions implements WorkDoneProgressOptions, ToJsonable { static const jsonHandler = LspJsonHandler( DocumentLinkOptions.canParse, @@ -13653,6 +13943,7 @@ class DocumentLinkOptions implements WorkDoneProgressOptions, ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// The parameters of a DocumentLinkRequest. class DocumentLinkParams implements PartialResultParams, WorkDoneProgressParams, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -13791,6 +14082,7 @@ class DocumentLinkParams String toString() => jsonEncoder.convert(toJson()); } +/// Registration options for a DocumentLinkRequest. class DocumentLinkRegistrationOptions implements DocumentLinkOptions, @@ -13922,6 +14214,7 @@ class DocumentLinkRegistrationOptions String toString() => jsonEncoder.convert(toJson()); } +/// Client capabilities of a DocumentOnTypeFormattingRequest. class DocumentOnTypeFormattingClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( DocumentOnTypeFormattingClientCapabilities.canParse, @@ -13988,6 +14281,7 @@ class DocumentOnTypeFormattingClientCapabilities implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Provider options for a DocumentOnTypeFormattingRequest. class DocumentOnTypeFormattingOptions implements ToJsonable { static const jsonHandler = LspJsonHandler( DocumentOnTypeFormattingOptions.canParse, @@ -14092,6 +14386,7 @@ class DocumentOnTypeFormattingOptions implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// The parameters of a DocumentOnTypeFormattingRequest. class DocumentOnTypeFormattingParams implements ToJsonable { static const jsonHandler = LspJsonHandler( DocumentOnTypeFormattingParams.canParse, @@ -14256,6 +14551,7 @@ class DocumentOnTypeFormattingParams implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Registration options for a DocumentOnTypeFormattingRequest. class DocumentOnTypeFormattingRegistrationOptions implements DocumentOnTypeFormattingOptions, @@ -14402,6 +14698,7 @@ class DocumentOnTypeFormattingRegistrationOptions String toString() => jsonEncoder.convert(toJson()); } +/// Client capabilities of a DocumentRangeFormattingRequest. class DocumentRangeFormattingClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( DocumentRangeFormattingClientCapabilities.canParse, @@ -14420,7 +14717,7 @@ class DocumentRangeFormattingClientCapabilities implements ToJsonable { ); } - /// Whether formatting supports dynamic registration. + /// Whether range formatting supports dynamic registration. final bool? dynamicRegistration; @override @@ -14468,6 +14765,7 @@ class DocumentRangeFormattingClientCapabilities implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Provider options for a DocumentRangeFormattingRequest. class DocumentRangeFormattingOptions implements WorkDoneProgressOptions, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -14537,6 +14835,7 @@ class DocumentRangeFormattingOptions String toString() => jsonEncoder.convert(toJson()); } +/// The parameters of a DocumentRangeFormattingRequest. class DocumentRangeFormattingParams implements WorkDoneProgressParams, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -14700,6 +14999,7 @@ class DocumentRangeFormattingParams String toString() => jsonEncoder.convert(toJson()); } +/// Registration options for a DocumentRangeFormattingRequest. class DocumentRangeFormattingRegistrationOptions implements DocumentRangeFormattingOptions, @@ -14868,7 +15168,8 @@ class DocumentSymbol implements ToJsonable { final List? children; /// Indicates if this symbol is deprecated. - /// @deprecated Use tags instead + /// + /// @deprecated Use tags instead final bool? deprecated; /// More detail for this symbol, e.g the signature of a function. @@ -14889,11 +15190,12 @@ class DocumentSymbol implements ToJsonable { final Range range; /// The range that should be selected and revealed when this symbol is being - /// picked, e.g. the name of a function. Must be contained by the `range`. + /// picked, e.g the name of a function. Must be contained by the `range`. final Range selectionRange; /// Tags for this document symbol. - /// @since 3.16.0 + /// + /// @since 3.16.0 final List? tags; @override @@ -15077,6 +15379,7 @@ class DocumentSymbol implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Client Capabilities for a DocumentSymbolRequest. class DocumentSymbolClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( DocumentSymbolClientCapabilities.canParse, @@ -15126,7 +15429,8 @@ class DocumentSymbolClientCapabilities implements ToJsonable { /// The client supports an additional label presented in the UI when /// registering a document symbol provider. - /// @since 3.16.0 + /// + /// @since 3.16.0 final bool? labelSupport; /// Specific capabilities for the `SymbolKind` in the @@ -15136,7 +15440,8 @@ class DocumentSymbolClientCapabilities implements ToJsonable { /// The client supports tags on `SymbolInformation`. Tags are supported on /// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set to true. /// Clients supporting tags have to handle unknown tags gracefully. - /// @since 3.16.0 + /// + /// @since 3.16.0 final DocumentSymbolClientCapabilitiesTagSupport? tagSupport; @override @@ -15410,6 +15715,7 @@ class DocumentSymbolClientCapabilitiesTagSupport implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Provider options for a DocumentSymbolRequest. class DocumentSymbolOptions implements WorkDoneProgressOptions, ToJsonable { static const jsonHandler = LspJsonHandler( DocumentSymbolOptions.canParse, @@ -15436,7 +15742,8 @@ class DocumentSymbolOptions implements WorkDoneProgressOptions, ToJsonable { /// A human-readable string that is shown when multiple outlines trees are /// shown for the same document. - /// @since 3.16.0 + /// + /// @since 3.16.0 final String? label; @override final bool? workDoneProgress; @@ -15503,6 +15810,7 @@ class DocumentSymbolOptions implements WorkDoneProgressOptions, ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Parameters for a DocumentSymbolRequest. class DocumentSymbolParams implements PartialResultParams, WorkDoneProgressParams, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -15641,6 +15949,7 @@ class DocumentSymbolParams String toString() => jsonEncoder.convert(toJson()); } +/// Registration options for a DocumentSymbolRequest. class DocumentSymbolRegistrationOptions implements DocumentSymbolOptions, @@ -15680,7 +15989,8 @@ class DocumentSymbolRegistrationOptions /// A human-readable string that is shown when multiple outlines trees are /// shown for the same document. - /// @since 3.16.0 + /// + /// @since 3.16.0 @override final String? label; @override @@ -15774,6 +16084,7 @@ class DocumentSymbolRegistrationOptions String toString() => jsonEncoder.convert(toJson()); } +/// Predefined error codes. class ErrorCodes implements ToJsonable { const ErrorCodes(this._value); const ErrorCodes.fromJson(this._value); @@ -15796,30 +16107,32 @@ class ErrorCodes implements ToJsonable { static const InvalidParams = ErrorCodes(-32602); static const InvalidRequest = ErrorCodes(-32600); - /// This is the end range of JSON-RPC reserved error codes. It doesn't denote + /// This is the end range of JSON RPC reserved error codes. It doesn't denote /// a real error code. - /// @since 3.16.0 + /// + /// @since 3.16.0 static const jsonrpcReservedErrorRangeEnd = ErrorCodes(-32000); - /// This is the start range of JSON-RPC reserved error codes. It doesn't - /// denote a real error code. No LSP error codes should be defined between the - /// start and end range. For backwards compatibility the + /// This is the start range of JSON RPC reserved error codes. It doesn't + /// denote a real error code. No application error codes should be defined + /// between the start and end range. For backwards compatibility the /// `ServerNotInitialized` and the `UnknownErrorCode` are left in the range. - /// @since 3.16.0 + /// + /// @since 3.16.0 static const jsonrpcReservedErrorRangeStart = ErrorCodes(-32099); /// This is the end range of LSP reserved error codes. It doesn't denote a /// real error code. - /// @since 3.16.0 + /// + /// @since 3.16.0 static const lspReservedErrorRangeEnd = ErrorCodes(-32800); /// This is the start range of LSP reserved error codes. It doesn't denote a /// real error code. - /// @since 3.16.0 + /// + /// @since 3.16.0 static const lspReservedErrorRangeStart = ErrorCodes(-32899); static const MethodNotFound = ErrorCodes(-32601); - - /// Defined by JSON-RPC static const ParseError = ErrorCodes(-32700); /// The client has canceled a request and a server as detected the cancel. @@ -15828,12 +16141,14 @@ class ErrorCodes implements ToJsonable { /// A request failed but it was syntactically correct, e.g the method name was /// known and the parameters were valid. The error message should contain /// human readable information about why the request failed. - /// @since 3.17.0 + /// + /// @since 3.17.0 static const RequestFailed = ErrorCodes(-32803); /// The server cancelled the request. This error code should only be used for /// requests that explicitly support being server cancellable. - /// @since 3.17.0 + /// + /// @since 3.17.0 static const ServerCancelled = ErrorCodes(-32802); /// Error code indicating that a server received a notification or request @@ -15855,6 +16170,7 @@ class ErrorCodes implements ToJsonable { other is ErrorCodes && other._value == _value; } +/// The client capabilities of a ExecuteCommandRequest. class ExecuteCommandClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( ExecuteCommandClientCapabilities.canParse, @@ -15919,6 +16235,7 @@ class ExecuteCommandClientCapabilities implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// The server capabilities of a ExecuteCommandRequest. class ExecuteCommandOptions implements WorkDoneProgressOptions, ToJsonable { static const jsonHandler = LspJsonHandler( ExecuteCommandOptions.canParse, @@ -16019,6 +16336,7 @@ class ExecuteCommandOptions implements WorkDoneProgressOptions, ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// The parameters of a ExecuteCommandRequest. class ExecuteCommandParams implements WorkDoneProgressParams, ToJsonable { static const jsonHandler = LspJsonHandler( ExecuteCommandParams.canParse, @@ -16148,7 +16466,7 @@ class ExecuteCommandParams implements WorkDoneProgressParams, ToJsonable { String toString() => jsonEncoder.convert(toJson()); } -/// Execute command registration options. +/// Registration options for a ExecuteCommandRequest. class ExecuteCommandRegistrationOptions implements ExecuteCommandOptions, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -16393,7 +16711,7 @@ class FailureHandlingKind implements ToJsonable { other is FailureHandlingKind && other._value == _value; } -/// The file event type. +/// The file event type class FileChangeType implements ToJsonable { const FileChangeType(this._value); const FileChangeType.fromJson(this._value); @@ -16428,7 +16746,8 @@ class FileChangeType implements ToJsonable { } /// Represents information on a file/folder create. -/// @since 3.16.0 +/// +/// @since 3.16.0 class FileCreate implements ToJsonable { static const jsonHandler = LspJsonHandler( FileCreate.canParse, @@ -16499,7 +16818,8 @@ class FileCreate implements ToJsonable { } /// Represents information on a file/folder delete. -/// @since 3.16.0 +/// +/// @since 3.16.0 class FileDelete implements ToJsonable { static const jsonHandler = LspJsonHandler( FileDelete.canParse, @@ -16582,7 +16902,7 @@ class FileEvent implements ToJsonable { }); static FileEvent fromJson(Map json) { final typeJson = json['type']; - final type = typeJson as int; + final type = FileChangeType.fromJson(typeJson as int); final uriJson = json['uri']; final uri = uriJson as String; return FileEvent( @@ -16592,15 +16912,15 @@ class FileEvent implements ToJsonable { } /// The change type. - final int type; + final FileChangeType type; - /// The file's URI. + /// The file's uri. final String uri; @override Map toJson() { var result = {}; - result['type'] = type; + result['type'] = type.toJson(); result['uri'] = uri; return result; } @@ -16618,8 +16938,8 @@ class FileEvent implements ToJsonable { reporter.reportError('must not be null'); return false; } - if (type is! int) { - reporter.reportError('must be of type int'); + if (!FileChangeType.canParse(type, reporter)) { + reporter.reportError('must be of type FileChangeType'); return false; } } finally { @@ -16668,6 +16988,13 @@ class FileEvent implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Capabilities relating to events from file operations by the user in the +/// client. +/// +/// These events do not come from the file system, they come from user +/// operations like renaming a file in the UI. +/// +/// @since 3.16.0 class FileOperationClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( FileOperationClientCapabilities.canParse, @@ -16869,8 +17196,9 @@ class FileOperationClientCapabilities implements ToJsonable { } /// A filter to describe in which file operation requests or notifications the -/// server is interested in. -/// @since 3.16.0 +/// server is interested in receiving. +/// +/// @since 3.16.0 class FileOperationFilter implements ToJsonable { static const jsonHandler = LspJsonHandler( FileOperationFilter.canParse, @@ -16896,7 +17224,7 @@ class FileOperationFilter implements ToJsonable { /// The actual file operation pattern. final FileOperationPattern pattern; - /// A Uri like `file` or `untitled`. + /// A Uri scheme like `file` or `untitled`. final String? scheme; @override @@ -16965,6 +17293,9 @@ class FileOperationFilter implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Options for notifications/requests for user operations on files. +/// +/// @since 3.16.0 class FileOperationOptions implements ToJsonable { static const jsonHandler = LspJsonHandler( FileOperationOptions.canParse, @@ -17173,8 +17504,9 @@ class FileOperationOptions implements ToJsonable { } /// A pattern to describe in which file operation requests or notifications the -/// server is interested in. -/// @since 3.16.0 +/// server is interested in receiving. +/// +/// @since 3.16.0 class FileOperationPattern implements ToJsonable { static const jsonHandler = LspJsonHandler( FileOperationPattern.canParse, @@ -17210,12 +17542,12 @@ class FileOperationPattern implements ToJsonable { /// - `?` to match on one character in a path segment /// - `**` to match any number of path segments, including none /// - `{}` to group sub patterns into an OR expression. (e.g. `**​/*.{ts,js}` - /// matches all TypeScript and JavaScript files) - /// - `[]` to declare a range of characters to match in a path segment - /// (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …) + /// matches all TypeScript and JavaScript files) + /// - `[]` to declare a range of characters to match in a path segment (e.g., + /// `example.[0-9]` to match on `example.0`, `example.1`, …) /// - `[!...]` to negate a range of characters to match in a path segment - /// (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but - /// not `example.0`) + /// (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not + /// `example.0`) final String glob; /// Whether to match files or folders with this pattern. @@ -17312,7 +17644,8 @@ class FileOperationPattern implements ToJsonable { } /// A pattern kind describing if a glob pattern matches a file a folder or both. -/// @since 3.16.0 +/// +/// @since 3.16.0 class FileOperationPatternKind implements ToJsonable { const FileOperationPatternKind(this._value); const FileOperationPatternKind.fromJson(this._value); @@ -17344,7 +17677,8 @@ class FileOperationPatternKind implements ToJsonable { } /// Matching options for the file operation pattern. -/// @since 3.16.0 +/// +/// @since 3.16.0 class FileOperationPatternOptions implements ToJsonable { static const jsonHandler = LspJsonHandler( FileOperationPatternOptions.canParse, @@ -17410,7 +17744,8 @@ class FileOperationPatternOptions implements ToJsonable { } /// The options to register for file operations. -/// @since 3.16.0 +/// +/// @since 3.16.0 class FileOperationRegistrationOptions implements ToJsonable { static const jsonHandler = LspJsonHandler( FileOperationRegistrationOptions.canParse, @@ -17489,7 +17824,8 @@ class FileOperationRegistrationOptions implements ToJsonable { } /// Represents information on a file/folder rename. -/// @since 3.16.0 +/// +/// @since 3.16.0 class FileRename implements ToJsonable { static const jsonHandler = LspJsonHandler( FileRename.canParse, @@ -17616,7 +17952,8 @@ class FileSystemWatcher implements ToJsonable { /// The glob pattern to watch. See {@link GlobPattern glob pattern} for more /// detail. - /// @since 3.17.0 support for relative patterns. + /// + /// @since 3.17.0 support for relative patterns. final Either2 globPattern; /// The kind of events of interest. If omitted it defaults to WatchKind.Create @@ -17734,7 +18071,8 @@ class FoldingRange implements ToJsonable { /// The text that the client should show when the specified range is /// collapsed. If not defined or not supported by the client, a default will /// be chosen by the client. - /// @since 3.17.0 - proposed + /// + /// @since 3.17.0 final String? collapsedText; /// The zero-based character offset before the folded range ends. If not @@ -17746,9 +18084,9 @@ class FoldingRange implements ToJsonable { /// smaller than the number of lines in the document. final int endLine; - /// Describes the kind of the folding range such as `comment` or `region`. The + /// Describes the kind of the folding range such as `comment' or 'region'. The /// kind is used to categorize folding ranges and used by commands like 'Fold - /// all comments'. See [FoldingRangeKind] for an enumeration of standardized + /// all comments'. See FoldingRangeKind for an enumeration of standardized /// kinds. final FoldingRangeKind? kind; @@ -17939,11 +18277,14 @@ class FoldingRangeClientCapabilities implements ToJsonable { /// server capability as well. final bool? dynamicRegistration; - /// Specific options for the folding range. @since 3.17.0 + /// Specific options for the folding range. + /// + /// @since 3.17.0 final FoldingRangeClientCapabilitiesFoldingRange? foldingRange; /// Specific options for the folding range kind. - /// @since 3.17.0 + /// + /// @since 3.17.0 final FoldingRangeClientCapabilitiesFoldingRangeKind? foldingRangeKind; /// If set, the client signals that it only supports folding complete lines. @@ -18089,7 +18430,8 @@ class FoldingRangeClientCapabilitiesFoldingRange implements ToJsonable { /// If set, the client signals that it supports setting collapsedText on /// folding ranges to display custom labels instead of the default text. - /// @since 3.17.0 + /// + /// @since 3.17.0 final bool? collapsedText; @override @@ -18226,7 +18568,7 @@ class FoldingRangeKind implements ToJsonable { /// Folding range for a comment static const Comment = FoldingRangeKind('comment'); - /// Folding range for a imports or includes + /// Folding range for an import or include static const Imports = FoldingRangeKind('imports'); /// Folding range for a region (e.g. `#region`) @@ -18313,6 +18655,7 @@ class FoldingRangeOptions implements WorkDoneProgressOptions, ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Parameters for a FoldingRangeRequest. class FoldingRangeParams implements PartialResultParams, WorkDoneProgressParams, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -18619,7 +18962,8 @@ class FormattingOptions implements ToJsonable { } /// Insert a newline character at the end of the file if one does not exist. - /// @since 3.15.0 + /// + /// @since 3.15.0 final bool? insertFinalNewline; /// Prefer spaces over tabs. @@ -18629,11 +18973,13 @@ class FormattingOptions implements ToJsonable { final int tabSize; /// Trim all newlines after the final newline at the end of the file. - /// @since 3.15.0 + /// + /// @since 3.15.0 final bool? trimFinalNewlines; /// Trim trailing whitespace on a line. - /// @since 3.15.0 + /// + /// @since 3.15.0 final bool? trimTrailingWhitespace; @override @@ -18755,7 +19101,8 @@ class FormattingOptions implements ToJsonable { } /// A diagnostic report with a full set of problems. -/// @since 3.17.0 +/// +/// @since 3.17.0 class FullDocumentDiagnosticReport implements ToJsonable { static const jsonHandler = LspJsonHandler( FullDocumentDiagnosticReport.canParse, @@ -18896,6 +19243,9 @@ class FullDocumentDiagnosticReport implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// General client capabilities. +/// +/// @since 3.16.0 class GeneralClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( GeneralClientCapabilities.canParse, @@ -18937,12 +19287,13 @@ class GeneralClientCapabilities implements ToJsonable { } /// Client capabilities specific to the client's markdown parser. - /// @since 3.16.0 + /// + /// @since 3.16.0 final MarkdownClientCapabilities? markdown; /// The position encodings supported by the client. Client and server have to /// agree on the same position encoding to ensure that offsets (e.g. character - /// position in a line) are interpreted the same on both side. + /// position in a line) are interpreted the same on both sides. /// /// To keep the protocol backwards compatible the following applies: if the /// value 'utf-16' is missing from the array of position encodings servers can @@ -18954,17 +19305,20 @@ class GeneralClientCapabilities implements ToJsonable { /// Implementation considerations: since the conversion from one encoding into /// another requires the content of the file / line the conversion is best /// done where the file is read which is usually on the server side. - /// @since 3.17.0 + /// + /// @since 3.17.0 final List? positionEncodings; /// Client capabilities specific to regular expressions. - /// @since 3.16.0 + /// + /// @since 3.16.0 final RegularExpressionsClientCapabilities? regularExpressions; /// Client capability that signals how the client handles stale requests (e.g. /// a request for which the client will not process the response anymore since /// the information is outdated). - /// @since 3.17.0 + /// + /// @since 3.17.0 final GeneralClientCapabilitiesStaleRequestSupport? staleRequestSupport; @override @@ -19099,7 +19453,7 @@ class GeneralClientCapabilitiesStaleRequestSupport implements ToJsonable { final bool cancel; /// The list of requests for which the client will retry the request if it - /// receives a response with error code `ContentModified`` + /// receives a response with error code `ContentModified` final List retryOnContentModified; @override @@ -19211,8 +19565,8 @@ class Hover implements ToJsonable { /// The hover's content final Either2 contents; - /// An optional range is a range inside a text document that is used to - /// visualize a hover, e.g. by changing the background color. + /// An optional range inside the text document that is used to visualize the + /// hover, e.g. by changing the background color. final Range? range; @override @@ -19305,9 +19659,8 @@ class HoverClientCapabilities implements ToJsonable { ); } - /// Client supports the follow content formats if the content property refers - /// to a `literal of type MarkupContent`. The order describes the preferred - /// format of the client. + /// Client supports the following content formats for the content property. + /// The order describes the preferred format of the client. final List? contentFormat; /// Whether hover supports dynamic registration. @@ -19380,6 +19733,7 @@ class HoverClientCapabilities implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Hover options. class HoverOptions implements WorkDoneProgressOptions, ToJsonable { static const jsonHandler = LspJsonHandler( HoverOptions.canParse, @@ -19446,6 +19800,7 @@ class HoverOptions implements WorkDoneProgressOptions, ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Parameters for a HoverRequest. class HoverParams implements TextDocumentPositionParams, WorkDoneProgressParams, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -19581,6 +19936,7 @@ class HoverParams String toString() => jsonEncoder.convert(toJson()); } +/// Registration options for a HoverRequest. class HoverRegistrationOptions implements HoverOptions, TextDocumentRegistrationOptions, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -19686,6 +20042,7 @@ class HoverRegistrationOptions String toString() => jsonEncoder.convert(toJson()); } +/// @since 3.6.0 class ImplementationClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( ImplementationClientCapabilities.canParse, @@ -19713,7 +20070,8 @@ class ImplementationClientCapabilities implements ToJsonable { final bool? dynamicRegistration; /// The client supports additional metadata in the form of definition links. - /// @since 3.14.0 + /// + /// @since 3.14.0 final bool? linkSupport; @override @@ -20150,6 +20508,7 @@ class ImplementationRegistrationOptions String toString() => jsonEncoder.convert(toJson()); } +/// The initialize parameters class InitializeParams implements WorkDoneProgressParams, ToJsonable { static const jsonHandler = LspJsonHandler( InitializeParams.canParse, @@ -20188,9 +20547,10 @@ class InitializeParams implements WorkDoneProgressParams, ToJsonable { final rootUriJson = json['rootUri']; final rootUri = rootUriJson as String?; final traceJson = json['trace']; - final trace = const {null, 'off', 'messages', 'verbose'}.contains(traceJson) + final trace = const {null, 'off', 'messages', 'compact', 'verbose'} + .contains(traceJson) ? traceJson as String? - : throw '''$traceJson was not one of (null, 'off', 'messages', 'verbose')'''; + : throw '''$traceJson was not one of (null, 'off', 'messages', 'compact', 'verbose')'''; final workDoneTokenJson = json['workDoneToken']; final workDoneToken = workDoneTokenJson == null ? null @@ -20221,7 +20581,8 @@ class InitializeParams implements WorkDoneProgressParams, ToJsonable { final ClientCapabilities capabilities; /// Information about the client - /// @since 3.15.0 + /// + /// @since 3.15.0 final InitializeParamsClientInfo? clientInfo; /// User provided initialization options. @@ -20232,22 +20593,25 @@ class InitializeParams implements WorkDoneProgressParams, ToJsonable { /// /// Uses IETF language tags as the value's syntax (See /// https://en.wikipedia.org/wiki/IETF_language_tag) - /// @since 3.16.0 + /// + /// @since 3.16.0 final String? locale; - /// The process Id of the parent process that started the server. Is null if - /// the process has not been started by another process. If the parent process - /// is not alive then the server should exit (see exit notification) its - /// process. + /// The process Id of the parent process that started the server. + /// + /// Is `null` if the process has not been started by another process. If the + /// parent process is not alive then the server should exit. final int? processId; /// The rootPath of the workspace. Is null if no folder is open. - /// @deprecated in favour of `rootUri`. + /// + /// @deprecated in favour of rootUri. final String? rootPath; /// The rootUri of the workspace. Is null if no folder is open. If both /// `rootPath` and `rootUri` are set `rootUri` wins. - /// @deprecated in favour of `workspaceFolders` + /// + /// @deprecated in favour of workspaceFolders. final String? rootUri; /// The initial trace setting. If omitted trace is disabled ('off'). @@ -20258,10 +20622,12 @@ class InitializeParams implements WorkDoneProgressParams, ToJsonable { final Either2? workDoneToken; /// The workspace folders configured in the client when the server starts. + /// /// This property is only available if the client supports workspace folders. /// It can be `null` if the client supports workspace folders but none are /// configured. - /// @since 3.6.0 + /// + /// @since 3.6.0 final List? workspaceFolders; @override @@ -20380,9 +20746,10 @@ class InitializeParams implements WorkDoneProgressParams, ToJsonable { if (trace != null && trace != 'off' && trace != 'messages' && + trace != 'compact' && trace != 'verbose') { reporter.reportError( - 'must be one of the literals \'off\', \'messages\', \'verbose\''); + 'must be one of the literals \'off\', \'messages\', \'compact\', \'verbose\''); return false; } } finally { @@ -20550,6 +20917,7 @@ class InitializeParamsClientInfo implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// The result returned from an initialize request. class InitializeResult implements ToJsonable { static const jsonHandler = LspJsonHandler( InitializeResult.canParse, @@ -20579,7 +20947,8 @@ class InitializeResult implements ToJsonable { final ServerCapabilities capabilities; /// Information about the server. - /// @since 3.15.0 + /// + /// @since 3.15.0 final InitializeResultServerInfo? serverInfo; @override @@ -20781,7 +21150,8 @@ class InitializedParams implements ToJsonable { } /// Inlay hint information. -/// @since 3.17.0 +/// +/// @since 3.17.0 class InlayHint implements ToJsonable { static const jsonHandler = LspJsonHandler( InlayHint.canParse, @@ -20846,7 +21216,7 @@ class InlayHint implements ToJsonable { ); } - /// A data entry field that is preserved on a inlay hint between a + /// A data entry field that is preserved on an inlay hint between a /// `textDocument/inlayHint` and a `inlayHint/resolve` request. final Object? data; @@ -20882,15 +21252,9 @@ class InlayHint implements ToJsonable { /// *Note* that edits are expected to change the document so that the inlay /// hint (or its nearest variant) is now part of the document and the inlay /// hint itself is now obsolete. - /// - /// Depending on the client capability `inlayHint.resolveSupport` clients - /// might resolve this property late using the resolve request. final List? textEdits; /// The tooltip text when you hover over this item. - /// - /// Depending on the client capability `inlayHint.resolveSupport` clients - /// might resolve this property late using the resolve request. final Either2? tooltip; @override @@ -21056,7 +21420,8 @@ class InlayHint implements ToJsonable { } /// Inlay hint client capabilities. -/// @since 3.17.0 +/// +/// @since 3.17.0 class InlayHintClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( InlayHintClientCapabilities.canParse, @@ -21084,7 +21449,7 @@ class InlayHintClientCapabilities implements ToJsonable { /// Whether inlay hints support dynamic registration. final bool? dynamicRegistration; - /// Indicates which properties a client can resolve lazily on a inlay hint. + /// Indicates which properties a client can resolve lazily on an inlay hint. final InlayHintClientCapabilitiesResolveSupport? resolveSupport; @override @@ -21230,7 +21595,8 @@ class InlayHintClientCapabilitiesResolveSupport implements ToJsonable { } /// Inlay hint kinds. -/// @since 3.17.0 +/// +/// @since 3.17.0 class InlayHintKind implements ToJsonable { const InlayHintKind(this._value); const InlayHintKind.fromJson(this._value); @@ -21263,7 +21629,8 @@ class InlayHintKind implements ToJsonable { /// An inlay hint label part allows for interactive and composite labels of /// inlay hints. -/// @since 3.17.0 +/// +/// @since 3.17.0 class InlayHintLabelPart implements ToJsonable { static const jsonHandler = LspJsonHandler( InlayHintLabelPart.canParse, @@ -21315,8 +21682,8 @@ class InlayHintLabelPart implements ToJsonable { /// The editor will use this location for the hover and for code navigation /// features: This part will become a clickable link that resolves to the /// definition of the symbol at the given location (not necessarily the - /// location itself), it shows the hover that shows at the given location, and - /// it shows a context menu with further code navigation commands. + /// location itself), it shows the hover that shows at the given location, + /// and it shows a context menu with further code navigation commands. /// /// Depending on the client capability `inlayHint.resolveSupport` clients /// might resolve this property late using the resolve request. @@ -21432,7 +21799,8 @@ class InlayHintLabelPart implements ToJsonable { } /// Inlay hint options used during static registration. -/// @since 3.17.0 +/// +/// @since 3.17.0 class InlayHintOptions implements WorkDoneProgressOptions, ToJsonable { static const jsonHandler = LspJsonHandler( InlayHintOptions.canParse, @@ -21525,7 +21893,8 @@ class InlayHintOptions implements WorkDoneProgressOptions, ToJsonable { } /// A parameter literal used in inlay hint requests. -/// @since 3.17.0 +/// +/// @since 3.17.0 class InlayHintParams implements WorkDoneProgressParams, ToJsonable { static const jsonHandler = LspJsonHandler( InlayHintParams.canParse, @@ -21558,7 +21927,7 @@ class InlayHintParams implements WorkDoneProgressParams, ToJsonable { ); } - /// The visible document range for which inlay hints should be computed. + /// The document range for which inlay hints should be computed. final Range range; /// The text document. @@ -21659,7 +22028,8 @@ class InlayHintParams implements WorkDoneProgressParams, ToJsonable { } /// Inlay hint options used during static or dynamic registration. -/// @since 3.17.0 +/// +/// @since 3.17.0 class InlayHintRegistrationOptions implements InlayHintOptions, @@ -21818,7 +22188,8 @@ class InlayHintRegistrationOptions } /// Client workspace capabilities specific to inlay hints. -/// @since 3.17.0 +/// +/// @since 3.17.0 class InlayHintWorkspaceClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( InlayHintWorkspaceClientCapabilities.canParse, @@ -21892,7 +22263,8 @@ class InlayHintWorkspaceClientCapabilities implements ToJsonable { } /// Client capabilities specific to inline values. -/// @since 3.17.0 +/// +/// @since 3.17.0 class InlineValueClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( InlineValueClientCapabilities.canParse, @@ -22062,13 +22434,11 @@ class InlineValueContext implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } -/// Provide an inline value through an expression evaluation. +/// Provide an inline value through an expression evaluation. If only a range is +/// specified, the expression will be extracted from the underlying document. An +/// optional expression can be used to override the extracted expression. /// -/// If only a range is specified, the expression will be extracted from the -/// underlying document. -/// -/// An optional expression can be used to override the extracted expression. -/// @since 3.17.0 +/// @since 3.17.0 class InlineValueEvaluatableExpression implements ToJsonable { static const jsonHandler = LspJsonHandler( InlineValueEvaluatableExpression.canParse, @@ -22164,7 +22534,8 @@ class InlineValueEvaluatableExpression implements ToJsonable { } /// Inline value options used during static registration. -/// @since 3.17.0 +/// +/// @since 3.17.0 class InlineValueOptions implements WorkDoneProgressOptions, ToJsonable { static const jsonHandler = LspJsonHandler( InlineValueOptions.canParse, @@ -22233,7 +22604,8 @@ class InlineValueOptions implements WorkDoneProgressOptions, ToJsonable { } /// A parameter literal used in inline value requests. -/// @since 3.17.0 +/// +/// @since 3.17.0 class InlineValueParams implements WorkDoneProgressParams, ToJsonable { static const jsonHandler = LspJsonHandler( InlineValueParams.canParse, @@ -22397,7 +22769,8 @@ class InlineValueParams implements WorkDoneProgressParams, ToJsonable { } /// Inline value options used during static or dynamic registration. -/// @since 3.17.0 +/// +/// @since 3.17.0 class InlineValueRegistrationOptions implements InlineValueOptions, @@ -22532,7 +22905,8 @@ class InlineValueRegistrationOptions } /// Provide inline value as text. -/// @since 3.17.0 +/// +/// @since 3.17.0 class InlineValueText implements ToJsonable { static const jsonHandler = LspJsonHandler( InlineValueText.canParse, @@ -22631,13 +23005,11 @@ class InlineValueText implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } -/// Provide inline value through a variable lookup. -/// -/// If only a range is specified, the variable name will be extracted from the -/// underlying document. -/// +/// Provide inline value through a variable lookup. If only a range is +/// specified, the variable name will be extracted from the underlying document. /// An optional variable name can be used to override the extracted name. -/// @since 3.17.0 +/// +/// @since 3.17.0 class InlineValueVariableLookup implements ToJsonable { static const jsonHandler = LspJsonHandler( InlineValueVariableLookup.canParse, @@ -22763,7 +23135,8 @@ class InlineValueVariableLookup implements ToJsonable { } /// Client workspace capabilities specific to inline values. -/// @since 3.17.0 +/// +/// @since 3.17.0 class InlineValueWorkspaceClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( InlineValueWorkspaceClientCapabilities.canParse, @@ -22787,7 +23160,7 @@ class InlineValueWorkspaceClientCapabilities implements ToJsonable { /// /// Note that this event is global and will force the client to refresh all /// inline values currently shown. It should be used with absolute care and is - /// useful for situation where a server for example detect a project wide + /// useful for situation where a server for example detects a project wide /// change that requires such a calculation. final bool? refreshSupport; @@ -22837,7 +23210,8 @@ class InlineValueWorkspaceClientCapabilities implements ToJsonable { } /// A special text edit to provide an insert and a replace operation. -/// @since 3.16.0 +/// +/// @since 3.16.0 class InsertReplaceEdit implements ToJsonable { static const jsonHandler = LspJsonHandler( InsertReplaceEdit.canParse, @@ -22990,8 +23364,11 @@ class InsertTextFormat implements ToJsonable { /// /// A snippet can define tab stops and placeholders with `$1`, `$2` and /// `${3:foo}`. `$0` defines the final tab stop, it defaults to the end of the - /// snippet. Placeholders with equal identifiers are linked, that is typing in - /// one will update others too. + /// snippet. Placeholders with equal identifiers are linked, + /// that is typing in one will update others too. + /// + /// See also: + /// https://microsoft.github.io/language-server-protocol/specifications/specification-current/#snippet_syntax static const Snippet = InsertTextFormat._(2); @override @@ -23009,7 +23386,8 @@ class InsertTextFormat implements ToJsonable { } /// How whitespace and indentation is handled during completion item insertion. -/// @since 3.16.0 +/// +/// @since 3.16.0 class InsertTextMode implements ToJsonable { const InsertTextMode(this._value); const InsertTextMode.fromJson(this._value); @@ -23048,6 +23426,9 @@ class InsertTextMode implements ToJsonable { other is InsertTextMode && other._value == _value; } +/// Client capabilities for the linked editing range request. +/// +/// @since 3.16.0 class LinkedEditingRangeClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( LinkedEditingRangeClientCapabilities.canParse, @@ -23456,6 +23837,9 @@ class LinkedEditingRangeRegistrationOptions String toString() => jsonEncoder.convert(toJson()); } +/// The result of a linked editing range request. +/// +/// @since 3.16.0 class LinkedEditingRanges implements ToJsonable { static const jsonHandler = LspJsonHandler( LinkedEditingRanges.canParse, @@ -23479,7 +23863,7 @@ class LinkedEditingRanges implements ToJsonable { ); } - /// A list of ranges that can be renamed together. The ranges must have + /// A list of ranges that can be edited together. The ranges must have /// identical length and contain identical text content. The ranges cannot /// overlap. final List ranges; @@ -23558,6 +23942,7 @@ class LinkedEditingRanges implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Represents a location inside a resource, such as a line inside a text file. class Location implements ToJsonable { static const jsonHandler = LspJsonHandler( Location.canParse, @@ -23653,6 +24038,9 @@ class Location implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Represents the connection of two locations. Provides additional metadata +/// over normal locations, +/// including an origin range. class LocationLink implements ToJsonable { static const jsonHandler = LspJsonHandler( LocationLink.canParse, @@ -23688,7 +24076,7 @@ class LocationLink implements ToJsonable { /// Span of the origin of this link. /// /// Used as the underlined span for mouse interaction. Defaults to the word - /// range at the mouse position. + /// range at the definition position. final Range? originSelectionRange; /// The full target range of this link. If the target for example is a symbol @@ -23815,6 +24203,7 @@ class LocationLink implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// The log message parameters. class LogMessageParams implements ToJsonable { static const jsonHandler = LspJsonHandler( LogMessageParams.canParse, @@ -23836,10 +24225,10 @@ class LogMessageParams implements ToJsonable { ); } - /// The actual message + /// The actual message. final String message; - /// The message type. + /// The message type. See {@link MessageType} final MessageType type; @override @@ -23934,11 +24323,7 @@ class LogTraceParams implements ToJsonable { ); } - /// The message to be logged. final String message; - - /// Additional information that can be computed if the `trace` configuration - /// is set to `'verbose'` final String? verbose; @override @@ -24007,7 +24392,8 @@ class LogTraceParams implements ToJsonable { } /// Client capabilities specific to the used markdown parser. -/// @since 3.16.0 +/// +/// @since 3.16.0 class MarkdownClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( MarkdownClientCapabilities.canParse, @@ -24036,7 +24422,8 @@ class MarkdownClientCapabilities implements ToJsonable { } /// A list of HTML tags that the client allows / supports in Markdown. - /// @since 3.17.0 + /// + /// @since 3.17.0 final List? allowedTags; /// The name of the parser. @@ -24136,18 +24523,22 @@ class MarkdownClientCapabilities implements ToJsonable { /// `plaintext` and `markdown` as markup kinds. /// /// If the kind is `markdown` then the value can contain fenced code blocks like -/// in GitHub issues. +/// in GitHub issues. See +/// https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting /// /// Here is an example how such a string can be constructed using JavaScript / -/// TypeScript: ```typescript let markdown: MarkdownContent = { -/// kind: MarkupKind.Markdown, -/// value: [ -/// '# Header', -/// 'Some text', -/// '```typescript', -/// 'someCode();', -/// '```' -/// ].join('\n') }; ``` +/// TypeScript: +/// ```ts let markdown: MarkdownContent = { +/// kind: MarkupKind.Markdown, +/// value: [ +/// '# Header', +/// 'Some text', +/// '```typescript', +/// 'someCode();', +/// '```' +/// ].join('\n') +/// }; +/// ``` /// /// *Please Note* that clients might sanitize the return markdown. A client /// could decide to remove HTML from the markdown to avoid script execution. @@ -24358,6 +24749,7 @@ class MessageActionItem implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// The message type class MessageType implements ToJsonable { const MessageType(this._value); const MessageType.fromJson(this._value); @@ -24394,7 +24786,7 @@ class MessageType implements ToJsonable { other is MessageType && other._value == _value; } -/// Valid LSP methods known at the time of code generation from the spec. +/// All standard LSP Methods read from the JSON spec. class Method implements ToJsonable { const Method(this._value); const Method.fromJson(this._value); @@ -24723,6 +25115,8 @@ class Method implements ToJsonable { } /// Moniker definition to match LSIF 0.5 moniker definition. +/// +/// @since 3.16.0 class Moniker implements ToJsonable { static const jsonHandler = LspJsonHandler( Moniker.canParse, @@ -24875,6 +25269,9 @@ class Moniker implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Client capabilities specific to the moniker request. +/// +/// @since 3.16.0 class MonikerClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( MonikerClientCapabilities.canParse, @@ -24892,10 +25289,9 @@ class MonikerClientCapabilities implements ToJsonable { ); } - /// Whether implementation supports dynamic registration. If this is set to - /// `true` the client supports the new `(TextDocumentRegistrationOptions & - /// StaticRegistrationOptions)` return value for the corresponding server - /// capability as well. + /// Whether moniker supports dynamic registration. If this is set to `true` + /// the client supports the new `MonikerRegistrationOptions` return value for + /// the corresponding server capability as well. final bool? dynamicRegistration; @override @@ -24943,6 +25339,8 @@ class MonikerClientCapabilities implements ToJsonable { } /// The moniker kind. +/// +/// @since 3.16.0 class MonikerKind implements ToJsonable { const MonikerKind(this._value); const MonikerKind.fromJson(this._value); @@ -25324,7 +25722,8 @@ class MonikerRegistrationOptions /// A cell's document URI must be unique across ALL notebook cells and can /// therefore be used to uniquely identify a notebook cell or the cell's text /// document. -/// @since 3.17.0 +/// +/// @since 3.17.0 class NotebookCell implements ToJsonable { static const jsonHandler = LspJsonHandler( NotebookCell.canParse, @@ -25367,6 +25766,8 @@ class NotebookCell implements ToJsonable { final NotebookCellKind kind; /// Additional metadata stored with the cell. + /// + /// Note: should always be an object literal (e.g. LSPObject) final Object? metadata; @override @@ -25464,7 +25865,8 @@ class NotebookCell implements ToJsonable { } /// A change describing how to move a `NotebookCell` array from state S to S'. -/// @since 3.17.0 +/// +/// @since 3.17.0 class NotebookCellArrayChange implements ToJsonable { static const jsonHandler = LspJsonHandler( NotebookCellArrayChange.canParse, @@ -25594,7 +25996,8 @@ class NotebookCellArrayChange implements ToJsonable { } /// A notebook cell kind. -/// @since 3.17.0 +/// +/// @since 3.17.0 class NotebookCellKind implements ToJsonable { const NotebookCellKind(this._value); const NotebookCellKind.fromJson(this._value); @@ -25627,7 +26030,8 @@ class NotebookCellKind implements ToJsonable { /// A notebook cell text document filter denotes a cell text document by /// different properties. -/// @since 3.17.0 +/// +/// @since 3.17.0 class NotebookCellTextDocumentFilter implements ToJsonable { static const jsonHandler = LspJsonHandler( NotebookCellTextDocumentFilter.canParse, @@ -25748,7 +26152,8 @@ class NotebookCellTextDocumentFilter implements ToJsonable { } /// A notebook document. -/// @since 3.17.0 +/// +/// @since 3.17.0 class NotebookDocument implements ToJsonable { static const jsonHandler = LspJsonHandler( NotebookDocument.canParse, @@ -25788,6 +26193,8 @@ class NotebookDocument implements ToJsonable { final List cells; /// Additional metadata stored with the notebook document. + /// + /// Note: should always be an object literal (e.g. LSPObject) final Object? metadata; /// The type of the notebook. @@ -25923,7 +26330,8 @@ class NotebookDocument implements ToJsonable { } /// A change event for a notebook document. -/// @since 3.17.0 +/// +/// @since 3.17.0 class NotebookDocumentChangeEvent implements ToJsonable { static const jsonHandler = LspJsonHandler( NotebookDocumentChangeEvent.canParse, @@ -25952,6 +26360,8 @@ class NotebookDocumentChangeEvent implements ToJsonable { final NotebookDocumentChangeEventCells? cells; /// The changed meta data if any. + /// + /// Note: should always be an object literal (e.g. LSPObject) final Object? metadata; @override @@ -26405,7 +26815,8 @@ class NotebookDocumentChangeEventCellsTextContent implements ToJsonable { } /// Capabilities specific to the notebook document support. -/// @since 3.17.0 +/// +/// @since 3.17.0 class NotebookDocumentClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( NotebookDocumentClientCapabilities.canParse, @@ -26426,7 +26837,8 @@ class NotebookDocumentClientCapabilities implements ToJsonable { } /// Capabilities specific to notebook document synchronization - /// @since 3.17.0 + /// + /// @since 3.17.0 final NotebookDocumentSyncClientCapabilities synchronization; @override @@ -26507,13 +26919,13 @@ class NotebookDocumentFilter1 implements ToJsonable { ); } - /// The type of the enclosing notebook. + /// The type of the enclosing notebook. */ final String notebookType; - /// A glob pattern. + /// A glob pattern. */ final String? pattern; - /// A Uri [scheme](#Uri.scheme), like `file` or `untitled`. + /// A Uri scheme, like `file` or `untitled`. */ final String? scheme; @override @@ -26624,13 +27036,13 @@ class NotebookDocumentFilter2 implements ToJsonable { ); } - /// The type of the enclosing notebook. + /// The type of the enclosing notebook. */ final String? notebookType; - /// A glob pattern. + /// A glob pattern. */ final String? pattern; - /// A Uri [scheme](#Uri.scheme), like `file` or `untitled`. + /// A Uri scheme, like `file` or `untitled`.*/ final String scheme; @override @@ -26741,13 +27153,13 @@ class NotebookDocumentFilter3 implements ToJsonable { ); } - /// The type of the enclosing notebook. + /// The type of the enclosing notebook. */ final String? notebookType; - /// A glob pattern. + /// A glob pattern. */ final String pattern; - /// A Uri [scheme](#Uri.scheme), like `file` or `untitled`. + /// A Uri scheme, like `file` or `untitled`. */ final String? scheme; @override @@ -26834,7 +27246,8 @@ class NotebookDocumentFilter3 implements ToJsonable { } /// A literal to identify a notebook document in the client. -/// @since 3.17.0 +/// +/// @since 3.17.0 class NotebookDocumentIdentifier implements ToJsonable { static const jsonHandler = LspJsonHandler( NotebookDocumentIdentifier.canParse, @@ -26906,7 +27319,8 @@ class NotebookDocumentIdentifier implements ToJsonable { } /// Notebook specific client capabilities. -/// @since 3.17.0 +/// +/// @since 3.17.0 class NotebookDocumentSyncClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( NotebookDocumentSyncClientCapabilities.canParse, @@ -27004,13 +27418,14 @@ class NotebookDocumentSyncClientCapabilities implements ToJsonable { /// Options specific to a notebook plus its cells to be synced to the server. /// -/// If a selector provider a notebook document filter but no cell selector all +/// If a selector provides a notebook document filter but no cell selector all /// cells of a matching notebook document will be synced. /// /// If a selector provides no notebook document filter but only a cell selector /// all notebook document that contain at least one matching cell will be /// synced. -/// @since 3.17.0 +/// +/// @since 3.17.0 class NotebookDocumentSyncOptions implements ToJsonable { static const jsonHandler = LspJsonHandler( NotebookDocumentSyncOptions.canParse, @@ -27551,7 +27966,8 @@ class NotebookDocumentSyncOptionsNotebookSelectorCells implements ToJsonable { } /// Registration options specific to a notebook. -/// @since 3.17.0 +/// +/// @since 3.17.0 class NotebookDocumentSyncRegistrationOptions implements NotebookDocumentSyncOptions, @@ -27708,6 +28124,8 @@ class NotebookDocumentSyncRegistrationOptions String toString() => jsonEncoder.convert(toJson()); } +/// A text document identifier to optionally denote a specific version of a text +/// document. class OptionalVersionedTextDocumentIdentifier implements TextDocumentIdentifier, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -27731,19 +28149,16 @@ class OptionalVersionedTextDocumentIdentifier ); } - /// The text document's URI. + /// The text document's uri. @override final String uri; - /// The version number of this document. If an optional versioned text - /// document identifier is sent from the server to the client and the file is - /// not open in the editor (the server has not received an open notification - /// before) the server can send `null` to indicate that the version is known - /// and the content on disk is the master (as specified with document content + /// The version number of this document. If a versioned text document + /// identifier is sent from the server to the client and the file is not open + /// in the editor (the server has not received an open notification before) + /// the server can send `null` to indicate that the version is unknown and the + /// content on disk is the truth (as specified with document content /// ownership). - /// - /// The version number of a document will increase after each change, - /// including undo/redo. The number doesn't need to be consecutive. final int? version; @override @@ -28179,6 +28594,32 @@ class PlaceholderAndRange implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Position in a text document expressed as zero-based line and character +/// offset. Prior to 3.17 the offsets were always based on a UTF-16 string +/// representation. So a string of the form `a𐐀b` the character offset of the +/// character `a` is 0, the character offset of `𐐀` is 1 and the character +/// offset of b is 3 since `𐐀` is represented using two code units in UTF-16. +/// Since 3.17 clients and servers can agree on a different string encoding +/// representation (e.g. UTF-8). The client announces it's supported encoding +/// via the client capability `general.positionEncodings`. The value is an array +/// of position encodings the client supports, with decreasing preference (e.g. +/// the encoding at index `0` is the most preferred one). To stay backwards +/// compatible the only mandatory encoding is UTF-16 represented via the string +/// `utf-16`. The server can pick one of the encodings offered by the client and +/// signals that encoding back to the client via the initialize result's +/// property `capabilities.positionEncoding`. If the string value `utf-16` is +/// missing from the client's capability `general.positionEncodings` servers can +/// safely assume that the client supports UTF-16. If the server omits the +/// position encoding in its initialize result the encoding defaults to the +/// string value `utf-16`. Implementation considerations: since the conversion +/// from one encoding into another requires the content of the file / line the +/// conversion is best done where the file is read which is usually on the +/// server side. +/// +/// Positions are line end character agnostic. So you can not specify a position +/// that denotes `\r|\n` or `\n|` where `|` represents the character offset. +/// +/// @since 3.17.0 - support for negotiated position encoding. class Position implements ToJsonable { static const jsonHandler = LspJsonHandler( Position.canParse, @@ -28200,14 +28641,20 @@ class Position implements ToJsonable { ); } - /// Character offset on a line in a document (zero-based). The meaning of this - /// offset is determined by the negotiated `PositionEncodingKind`. + /// Character offset on a line in a document (zero-based). + /// + /// The meaning of this offset is determined by the negotiated + /// `PositionEncodingKind`. /// /// If the character value is greater than the line length it defaults back to /// the line length. final int character; /// Line position in a document (zero-based). + /// + /// If a line number is greater than the number of lines in a document, it + /// defaults back to the number of lines in the document. If a line number is + /// negative, it defaults to 0. final int line; @override @@ -28282,7 +28729,8 @@ class Position implements ToJsonable { } /// A set of predefined position encoding kinds. -/// @since 3.17.0 +/// +/// @since 3.17.0 class PositionEncodingKind implements ToJsonable { const PositionEncodingKind(this._value); const PositionEncodingKind.fromJson(this._value); @@ -28300,8 +28748,8 @@ class PositionEncodingKind implements ToJsonable { /// Character offsets count UTF-32 code units. /// - /// Implementation note: these are the same as Unicode code points, so this - /// `PositionEncodingKind` may also be used for an encoding-agnostic + /// Implementation note: these are the same as Unicode code points, + /// so this `PositionEncodingKind` may also be used for an encoding-agnostic /// representation of character offsets. static const UTF32 = PositionEncodingKind('utf-32'); @@ -28458,6 +28906,75 @@ class PrepareRenameParams String toString() => jsonEncoder.convert(toJson()); } +class PrepareRenameResult2 implements ToJsonable { + static const jsonHandler = LspJsonHandler( + PrepareRenameResult2.canParse, + PrepareRenameResult2.fromJson, + ); + + PrepareRenameResult2({ + required this.defaultBehavior, + }); + static PrepareRenameResult2 fromJson(Map json) { + final defaultBehaviorJson = json['defaultBehavior']; + final defaultBehavior = defaultBehaviorJson as bool; + return PrepareRenameResult2( + defaultBehavior: defaultBehavior, + ); + } + + final bool defaultBehavior; + + @override + Map toJson() { + var result = {}; + result['defaultBehavior'] = defaultBehavior; + return result; + } + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map) { + reporter.push('defaultBehavior'); + try { + if (!obj.containsKey('defaultBehavior')) { + reporter.reportError('must not be undefined'); + return false; + } + final defaultBehavior = obj['defaultBehavior']; + if (defaultBehavior == null) { + reporter.reportError('must not be null'); + return false; + } + if (defaultBehavior is! bool) { + reporter.reportError('must be of type bool'); + return false; + } + } finally { + reporter.pop(); + } + return true; + } else { + reporter.reportError('must be of type PrepareRenameResult2'); + return false; + } + } + + @override + bool operator ==(Object other) { + if (other is PrepareRenameResult2 && + other.runtimeType == PrepareRenameResult2) { + return defaultBehavior == other.defaultBehavior && true; + } + return false; + } + + @override + int get hashCode => defaultBehavior.hashCode; + + @override + String toString() => jsonEncoder.convert(toJson()); +} + class PrepareSupportDefaultBehavior implements ToJsonable { const PrepareSupportDefaultBehavior(this._value); const PrepareSupportDefaultBehavior.fromJson(this._value); @@ -28468,7 +28985,7 @@ class PrepareSupportDefaultBehavior implements ToJsonable { return obj is int; } - /// The client's default behavior is to select the identifier according to the + /// The client's default behavior is to select the identifier according the to /// language's syntax rule. static const Identifier = PrepareSupportDefaultBehavior(1); @@ -28487,7 +29004,8 @@ class PrepareSupportDefaultBehavior implements ToJsonable { } /// A previous result id in a workspace pull request. -/// @since 3.17.0 +/// +/// @since 3.17.0 class PreviousResultId implements ToJsonable { static const jsonHandler = LspJsonHandler( PreviousResultId.canParse, @@ -28586,7 +29104,7 @@ class PreviousResultId implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } -class ProgressParams implements ToJsonable { +class ProgressParams implements ToJsonable { static const jsonHandler = LspJsonHandler( ProgressParams.canParse, ProgressParams.fromJson, @@ -28596,7 +29114,7 @@ class ProgressParams implements ToJsonable { required this.token, this.value, }); - static ProgressParams fromJson(Map json) { + static ProgressParams fromJson(Map json) { final tokenJson = json['token']; final token = tokenJson is int ? Either2.t1(tokenJson) @@ -28605,7 +29123,7 @@ class ProgressParams implements ToJsonable { : (throw '''$tokenJson was not one of (int, String)''')); final valueJson = json['value']; final value = valueJson; - return ProgressParams( + return ProgressParams( token: token, value: value, ); @@ -28647,7 +29165,7 @@ class ProgressParams implements ToJsonable { } return true; } else { - reporter.reportError('must be of type ProgressParams'); + reporter.reportError('must be of type ProgressParams'); return false; } } @@ -28670,6 +29188,7 @@ class ProgressParams implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// The publish diagnostic client capabilities. class PublishDiagnosticsClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( PublishDiagnosticsClientCapabilities.canParse, @@ -28708,13 +29227,15 @@ class PublishDiagnosticsClientCapabilities implements ToJsonable { } /// Client supports a codeDescription property - /// @since 3.16.0 + /// + /// @since 3.16.0 final bool? codeDescriptionSupport; /// Whether code action supports the `data` property which is preserved /// between a `textDocument/publishDiagnostics` and `textDocument/codeAction` /// request. - /// @since 3.16.0 + /// + /// @since 3.16.0 final bool? dataSupport; /// Whether the clients accepts diagnostics with related information. @@ -28722,12 +29243,14 @@ class PublishDiagnosticsClientCapabilities implements ToJsonable { /// Client supports the tag property to provide meta data about a diagnostic. /// Clients supporting tags have to handle unknown tags gracefully. - /// @since 3.15.0 + /// + /// @since 3.15.0 final PublishDiagnosticsClientCapabilitiesTagSupport? tagSupport; /// Whether the client interprets the version property of the /// `textDocument/publishDiagnostics` notification's parameter. - /// @since 3.15.0 + /// + /// @since 3.15.0 final bool? versionSupport; @override @@ -28918,6 +29441,7 @@ class PublishDiagnosticsClientCapabilitiesTagSupport implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// The publish diagnostic notification's parameters. class PublishDiagnosticsParams implements ToJsonable { static const jsonHandler = LspJsonHandler( PublishDiagnosticsParams.canParse, @@ -28953,7 +29477,8 @@ class PublishDiagnosticsParams implements ToJsonable { /// Optional the version number of the document the diagnostics are published /// for. - /// @since 3.15.0 + /// + /// @since 3.15.0 final int? version; @override @@ -29047,6 +29572,18 @@ class PublishDiagnosticsParams implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// A range in a text document expressed as (zero-based) start and end +/// positions. +/// +/// If you want to specify a range that contains a line including the line +/// ending character(s) then use an end position denoting the start of the next +/// line. For example: +/// ```ts +/// { +/// start: { line: 5, character: 23 } +/// end : { line 6, character : 0 } +/// } +/// ``` class Range implements ToJsonable { static const jsonHandler = LspJsonHandler( Range.canParse, @@ -29145,6 +29682,7 @@ class Range implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Client Capabilities for a ReferencesRequest. class ReferenceClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( ReferenceClientCapabilities.canParse, @@ -29209,6 +29747,8 @@ class ReferenceClientCapabilities implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Value-object that contains additional information when requesting +/// references. class ReferenceContext implements ToJsonable { static const jsonHandler = LspJsonHandler( ReferenceContext.canParse, @@ -29278,6 +29818,7 @@ class ReferenceContext implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Reference options. class ReferenceOptions implements WorkDoneProgressOptions, ToJsonable { static const jsonHandler = LspJsonHandler( ReferenceOptions.canParse, @@ -29344,6 +29885,7 @@ class ReferenceOptions implements WorkDoneProgressOptions, ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Parameters for a ReferencesRequest. class ReferenceParams implements PartialResultParams, @@ -29543,6 +30085,7 @@ class ReferenceParams String toString() => jsonEncoder.convert(toJson()); } +/// Registration options for a ReferencesRequest. class ReferenceRegistrationOptions implements ReferenceOptions, TextDocumentRegistrationOptions, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -29648,7 +30191,8 @@ class ReferenceRegistrationOptions String toString() => jsonEncoder.convert(toJson()); } -/// General parameters to register for a capability. +/// General parameters to to register for an notification or to register a +/// provider. class Registration implements ToJsonable { static const jsonHandler = LspJsonHandler( Registration.canParse, @@ -29839,6 +30383,8 @@ class RegistrationParams implements ToJsonable { } /// Client capabilities specific to regular expressions. +/// +/// @since 3.16.0 class RegularExpressionsClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( RegularExpressionsClientCapabilities.canParse, @@ -29935,7 +30481,8 @@ class RegularExpressionsClientCapabilities implements ToJsonable { } /// A full diagnostic report with a set of related documents. -/// @since 3.17.0 +/// +/// @since 3.17.0 class RelatedFullDocumentDiagnosticReport implements FullDocumentDiagnosticReport, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -29998,7 +30545,8 @@ class RelatedFullDocumentDiagnosticReport /// file B which A depends on. An example of such a language is C/C++ where /// marco definitions in a file a.cpp and result in errors in a header file /// b.hpp. - /// @since 3.17.0 + /// + /// @since 3.17.0 final Map< String, Either2 jsonEncoder.convert(toJson()); } +/// Provider options for a RenameRequest. class RenameOptions implements WorkDoneProgressOptions, ToJsonable { static const jsonHandler = LspJsonHandler( RenameOptions.canParse, @@ -30944,6 +31502,8 @@ class RenameOptions implements WorkDoneProgressOptions, ToJsonable { } /// Renames should be checked and tested before being executed. + /// + /// @since version 3.12.0 final bool? prepareProvider; @override final bool? workDoneProgress; @@ -31009,8 +31569,8 @@ class RenameOptions implements WorkDoneProgressOptions, ToJsonable { String toString() => jsonEncoder.convert(toJson()); } -class RenameParams - implements TextDocumentPositionParams, WorkDoneProgressParams, ToJsonable { +/// The parameters of a RenameRequest. +class RenameParams implements WorkDoneProgressParams, ToJsonable { static const jsonHandler = LspJsonHandler( RenameParams.canParse, RenameParams.fromJson, @@ -31047,15 +31607,13 @@ class RenameParams } /// The new name of the symbol. If the given name is not valid the request - /// must return a [ResponseError] with an appropriate message set. + /// must return a ResponseError with an appropriate message set. final String newName; - /// The position inside the text document. - @override + /// The position at which this request was sent. final Position position; - /// The text document. - @override + /// The document to rename. final TextDocumentIdentifier textDocument; /// An optional token that a server can use to report work done progress. @@ -31173,6 +31731,7 @@ class RenameParams String toString() => jsonEncoder.convert(toJson()); } +/// Registration options for a RenameRequest. class RenameRegistrationOptions implements RenameOptions, TextDocumentRegistrationOptions, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -31208,6 +31767,8 @@ class RenameRegistrationOptions final List? documentSelector; /// Renames should be checked and tested before being executed. + /// + /// @since version 3.12.0 @override final bool? prepareProvider; @override @@ -31301,6 +31862,110 @@ class RenameRegistrationOptions String toString() => jsonEncoder.convert(toJson()); } +/// A generic resource operation. +class ResourceOperation implements ToJsonable { + static const jsonHandler = LspJsonHandler( + ResourceOperation.canParse, + ResourceOperation.fromJson, + ); + + ResourceOperation({ + this.annotationId, + required this.kind, + }); + static ResourceOperation fromJson(Map json) { + if (RenameFile.canParse(json, nullLspJsonReporter)) { + return RenameFile.fromJson(json); + } + if (CreateFile.canParse(json, nullLspJsonReporter)) { + return CreateFile.fromJson(json); + } + if (DeleteFile.canParse(json, nullLspJsonReporter)) { + return DeleteFile.fromJson(json); + } + final annotationIdJson = json['annotationId']; + final annotationId = annotationIdJson as String?; + final kindJson = json['kind']; + final kind = kindJson as String; + return ResourceOperation( + annotationId: annotationId, + kind: kind, + ); + } + + /// An optional annotation identifier describing the operation. + /// + /// @since 3.16.0 + final String? annotationId; + + /// The resource operation kind. + final String kind; + + @override + Map toJson() { + var result = {}; + if (annotationId != null) { + result['annotationId'] = annotationId; + } + result['kind'] = kind; + return result; + } + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map) { + reporter.push('annotationId'); + try { + final annotationId = obj['annotationId']; + if (annotationId != null && annotationId is! String) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('kind'); + try { + if (!obj.containsKey('kind')) { + reporter.reportError('must not be undefined'); + return false; + } + final kind = obj['kind']; + if (kind == null) { + reporter.reportError('must not be null'); + return false; + } + if (kind is! String) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } + return true; + } else { + reporter.reportError('must be of type ResourceOperation'); + return false; + } + } + + @override + bool operator ==(Object other) { + if (other is ResourceOperation && other.runtimeType == ResourceOperation) { + return annotationId == other.annotationId && kind == other.kind && true; + } + return false; + } + + @override + int get hashCode => Object.hash( + annotationId, + kind, + ); + + @override + String toString() => jsonEncoder.convert(toJson()); +} + class ResourceOperationKind implements ToJsonable { const ResourceOperationKind._(this._value); const ResourceOperationKind.fromJson(this._value); @@ -31340,6 +32005,7 @@ class ResourceOperationKind implements ToJsonable { other is ResourceOperationKind && other._value == _value; } +/// Save options. class SaveOptions implements ToJsonable { static const jsonHandler = LspJsonHandler( SaveOptions.canParse, @@ -31350,6 +32016,10 @@ class SaveOptions implements ToJsonable { this.includeText, }); static SaveOptions fromJson(Map json) { + if (TextDocumentSaveRegistrationOptions.canParse( + json, nullLspJsonReporter)) { + return TextDocumentSaveRegistrationOptions.fromJson(json); + } final includeTextJson = json['includeText']; final includeText = includeTextJson as bool?; return SaveOptions( @@ -31403,6 +32073,8 @@ class SaveOptions implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// A selection range represents a part of a selection hierarchy. A selection +/// range may have a parent selection range that contains it. class SelectionRange implements ToJsonable { static const jsonHandler = LspJsonHandler( SelectionRange.canParse, @@ -31430,7 +32102,7 @@ class SelectionRange implements ToJsonable { /// must contain `this.range`. final SelectionRange? parent; - /// The range ([Range]) of this selection range. + /// The range of this selection range. final Range range; @override @@ -31632,6 +32304,7 @@ class SelectionRangeOptions implements WorkDoneProgressOptions, ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// A parameter literal used in selection range requests. class SelectionRangeParams implements PartialResultParams, WorkDoneProgressParams, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -31935,6 +32608,10 @@ class SelectionRangeRegistrationOptions String toString() => jsonEncoder.convert(toJson()); } +/// A set of predefined token modifiers. This set is not fixed an clients can +/// specify additional token types via the corresponding client capabilities. +/// +/// @since 3.16.0 class SemanticTokenModifiers implements ToJsonable { const SemanticTokenModifiers(this._value); const SemanticTokenModifiers.fromJson(this._value); @@ -31970,6 +32647,10 @@ class SemanticTokenModifiers implements ToJsonable { other is SemanticTokenModifiers && other._value == _value; } +/// A set of predefined token types. This set is not fixed an clients can +/// specify additional token types via the corresponding client capabilities. +/// +/// @since 3.16.0 class SemanticTokenTypes implements ToJsonable { const SemanticTokenTypes(this._value); const SemanticTokenTypes.fromJson(this._value); @@ -32023,6 +32704,7 @@ class SemanticTokenTypes implements ToJsonable { other is SemanticTokenTypes && other._value == _value; } +/// @since 3.16.0 class SemanticTokens implements ToJsonable { static const jsonHandler = LspJsonHandler( SemanticTokens.canParse, @@ -32121,6 +32803,7 @@ class SemanticTokens implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// @since 3.16.0 class SemanticTokensClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( SemanticTokensClientCapabilities.canParse, @@ -32183,7 +32866,8 @@ class SemanticTokensClientCapabilities implements ToJsonable { /// returned semantic tokens for colorization. /// /// If the value is `undefined` then the client behavior is not specified. - /// @since 3.17.0 + /// + /// @since 3.17.0 final bool? augmentsSyntaxTokens; /// Whether implementation supports dynamic registration. If this is set to @@ -32192,7 +32876,7 @@ class SemanticTokensClientCapabilities implements ToJsonable { /// capability as well. final bool? dynamicRegistration; - /// The formats the clients supports. + /// The token formats the clients supports. final List formats; /// Whether the client supports tokens that can span multiple lines. @@ -32212,9 +32896,10 @@ class SemanticTokensClientCapabilities implements ToJsonable { final SemanticTokensClientCapabilitiesRequests requests; /// Whether the client allows the server to actively cancel a semantic token - /// request, e.g. supports returning ErrorCodes.ServerCancelled. If a server - /// does the client needs to retrigger the request. - /// @since 3.17.0 + /// request, e.g. supports returning LSPErrorCodes.ServerCancelled. If a + /// server does the client needs to retrigger the request. + /// + /// @since 3.17.0 final bool? serverCancelSupport; /// The token modifiers that the client supports. @@ -32651,6 +33336,7 @@ class SemanticTokensClientCapabilitiesRequestsRange implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// @since 3.16.0 class SemanticTokensDelta implements ToJsonable { static const jsonHandler = LspJsonHandler( SemanticTokensDelta.canParse, @@ -32749,6 +33435,7 @@ class SemanticTokensDelta implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// @since 3.16.0 class SemanticTokensDeltaParams implements PartialResultParams, WorkDoneProgressParams, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -32916,6 +33603,7 @@ class SemanticTokensDeltaParams String toString() => jsonEncoder.convert(toJson()); } +/// @since 3.16.0 class SemanticTokensDeltaPartialResult implements ToJsonable { static const jsonHandler = LspJsonHandler( SemanticTokensDeltaPartialResult.canParse, @@ -32991,6 +33679,7 @@ class SemanticTokensDeltaPartialResult implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// @since 3.16.0 class SemanticTokensEdit implements ToJsonable { static const jsonHandler = LspJsonHandler( SemanticTokensEdit.canParse, @@ -33116,6 +33805,7 @@ class SemanticTokensEdit implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// @since 3.16.0 class SemanticTokensLegend implements ToJsonable { static const jsonHandler = LspJsonHandler( SemanticTokensLegend.canParse, @@ -33225,6 +33915,7 @@ class SemanticTokensLegend implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// @since 3.16.0 class SemanticTokensOptions implements WorkDoneProgressOptions, ToJsonable { static const jsonHandler = LspJsonHandler( SemanticTokensOptions.canParse, @@ -33493,6 +34184,7 @@ class SemanticTokensOptionsRange implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// @since 3.16.0 class SemanticTokensParams implements PartialResultParams, WorkDoneProgressParams, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -33631,6 +34323,7 @@ class SemanticTokensParams String toString() => jsonEncoder.convert(toJson()); } +/// @since 3.16.0 class SemanticTokensPartialResult implements ToJsonable { static const jsonHandler = LspJsonHandler( SemanticTokensPartialResult.canParse, @@ -33701,6 +34394,7 @@ class SemanticTokensPartialResult implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// @since 3.16.0 class SemanticTokensRangeParams implements PartialResultParams, WorkDoneProgressParams, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -33867,6 +34561,7 @@ class SemanticTokensRangeParams String toString() => jsonEncoder.convert(toJson()); } +/// @since 3.16.0 class SemanticTokensRegistrationOptions implements SemanticTokensOptions, @@ -34100,6 +34795,7 @@ class SemanticTokensRegistrationOptions String toString() => jsonEncoder.convert(toJson()); } +/// @since 3.16.0 class SemanticTokensWorkspaceClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( SemanticTokensWorkspaceClientCapabilities.canParse, @@ -34123,7 +34819,7 @@ class SemanticTokensWorkspaceClientCapabilities implements ToJsonable { /// /// Note that this event is global and will force the client to refresh all /// semantic tokens currently shown. It should be used with absolute care and - /// is useful for situation where a server for example detect a project wide + /// is useful for situation where a server for example detects a project wide /// change that requires such a calculation. final bool? refreshSupport; @@ -34172,6 +34868,7 @@ class SemanticTokensWorkspaceClientCapabilities implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Defines the capabilities provided by a language server. class ServerCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( ServerCapabilities.canParse, @@ -34669,28 +35366,27 @@ class ServerCapabilities implements ToJsonable { } /// The server provides call hierarchy support. - /// @since 3.16.0 + /// + /// @since 3.16.0 final Either3? callHierarchyProvider; - /// The server provides code actions. The `CodeActionOptions` return type is - /// only valid if the client signals code action literal support via the - /// property `textDocument.codeAction.codeActionLiteralSupport`. + /// The server provides code actions. CodeActionOptions may only be specified + /// if the client states that it supports `codeActionLiteralSupport` in its + /// initial `initialize` request. final Either2? codeActionProvider; /// The server provides code lens. final CodeLensOptions? codeLensProvider; /// The server provides color provider support. - /// @since 3.6.0 final Either3? colorProvider; /// The server provides completion support. final CompletionOptions? completionProvider; - /// The server provides go to declaration support. - /// @since 3.14.0 + /// The server provides Goto Declaration support. final Either3? declarationProvider; @@ -34698,7 +35394,8 @@ class ServerCapabilities implements ToJsonable { final Either2? definitionProvider; /// The server has support for pull model diagnostics. - /// @since 3.17.0 + /// + /// @since 3.17.0 final Either2? diagnosticProvider; @@ -34728,40 +35425,43 @@ class ServerCapabilities implements ToJsonable { final Object? experimental; /// The server provides folding provider support. - /// @since 3.10.0 final Either3? foldingRangeProvider; /// The server provides hover support. final Either2? hoverProvider; - /// The server provides goto implementation support. - /// @since 3.6.0 + /// The server provides Goto Implementation support. final Either3? implementationProvider; /// The server provides inlay hints. - /// @since 3.17.0 + /// + /// @since 3.17.0 final Either3? inlayHintProvider; /// The server provides inline values. - /// @since 3.17.0 + /// + /// @since 3.17.0 final Either3? inlineValueProvider; /// The server provides linked editing range support. - /// @since 3.16.0 + /// + /// @since 3.16.0 final Either3? linkedEditingRangeProvider; - /// Whether server provides moniker support. - /// @since 3.16.0 + /// The server provides moniker support. + /// + /// @since 3.16.0 final Either3? monikerProvider; /// Defines how notebook documents are synced. - /// @since 3.17.0 + /// + /// @since 3.17.0 final Either2? notebookDocumentSync; @@ -34772,7 +35472,8 @@ class ServerCapabilities implements ToJsonable { /// that a server can return is 'utf-16'. /// /// If omitted it defaults to 'utf-16'. - /// @since 3.17.0 + /// + /// @since 3.17.0 final PositionEncodingKind? positionEncoding; /// The server provides find references support. @@ -34784,12 +35485,12 @@ class ServerCapabilities implements ToJsonable { final Either2? renameProvider; /// The server provides selection range support. - /// @since 3.15.0 final Either3? selectionRangeProvider; /// The server provides semantic tokens support. - /// @since 3.16.0 + /// + /// @since 3.16.0 final Either2? semanticTokensProvider; @@ -34798,22 +35499,21 @@ class ServerCapabilities implements ToJsonable { /// Defines how text documents are synced. Is either a detailed structure /// defining each notification or for backwards compatibility the - /// TextDocumentSyncKind number. If omitted it defaults to - /// `TextDocumentSyncKind.None`. + /// TextDocumentSyncKind number. final Either2? textDocumentSync; - /// The server provides goto type definition support. - /// @since 3.6.0 + /// The server provides Goto Type Definition support. final Either3? typeDefinitionProvider; /// The server provides type hierarchy support. - /// @since 3.17.0 + /// + /// @since 3.17.0 final Either3? typeHierarchyProvider; - /// Workspace specific server capabilities + /// Workspace specific server capabilities. final ServerCapabilitiesWorkspace? workspace; /// The server provides workspace symbol support. @@ -35517,12 +36217,15 @@ class ServerCapabilitiesWorkspace implements ToJsonable { ); } - /// The server is interested in file notifications/requests. - /// @since 3.16.0 + /// The server is interested in notifications/requests for operations on + /// files. + /// + /// @since 3.16.0 final FileOperationOptions? fileOperations; /// The server supports workspace folder. - /// @since 3.6.0 + /// + /// @since 3.6.0 final WorkspaceFoldersServerCapabilities? workspaceFolders; @override @@ -35602,21 +36305,18 @@ class SetTraceParams implements ToJsonable { }); static SetTraceParams fromJson(Map json) { final valueJson = json['value']; - final value = const {'off', 'messages', 'verbose'}.contains(valueJson) - ? valueJson as String - : throw '''$valueJson was not one of ('off', 'messages', 'verbose')'''; + final value = TraceValues.fromJson(valueJson as String); return SetTraceParams( value: value, ); } - /// The new value that should be assigned to the trace setting. - final String value; + final TraceValues value; @override Map toJson() { var result = {}; - result['value'] = value; + result['value'] = value.toJson(); return result; } @@ -35633,9 +36333,8 @@ class SetTraceParams implements ToJsonable { reporter.reportError('must not be null'); return false; } - if (value != 'off' && value != 'messages' && value != 'verbose') { - reporter.reportError( - 'must be one of the literals \'off\', \'messages\', \'verbose\''); + if (!TraceValues.canParse(value, reporter)) { + reporter.reportError('must be of type TraceValues'); return false; } } finally { @@ -35663,8 +36362,9 @@ class SetTraceParams implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } -/// Client capabilities for the show document request. -/// @since 3.16.0 +/// Client capabilities for the showDocument request. +/// +/// @since 3.16.0 class ShowDocumentClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( ShowDocumentClientCapabilities.canParse, @@ -35682,7 +36382,7 @@ class ShowDocumentClientCapabilities implements ToJsonable { ); } - /// The client has support for the show document request. + /// The client has support for the showDocument request. final bool support; @override @@ -35736,7 +36436,8 @@ class ShowDocumentClientCapabilities implements ToJsonable { } /// Params to show a document. -/// @since 3.16.0 +/// +/// @since 3.16.0 class ShowDocumentParams implements ToJsonable { static const jsonHandler = LspJsonHandler( ShowDocumentParams.canParse, @@ -35884,8 +36585,9 @@ class ShowDocumentParams implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } -/// The result of an show document request. -/// @since 3.16.0 +/// The result of a showDocument request. +/// +/// @since 3.16.0 class ShowDocumentResult implements ToJsonable { static const jsonHandler = LspJsonHandler( ShowDocumentResult.canParse, @@ -35956,6 +36658,7 @@ class ShowDocumentResult implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// The parameters of a notification message. class ShowMessageParams implements ToJsonable { static const jsonHandler = LspJsonHandler( ShowMessageParams.canParse, @@ -35980,7 +36683,7 @@ class ShowMessageParams implements ToJsonable { /// The actual message. final String message; - /// The message type. + /// The message type. See {@link MessageType} final MessageType type; @override @@ -36149,7 +36852,7 @@ class ShowMessageRequestClientCapabilitiesMessageActionItem } /// Whether the client supports additional attributes which are preserved and - /// sent back to the server in the request's response. + /// send back to the server in the request's response. final bool? additionalPropertiesSupport; @override @@ -36231,10 +36934,10 @@ class ShowMessageRequestParams implements ToJsonable { /// The message action items to present. final List? actions; - /// The actual message + /// The actual message. final String message; - /// The message type. + /// The message type. See {@link MessageType} final MessageType type; @override @@ -36369,8 +37072,8 @@ class SignatureHelp implements ToJsonable { final int? activeParameter; /// The active signature. If omitted or the value lies outside the range of - /// `signatures` the value defaults to zero or is ignore if the - /// `SignatureHelp` as no signatures. + /// `signatures` the value defaults to zero or is ignored if the + /// `SignatureHelp` has no signatures. /// /// Whenever possible implementors should make an active decision about the /// active signature and shouldn't rely on a default value. @@ -36379,8 +37082,7 @@ class SignatureHelp implements ToJsonable { /// better express this. final int? activeSignature; - /// One or more signatures. If no signatures are available the signature help - /// request should return `null`. + /// One or more signatures. final List signatures; @override @@ -36468,6 +37170,7 @@ class SignatureHelp implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Client Capabilities for a SignatureHelpRequest. class SignatureHelpClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( SignatureHelpClientCapabilities.canParse, @@ -36500,7 +37203,8 @@ class SignatureHelpClientCapabilities implements ToJsonable { /// `textDocument/signatureHelp` request. A client that opts into /// contextSupport will also support the `retriggerCharacters` on /// `SignatureHelpOptions`. - /// @since 3.15.0 + /// + /// @since 3.15.0 final bool? contextSupport; /// Whether signature help supports dynamic registration. @@ -36625,11 +37329,12 @@ class SignatureHelpClientCapabilitiesSignatureInformation /// The client supports the `activeParameter` property on /// `SignatureInformation` literal. - /// @since 3.16.0 + /// + /// @since 3.16.0 final bool? activeParameterSupport; - /// Client supports the follow content formats for the documentation property. - /// The order describes the preferred format of the client. + /// Client supports the following content formats for the documentation + /// property. The order describes the preferred format of the client. final List? documentationFormat; /// Client capabilities specific to parameter information. @@ -36724,7 +37429,8 @@ class SignatureHelpClientCapabilitiesSignatureInformation /// Additional information about the context in which a signature help request /// was triggered. -/// @since 3.15.0 +/// +/// @since 3.15.0 class SignatureHelpContext implements ToJsonable { static const jsonHandler = LspJsonHandler( SignatureHelpContext.canParse, @@ -36766,15 +37472,15 @@ class SignatureHelpContext implements ToJsonable { /// `true` if signature help was already showing when it was triggered. /// - /// Retriggers occur when the signature help is already active and can be + /// Retriggers occurs when the signature help is already active and can be /// caused by actions such as typing a trigger character, a cursor move, or /// document content changes. final bool isRetrigger; /// Character that caused signature help to be triggered. /// - /// This is undefined when triggerKind !== - /// SignatureHelpTriggerKind.TriggerCharacter + /// This is undefined when `triggerKind !== + /// SignatureHelpTriggerKind.TriggerCharacter` final String? triggerCharacter; /// Action that caused signature help to be triggered. @@ -36885,6 +37591,7 @@ class SignatureHelpContext implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Server Capabilities for a SignatureHelpRequest. class SignatureHelpOptions implements WorkDoneProgressOptions, ToJsonable { static const jsonHandler = LspJsonHandler( SignatureHelpOptions.canParse, @@ -36921,10 +37628,11 @@ class SignatureHelpOptions implements WorkDoneProgressOptions, ToJsonable { /// /// These trigger characters are only active when signature help is already /// showing. All trigger characters are also counted as re-trigger characters. - /// @since 3.15.0 + /// + /// @since 3.15.0 final List? retriggerCharacters; - /// The characters that trigger signature help automatically. + /// List of characters that trigger signature help automatically. final List? triggerCharacters; @override final bool? workDoneProgress; @@ -37012,6 +37720,7 @@ class SignatureHelpOptions implements WorkDoneProgressOptions, ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Parameters for a SignatureHelpRequest. class SignatureHelpParams implements TextDocumentPositionParams, WorkDoneProgressParams, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -37054,7 +37763,8 @@ class SignatureHelpParams /// The signature help context. This is only available if the client specifies /// to send this using the client capability /// `textDocument.signatureHelp.contextSupport === true` - /// @since 3.15.0 + /// + /// @since 3.15.0 final SignatureHelpContext? context; /// The position inside the text document. @@ -37176,6 +37886,7 @@ class SignatureHelpParams String toString() => jsonEncoder.convert(toJson()); } +/// Registration options for a SignatureHelpRequest. class SignatureHelpRegistrationOptions implements SignatureHelpOptions, @@ -37225,11 +37936,12 @@ class SignatureHelpRegistrationOptions /// /// These trigger characters are only active when signature help is already /// showing. All trigger characters are also counted as re-trigger characters. - /// @since 3.15.0 + /// + /// @since 3.15.0 @override final List? retriggerCharacters; - /// The characters that trigger signature help automatically. + /// List of characters that trigger signature help automatically. @override final List? triggerCharacters; @override @@ -37345,7 +38057,8 @@ class SignatureHelpRegistrationOptions } /// How a signature help was triggered. -/// @since 3.15.0 +/// +/// @since 3.15.0 class SignatureHelpTriggerKind implements ToJsonable { const SignatureHelpTriggerKind(this._value); const SignatureHelpTriggerKind.fromJson(this._value); @@ -37424,7 +38137,8 @@ class SignatureInformation implements ToJsonable { /// The index of the active parameter. /// /// If provided, this is used in place of `SignatureHelp.activeParameter`. - /// @since 3.16.0 + /// + /// @since 3.16.0 final int? activeParameter; /// The human-readable doc-comment of this signature. Will be shown in the UI @@ -37562,7 +38276,8 @@ class SignatureInformationParameterInformation implements ToJsonable { /// The client supports processing label offsets instead of a simple label /// string. - /// @since 3.14.0 + /// + /// @since 3.14.0 final bool? labelOffsetSupport; @override @@ -37722,8 +38437,7 @@ class StaticRegistrationOptions implements ToJsonable { /// Represents information about programming constructs like variables, classes, /// interfaces etc. -/// @deprecated use DocumentSymbol or WorkspaceSymbol instead. -class SymbolInformation implements ToJsonable { +class SymbolInformation implements BaseSymbolInformation, ToJsonable { static const jsonHandler = LspJsonHandler( SymbolInformation.canParse, SymbolInformation.fromJson, @@ -37766,31 +38480,37 @@ class SymbolInformation implements ToJsonable { /// user interface purposes (e.g. to render a qualifier in the user interface /// if necessary). It can't be used to re-infer a hierarchy for the document /// symbols. + @override final String? containerName; /// Indicates if this symbol is deprecated. - /// @deprecated Use tags instead + /// + /// @deprecated Use tags instead final bool? deprecated; /// The kind of this symbol. + @override final SymbolKind kind; /// The location of this symbol. The location's range is used by a tool to /// reveal the location in the editor. If the symbol is selected in the tool /// the range's start information is used to position the cursor. So the range - /// usually spans more then the actual symbol's name and does normally include + /// usually spans more than the actual symbol's name and does normally include /// things like visibility modifiers. /// - /// The range doesn't have to denote a node range in the sense of a abstract + /// The range doesn't have to denote a node range in the sense of an abstract /// syntax tree. It can therefore not be used to re-construct a hierarchy of /// the symbols. final Location location; /// The name of this symbol. + @override final String name; /// Tags for this symbol. - /// @since 3.16.0 + /// + /// @since 3.16.0 + @override final List? tags; @override @@ -37987,7 +38707,8 @@ class SymbolKind implements ToJsonable { } /// Symbol tags are extra annotations that tweak the rendering of a symbol. -/// @since 3.16 +/// +/// @since 3.16 class SymbolTag implements ToJsonable { const SymbolTag(this._value); const SymbolTag.fromJson(this._value); @@ -38015,8 +38736,7 @@ class SymbolTag implements ToJsonable { other is SymbolTag && other._value == _value; } -/// Describe options to be used when registering for text document change -/// events. +/// Describe options to be used when registered for text document change events. class TextDocumentChangeRegistrationOptions implements TextDocumentRegistrationOptions, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -38048,8 +38768,7 @@ class TextDocumentChangeRegistrationOptions @override final List? documentSelector; - /// How documents are synced to the server. See TextDocumentSyncKind.Full and - /// TextDocumentSyncKind.Incremental. + /// How documents are synced to the server. final TextDocumentSyncKind syncKind; @override @@ -38355,7 +39074,8 @@ class TextDocumentClientCapabilities implements ToJsonable { } /// Capabilities specific to the various call hierarchy requests. - /// @since 3.16.0 + /// + /// @since 3.16.0 final CallHierarchyClientCapabilities? callHierarchy; /// Capabilities specific to the `textDocument/codeAction` request. @@ -38366,21 +39086,24 @@ class TextDocumentClientCapabilities implements ToJsonable { /// Capabilities specific to the `textDocument/documentColor` and the /// `textDocument/colorPresentation` request. - /// @since 3.6.0 + /// + /// @since 3.6.0 final DocumentColorClientCapabilities? colorProvider; /// Capabilities specific to the `textDocument/completion` request. final CompletionClientCapabilities? completion; /// Capabilities specific to the `textDocument/declaration` request. - /// @since 3.14.0 + /// + /// @since 3.14.0 final DeclarationClientCapabilities? declaration; /// Capabilities specific to the `textDocument/definition` request. final DefinitionClientCapabilities? definition; /// Capabilities specific to the diagnostic pull model. - /// @since 3.17.0 + /// + /// @since 3.17.0 final DiagnosticClientCapabilities? diagnostic; /// Capabilities specific to the `textDocument/documentHighlight` request. @@ -38393,7 +39116,8 @@ class TextDocumentClientCapabilities implements ToJsonable { final DocumentSymbolClientCapabilities? documentSymbol; /// Capabilities specific to the `textDocument/foldingRange` request. - /// @since 3.10.0 + /// + /// @since 3.10.0 final FoldingRangeClientCapabilities? foldingRange; /// Capabilities specific to the `textDocument/formatting` request. @@ -38403,27 +39127,31 @@ class TextDocumentClientCapabilities implements ToJsonable { final HoverClientCapabilities? hover; /// Capabilities specific to the `textDocument/implementation` request. - /// @since 3.6.0 + /// + /// @since 3.6.0 final ImplementationClientCapabilities? implementation; /// Capabilities specific to the `textDocument/inlayHint` request. - /// @since 3.17.0 + /// + /// @since 3.17.0 final InlayHintClientCapabilities? inlayHint; /// Capabilities specific to the `textDocument/inlineValue` request. - /// @since 3.17.0 + /// + /// @since 3.17.0 final InlineValueClientCapabilities? inlineValue; /// Capabilities specific to the `textDocument/linkedEditingRange` request. - /// @since 3.16.0 + /// + /// @since 3.16.0 final LinkedEditingRangeClientCapabilities? linkedEditingRange; - /// Capabilities specific to the `textDocument/moniker` request. - /// @since 3.16.0 + /// Client capabilities specific to the `textDocument/moniker` request. + /// + /// @since 3.16.0 final MonikerClientCapabilities? moniker; - /// request. Capabilities specific to the `textDocument/onTypeFormatting` - /// request. + /// Capabilities specific to the `textDocument/onTypeFormatting` request. final DocumentOnTypeFormattingClientCapabilities? onTypeFormatting; /// Capabilities specific to the `textDocument/publishDiagnostics` @@ -38440,23 +39168,29 @@ class TextDocumentClientCapabilities implements ToJsonable { final RenameClientCapabilities? rename; /// Capabilities specific to the `textDocument/selectionRange` request. - /// @since 3.15.0 + /// + /// @since 3.15.0 final SelectionRangeClientCapabilities? selectionRange; - /// Capabilities specific to the various semantic token requests. - /// @since 3.16.0 + /// Capabilities specific to the various semantic token request. + /// + /// @since 3.16.0 final SemanticTokensClientCapabilities? semanticTokens; /// Capabilities specific to the `textDocument/signatureHelp` request. final SignatureHelpClientCapabilities? signatureHelp; + + /// Defines which synchronization capabilities the client supports. final TextDocumentSyncClientCapabilities? synchronization; /// Capabilities specific to the `textDocument/typeDefinition` request. - /// @since 3.6.0 + /// + /// @since 3.6.0 final TypeDefinitionClientCapabilities? typeDefinition; /// Capabilities specific to the various type hierarchy requests. - /// @since 3.17.0 + /// + /// @since 3.17.0 final TypeHierarchyClientCapabilities? typeHierarchy; @override @@ -39034,7 +39768,8 @@ class TextDocumentContentChangeEvent1 implements ToJsonable { final Range range; /// The optional length of the range that got replaced. - /// @deprecated use range instead. + /// + /// @deprecated use range instead. final int? rangeLength; /// The new text for the provided range. @@ -39199,6 +39934,11 @@ class TextDocumentContentChangeEvent2 implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Describes textual changes on a text document. A TextDocumentEdit describes +/// all changes on a document version Si and after they are applied move the +/// document to version Si+1. So the creator of a TextDocumentEdit doesn't need +/// to sort the array of edits or do any kind of ordering. However the edits +/// must be non overlapping. class TextDocumentEdit implements ToJsonable { static const jsonHandler = LspJsonHandler( TextDocumentEdit.canParse, @@ -39233,8 +39973,9 @@ class TextDocumentEdit implements ToJsonable { } /// The edits to be applied. - /// @since 3.16.0 - support for AnnotatedTextEdit. This is guarded by the - /// client capability `workspace.workspaceEdit.changeAnnotationSupport` + /// + /// @since 3.16.0 - support for AnnotatedTextEdit. This is guarded using a + /// client capability. final List> edits; /// The text document to change. @@ -39326,6 +40067,240 @@ class TextDocumentEdit implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +class TextDocumentFilter1 implements ToJsonable { + static const jsonHandler = LspJsonHandler( + TextDocumentFilter1.canParse, + TextDocumentFilter1.fromJson, + ); + + TextDocumentFilter1({ + required this.language, + this.pattern, + this.scheme, + }); + static TextDocumentFilter1 fromJson(Map json) { + final languageJson = json['language']; + final language = languageJson as String; + final patternJson = json['pattern']; + final pattern = patternJson as String?; + final schemeJson = json['scheme']; + final scheme = schemeJson as String?; + return TextDocumentFilter1( + language: language, + pattern: pattern, + scheme: scheme, + ); + } + + /// A language id, like `typescript`. */ + final String language; + + /// A glob pattern, like `*.{ts,js}`. */ + final String? pattern; + + /// A Uri scheme, like `file` or `untitled`. */ + final String? scheme; + + @override + Map toJson() { + var result = {}; + result['language'] = language; + if (pattern != null) { + result['pattern'] = pattern; + } + if (scheme != null) { + result['scheme'] = scheme; + } + return result; + } + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map) { + reporter.push('language'); + try { + if (!obj.containsKey('language')) { + reporter.reportError('must not be undefined'); + return false; + } + final language = obj['language']; + if (language == null) { + reporter.reportError('must not be null'); + return false; + } + if (language is! String) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('pattern'); + try { + final pattern = obj['pattern']; + if (pattern != null && pattern is! String) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('scheme'); + try { + final scheme = obj['scheme']; + if (scheme != null && scheme is! String) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } + return true; + } else { + reporter.reportError('must be of type TextDocumentFilter1'); + return false; + } + } + + @override + bool operator ==(Object other) { + if (other is TextDocumentFilter1 && + other.runtimeType == TextDocumentFilter1) { + return language == other.language && + pattern == other.pattern && + scheme == other.scheme && + true; + } + return false; + } + + @override + int get hashCode => Object.hash( + language, + pattern, + scheme, + ); + + @override + String toString() => jsonEncoder.convert(toJson()); +} + +class TextDocumentFilter3 implements ToJsonable { + static const jsonHandler = LspJsonHandler( + TextDocumentFilter3.canParse, + TextDocumentFilter3.fromJson, + ); + + TextDocumentFilter3({ + this.language, + required this.pattern, + this.scheme, + }); + static TextDocumentFilter3 fromJson(Map json) { + final languageJson = json['language']; + final language = languageJson as String?; + final patternJson = json['pattern']; + final pattern = patternJson as String; + final schemeJson = json['scheme']; + final scheme = schemeJson as String?; + return TextDocumentFilter3( + language: language, + pattern: pattern, + scheme: scheme, + ); + } + + /// A language id, like `typescript`. */ + final String? language; + + /// A glob pattern, like `*.{ts,js}`. */ + final String pattern; + + /// A Uri scheme, like `file` or `untitled`. */ + final String? scheme; + + @override + Map toJson() { + var result = {}; + if (language != null) { + result['language'] = language; + } + result['pattern'] = pattern; + if (scheme != null) { + result['scheme'] = scheme; + } + return result; + } + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map) { + reporter.push('language'); + try { + final language = obj['language']; + if (language != null && language is! String) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('pattern'); + try { + if (!obj.containsKey('pattern')) { + reporter.reportError('must not be undefined'); + return false; + } + final pattern = obj['pattern']; + if (pattern == null) { + reporter.reportError('must not be null'); + return false; + } + if (pattern is! String) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } + reporter.push('scheme'); + try { + final scheme = obj['scheme']; + if (scheme != null && scheme is! String) { + reporter.reportError('must be of type String'); + return false; + } + } finally { + reporter.pop(); + } + return true; + } else { + reporter.reportError('must be of type TextDocumentFilter3'); + return false; + } + } + + @override + bool operator ==(Object other) { + if (other is TextDocumentFilter3 && + other.runtimeType == TextDocumentFilter3) { + return language == other.language && + pattern == other.pattern && + scheme == other.scheme && + true; + } + return false; + } + + @override + int get hashCode => Object.hash( + language, + pattern, + scheme, + ); + + @override + String toString() => jsonEncoder.convert(toJson()); +} + class TextDocumentFilterWithScheme implements ToJsonable { static const jsonHandler = LspJsonHandler( TextDocumentFilterWithScheme.canParse, @@ -39335,7 +40310,7 @@ class TextDocumentFilterWithScheme implements ToJsonable { TextDocumentFilterWithScheme({ this.language, this.pattern, - this.scheme, + required this.scheme, }); static TextDocumentFilterWithScheme fromJson(Map json) { final languageJson = json['language']; @@ -39343,7 +40318,7 @@ class TextDocumentFilterWithScheme implements ToJsonable { final patternJson = json['pattern']; final pattern = patternJson as String?; final schemeJson = json['scheme']; - final scheme = schemeJson as String?; + final scheme = schemeJson as String; return TextDocumentFilterWithScheme( language: language, pattern: pattern, @@ -39351,26 +40326,14 @@ class TextDocumentFilterWithScheme implements ToJsonable { ); } - /// A language id, like `typescript`. + /// A language id, like `typescript`. */ final String? language; - /// A glob pattern, like `*.{ts,js}`. - /// - /// Glob patterns can have the following syntax: - /// - `*` to match one or more characters in a path segment - /// - `?` to match on one character in a path segment - /// - `**` to match any number of path segments, including none - /// - `{}` to group sub patterns into an OR expression. (e.g. `**​/*.{ts,js}` - /// matches all TypeScript and JavaScript files) - /// - `[]` to declare a range of characters to match in a path segment - /// (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …) - /// - `[!...]` to negate a range of characters to match in a path segment - /// (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but - /// not `example.0`) + /// A glob pattern, like `*.{ts,js}`. */ final String? pattern; - /// A Uri [scheme](#Uri.scheme), like `file` or `untitled`. - final String? scheme; + /// A Uri scheme, like `file` or `untitled`. */ + final String scheme; @override Map toJson() { @@ -39381,9 +40344,7 @@ class TextDocumentFilterWithScheme implements ToJsonable { if (pattern != null) { result['pattern'] = pattern; } - if (scheme != null) { - result['scheme'] = scheme; - } + result['scheme'] = scheme; return result; } @@ -39411,8 +40372,16 @@ class TextDocumentFilterWithScheme implements ToJsonable { } reporter.push('scheme'); try { + if (!obj.containsKey('scheme')) { + reporter.reportError('must not be undefined'); + return false; + } final scheme = obj['scheme']; - if (scheme != null && scheme is! String) { + if (scheme == null) { + reporter.reportError('must not be null'); + return false; + } + if (scheme is! String) { reporter.reportError('must be of type String'); return false; } @@ -39449,6 +40418,7 @@ class TextDocumentFilterWithScheme implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// A literal to identify a text document in the client. class TextDocumentIdentifier implements ToJsonable { static const jsonHandler = LspJsonHandler( TextDocumentIdentifier.canParse, @@ -39473,7 +40443,7 @@ class TextDocumentIdentifier implements ToJsonable { ); } - /// The text document's URI. + /// The text document's uri. final String uri; @override @@ -39526,6 +40496,7 @@ class TextDocumentIdentifier implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// An item to transfer a text document from the client to the server. class TextDocumentItem implements ToJsonable { static const jsonHandler = LspJsonHandler( TextDocumentItem.canParse, @@ -39561,7 +40532,7 @@ class TextDocumentItem implements ToJsonable { /// The content of the opened text document. final String text; - /// The text document's URI. + /// The text document's uri. final String uri; /// The version number of this document (it will increase after each change, @@ -39683,6 +40654,8 @@ class TextDocumentItem implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// A parameter literal used in requests to pass a text document and a position +/// inside that document. class TextDocumentPositionParams implements ToJsonable { static const jsonHandler = LspJsonHandler( TextDocumentPositionParams.canParse, @@ -39697,9 +40670,6 @@ class TextDocumentPositionParams implements ToJsonable { if (ReferenceParams.canParse(json, nullLspJsonReporter)) { return ReferenceParams.fromJson(json); } - if (RenameParams.canParse(json, nullLspJsonReporter)) { - return RenameParams.fromJson(json); - } if (CompletionParams.canParse(json, nullLspJsonReporter)) { return CompletionParams.fromJson(json); } @@ -39845,10 +40815,6 @@ class TextDocumentRegistrationOptions implements ToJsonable { json, nullLspJsonReporter)) { return TextDocumentChangeRegistrationOptions.fromJson(json); } - if (TextDocumentSaveRegistrationOptions.canParse( - json, nullLspJsonReporter)) { - return TextDocumentSaveRegistrationOptions.fromJson(json); - } if (CallHierarchyRegistrationOptions.canParse(json, nullLspJsonReporter)) { return CallHierarchyRegistrationOptions.fromJson(json); } @@ -39932,6 +40898,10 @@ class TextDocumentRegistrationOptions implements ToJsonable { if (SignatureHelpRegistrationOptions.canParse(json, nullLspJsonReporter)) { return SignatureHelpRegistrationOptions.fromJson(json); } + if (TextDocumentSaveRegistrationOptions.canParse( + json, nullLspJsonReporter)) { + return TextDocumentSaveRegistrationOptions.fromJson(json); + } if (TypeDefinitionRegistrationOptions.canParse(json, nullLspJsonReporter)) { return TypeDefinitionRegistrationOptions.fromJson(json); } @@ -40043,8 +41013,9 @@ class TextDocumentSaveReason implements ToJsonable { other is TextDocumentSaveReason && other._value == _value; } +/// Save registration options. class TextDocumentSaveRegistrationOptions - implements TextDocumentRegistrationOptions, ToJsonable { + implements SaveOptions, TextDocumentRegistrationOptions, ToJsonable { static const jsonHandler = LspJsonHandler( TextDocumentSaveRegistrationOptions.canParse, TextDocumentSaveRegistrationOptions.fromJson, @@ -40075,6 +41046,7 @@ class TextDocumentSaveRegistrationOptions final List? documentSelector; /// The client is supposed to include the content on save. + @override final bool? includeText; @override @@ -40498,6 +41470,7 @@ class TextDocumentSyncOptions implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// A text edit applicable to a text document. class TextEdit implements ToJsonable { static const jsonHandler = LspJsonHandler( TextEdit.canParse, @@ -40629,6 +41602,40 @@ class TokenFormat implements ToJsonable { other is TokenFormat && other._value == _value; } +class TraceValues implements ToJsonable { + const TraceValues(this._value); + const TraceValues.fromJson(this._value); + + final String _value; + + static bool canParse(Object? obj, LspJsonReporter reporter) { + return obj is String; + } + + /// Trace messages only. + static const Messages = TraceValues('messages'); + + /// Turn tracing off. + static const Off = TraceValues('off'); + + /// Verbose message tracing. + static const Verbose = TraceValues('verbose'); + + @override + Object toJson() => _value; + + @override + String toString() => _value.toString(); + + @override + int get hashCode => _value.hashCode; + + @override + bool operator ==(Object other) => + other is TraceValues && other._value == _value; +} + +/// Since 3.6.0 class TypeDefinitionClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( TypeDefinitionClientCapabilities.canParse, @@ -40656,7 +41663,8 @@ class TypeDefinitionClientCapabilities implements ToJsonable { final bool? dynamicRegistration; /// The client supports additional metadata in the form of definition links. - /// @since 3.14.0 + /// + /// Since 3.14.0 final bool? linkSupport; @override @@ -41093,6 +42101,7 @@ class TypeDefinitionRegistrationOptions String toString() => jsonEncoder.convert(toJson()); } +/// @since 3.17.0 class TypeHierarchyClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( TypeHierarchyClientCapabilities.canParse, @@ -41160,6 +42169,7 @@ class TypeHierarchyClientCapabilities implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// @since 3.17.0 class TypeHierarchyItem implements ToJsonable { static const jsonHandler = LspJsonHandler( TypeHierarchyItem.canParse, @@ -41228,8 +42238,7 @@ class TypeHierarchyItem implements ToJsonable { final Range range; /// The range that should be selected and revealed when this symbol is being - /// picked, e.g. the name of a function. Must be contained by the - /// [`range`](#TypeHierarchyItem.range). + /// picked, e.g. the name of a function. Must be contained by the `range`. final Range selectionRange; /// Tags for this item. @@ -41411,6 +42420,9 @@ class TypeHierarchyItem implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Type hierarchy options used during static registration. +/// +/// @since 3.17.0 class TypeHierarchyOptions implements WorkDoneProgressOptions, ToJsonable { static const jsonHandler = LspJsonHandler( TypeHierarchyOptions.canParse, @@ -41478,6 +42490,9 @@ class TypeHierarchyOptions implements WorkDoneProgressOptions, ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// The parameter of a `textDocument/prepareTypeHierarchy` request. +/// +/// @since 3.17.0 class TypeHierarchyPrepareParams implements TextDocumentPositionParams, WorkDoneProgressParams, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -41614,6 +42629,9 @@ class TypeHierarchyPrepareParams String toString() => jsonEncoder.convert(toJson()); } +/// Type hierarchy options used during static or dynamic registration. +/// +/// @since 3.17.0 class TypeHierarchyRegistrationOptions implements StaticRegistrationOptions, @@ -41747,6 +42765,9 @@ class TypeHierarchyRegistrationOptions String toString() => jsonEncoder.convert(toJson()); } +/// The parameter of a `typeHierarchy/subtypes` request. +/// +/// @since 3.17.0 class TypeHierarchySubtypesParams implements PartialResultParams, WorkDoneProgressParams, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -41883,6 +42904,9 @@ class TypeHierarchySubtypesParams String toString() => jsonEncoder.convert(toJson()); } +/// The parameter of a `typeHierarchy/supertypes` request. +/// +/// @since 3.17.0 class TypeHierarchySupertypesParams implements PartialResultParams, WorkDoneProgressParams, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -42021,7 +43045,8 @@ class TypeHierarchySupertypesParams /// A diagnostic report indicating that the last returned report is still /// accurate. -/// @since 3.17.0 +/// +/// @since 3.17.0 class UnchangedDocumentDiagnosticReport implements ToJsonable { static const jsonHandler = LspJsonHandler( UnchangedDocumentDiagnosticReport.canParse, @@ -42136,6 +43161,8 @@ class UnchangedDocumentDiagnosticReport implements ToJsonable { } /// Moniker uniqueness level to define scope of the moniker. +/// +/// @since 3.16.0 class UniquenessLevel implements ToJsonable { const UniquenessLevel(this._value); const UniquenessLevel.fromJson(this._value); @@ -42175,7 +43202,7 @@ class UniquenessLevel implements ToJsonable { other is UniquenessLevel && other._value == _value; } -/// General parameters to unregister a capability. +/// General parameters to unregister a request or notification. class Unregistration implements ToJsonable { static const jsonHandler = LspJsonHandler( Unregistration.canParse, @@ -42201,7 +43228,7 @@ class Unregistration implements ToJsonable { /// provided during the register request. final String id; - /// The method / capability to unregister for. + /// The method to unregister for. final String method; @override @@ -42294,9 +43321,6 @@ class UnregistrationParams implements ToJsonable { ); } - /// This should correctly be named `unregistrations`. However changing this // - /// is a breaking change and needs to wait until we deliver a 4.x version // - /// of the specification. final List unregisterations; @override @@ -42355,7 +43379,8 @@ class UnregistrationParams implements ToJsonable { } /// A versioned notebook document identifier. -/// @since 3.17.0 +/// +/// @since 3.17.0 class VersionedNotebookDocumentIdentifier implements ToJsonable { static const jsonHandler = LspJsonHandler( VersionedNotebookDocumentIdentifier.canParse, @@ -42457,6 +43482,7 @@ class VersionedNotebookDocumentIdentifier implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// A text document identifier to denote a specific version of a text document. class VersionedTextDocumentIdentifier implements TextDocumentIdentifier, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -42479,14 +43505,11 @@ class VersionedTextDocumentIdentifier ); } - /// The text document's URI. + /// The text document's uri. @override final String uri; /// The version number of this document. - /// - /// The version number of a document will increase after each change, - /// including undo/redo. The number doesn't need to be consecutive. final int version; @override @@ -42594,7 +43617,7 @@ class WatchKind implements ToJsonable { other is WatchKind && other._value == _value; } -/// The parameters send in a will save text document notification. +/// The parameters sent in a will save text document notification. class WillSaveTextDocumentParams implements ToJsonable { static const jsonHandler = LspJsonHandler( WillSaveTextDocumentParams.canParse, @@ -42728,12 +43751,14 @@ class WindowClientCapabilities implements ToJsonable { ); } - /// Client capabilities for the show document request. - /// @since 3.16.0 + /// Capabilities specific to the showDocument request. + /// + /// @since 3.16.0 final ShowDocumentClientCapabilities? showDocument; - /// Capabilities specific to the showMessage request - /// @since 3.16.0 + /// Capabilities specific to the showMessage request. + /// + /// @since 3.16.0 final ShowMessageRequestClientCapabilities? showMessage; /// It indicates whether the client supports server initiated progress using @@ -42742,7 +43767,8 @@ class WindowClientCapabilities implements ToJsonable { /// The capability also controls Whether client supports handling of progress /// notifications. If set servers are allowed to report a `workDoneProgress` /// property in the request specific server capabilities. - /// @since 3.15.0 + /// + /// @since 3.15.0 final bool? workDoneProgress; @override @@ -42882,7 +43908,7 @@ class WorkDoneProgressBegin implements ToJsonable { /// ignore the `percentage` value in subsequent in report notifications. /// /// The value should be steadily rising. Clients are free to ignore values - /// that are not following this rule. The value range is [0, 100] + /// that are not following this rule. The value range is [0, 100]. final int? percentage; /// Mandatory title of the progress operation. Used to briefly inform about @@ -43427,6 +44453,9 @@ class WorkDoneProgressParams implements ToJsonable { if (InlineValueParams.canParse(json, nullLspJsonReporter)) { return InlineValueParams.fromJson(json); } + if (RenameParams.canParse(json, nullLspJsonReporter)) { + return RenameParams.fromJson(json); + } if (DocumentFormattingParams.canParse(json, nullLspJsonReporter)) { return DocumentFormattingParams.fromJson(json); } @@ -43478,9 +44507,6 @@ class WorkDoneProgressParams implements ToJsonable { if (ReferenceParams.canParse(json, nullLspJsonReporter)) { return ReferenceParams.fromJson(json); } - if (RenameParams.canParse(json, nullLspJsonReporter)) { - return RenameParams.fromJson(json); - } if (SemanticTokensParams.canParse(json, nullLspJsonReporter)) { return SemanticTokensParams.fromJson(json); } @@ -43627,11 +44653,10 @@ class WorkDoneProgressReport implements ToJsonable { ); } - /// Controls enablement state of a cancel button. This property is only valid - /// if a cancel button got requested in the `WorkDoneProgressBegin` payload. + /// Controls enablement state of a cancel button. /// - /// Clients that don't support cancellation or don't support control the - /// button's enablement state are allowed to ignore the setting. + /// Clients that don't support cancellation or don't support controlling the + /// button's enablement state are allowed to ignore the property. final bool? cancellable; final String kind; @@ -43748,6 +44773,7 @@ class WorkDoneProgressReport implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Workspace specific client capabilities. class WorkspaceClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( WorkspaceClientCapabilities.canParse, @@ -43851,19 +44877,23 @@ class WorkspaceClientCapabilities implements ToJsonable { } /// The client supports applying batch edits to the workspace by supporting - /// the request 'workspace/applyEdit' + /// the request + /// 'workspace/applyEdit' final bool? applyEdit; /// Capabilities specific to the code lens requests scoped to the workspace. - /// @since 3.16.0 + /// + /// @since 3.16.0. final CodeLensWorkspaceClientCapabilities? codeLens; /// The client supports `workspace/configuration` requests. - /// @since 3.6.0 + /// + /// @since 3.6.0 final bool? configuration; - /// Client workspace capabilities specific to diagnostics. - /// @since 3.17.0. + /// Capabilities specific to the diagnostic requests scoped to the workspace. + /// + /// @since 3.17.0. final DiagnosticWorkspaceClientCapabilities? diagnostics; /// Capabilities specific to the `workspace/didChangeConfiguration` @@ -43877,31 +44907,38 @@ class WorkspaceClientCapabilities implements ToJsonable { /// Capabilities specific to the `workspace/executeCommand` request. final ExecuteCommandClientCapabilities? executeCommand; - /// The client has support for file requests/notifications. - /// @since 3.16.0 + /// The client has support for file notifications/requests for user operations + /// on files. + /// + /// Since 3.16.0 final FileOperationClientCapabilities? fileOperations; - /// Client workspace capabilities specific to inlay hints. - /// @since 3.17.0 + /// Capabilities specific to the inlay hint requests scoped to the workspace. + /// + /// @since 3.17.0. final InlayHintWorkspaceClientCapabilities? inlayHint; - /// Client workspace capabilities specific to inline values. - /// @since 3.17.0 + /// Capabilities specific to the inline values requests scoped to the + /// workspace. + /// + /// @since 3.17.0. final InlineValueWorkspaceClientCapabilities? inlineValue; /// Capabilities specific to the semantic token requests scoped to the /// workspace. - /// @since 3.16.0 + /// + /// @since 3.16.0. final SemanticTokensWorkspaceClientCapabilities? semanticTokens; /// Capabilities specific to the `workspace/symbol` request. final WorkspaceSymbolClientCapabilities? symbol; - /// Capabilities specific to `WorkspaceEdit`s + /// Capabilities specific to `WorkspaceEdit`s. final WorkspaceEditClientCapabilities? workspaceEdit; /// The client has support for workspace folders. - /// @since 3.6.0 + /// + /// @since 3.6.0 final bool? workspaceFolders; @override @@ -44178,7 +45215,8 @@ class WorkspaceClientCapabilities implements ToJsonable { } /// Parameters of the workspace diagnostic request. -/// @since 3.17.0 +/// +/// @since 3.17.0 class WorkspaceDiagnosticParams implements PartialResultParams, WorkDoneProgressParams, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -44345,7 +45383,8 @@ class WorkspaceDiagnosticParams } /// A workspace diagnostic report. -/// @since 3.17.0 +/// +/// @since 3.17.0 class WorkspaceDiagnosticReport implements ToJsonable { static const jsonHandler = LspJsonHandler( WorkspaceDiagnosticReport.canParse, @@ -44446,7 +45485,8 @@ class WorkspaceDiagnosticReport implements ToJsonable { } /// A partial result for a workspace diagnostic report. -/// @since 3.17.0 +/// +/// @since 3.17.0 class WorkspaceDiagnosticReportPartialResult implements ToJsonable { static const jsonHandler = LspJsonHandler( WorkspaceDiagnosticReportPartialResult.canParse, @@ -44548,6 +45588,22 @@ class WorkspaceDiagnosticReportPartialResult implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// A workspace edit represents changes to many resources managed in the +/// workspace. The edit should either provide `changes` or `documentChanges`. If +/// documentChanges are present they are preferred over `changes` if the client +/// can handle versioned document edits. +/// +/// Since version 3.13.0 a workspace edit can contain resource operations as +/// well. If resource operations are present clients need to execute the +/// operations in the order in which they are provided. So a workspace edit for +/// example can consist of the following two changes: +/// (1) a create file a.txt and (2) a text document edit which insert text into +/// file a.txt. +/// +/// An invalid sequence (e.g. (1) delete file a.txt and (2) insert text into +/// file a.txt) will cause failure of the operation. How the client recovers +/// from the failure is described by the client capability: +/// `workspace.workspaceEdit.failureHandling` class WorkspaceEdit implements ToJsonable { static const jsonHandler = LspJsonHandler( WorkspaceEdit.canParse, @@ -44600,7 +45656,8 @@ class WorkspaceEdit implements ToJsonable { /// /// Whether clients honor this property depends on the client capability /// `workspace.changeAnnotationSupport`. - /// @since 3.16.0 + /// + /// @since 3.16.0 final Map? changeAnnotations; /// Holds changes to existing resources. @@ -44771,7 +45828,8 @@ class WorkspaceEditClientCapabilities implements ToJsonable { /// Whether the client in general supports change annotations on text edits, /// create file, rename file and delete file changes. - /// @since 3.16.0 + /// + /// @since 3.16.0 final WorkspaceEditClientCapabilitiesChangeAnnotationSupport? changeAnnotationSupport; @@ -44780,18 +45838,21 @@ class WorkspaceEditClientCapabilities implements ToJsonable { /// The failure handling strategy of a client if applying the workspace edit /// fails. - /// @since 3.13.0 + /// + /// @since 3.13.0 final FailureHandlingKind? failureHandling; /// Whether the client normalizes line endings to the client specific setting. /// If set to `true` the client will normalize line ending characters in a - /// workspace edit to the client specific new line character(s). - /// @since 3.16.0 + /// workspace edit to the client-specified new line character. + /// + /// @since 3.16.0 final bool? normalizesLineEndings; /// The resource operations the client supports. Clients should at least /// support 'create', 'rename' and 'delete' files and folders. - /// @since 3.13.0 + /// + /// @since 3.13.0 final List? resourceOperations; @override @@ -44929,8 +45990,8 @@ class WorkspaceEditClientCapabilitiesChangeAnnotationSupport ); } - /// Whether the client groups edits with equal labels into tree nodes, for - /// instance all edits labelled with "Changes in Strings" would be a tree + /// Whether the client groups edits with equal labels into tree nodes, + /// for instance all edits labelled with "Changes in Strings" would be a tree /// node. final bool? groupsOnLabel; @@ -44980,6 +46041,7 @@ class WorkspaceEditClientCapabilitiesChangeAnnotationSupport String toString() => jsonEncoder.convert(toJson()); } +/// A workspace folder inside a client. class WorkspaceFolder implements ToJsonable { static const jsonHandler = LspJsonHandler( WorkspaceFolder.canParse, @@ -45219,7 +46281,7 @@ class WorkspaceFoldersServerCapabilities implements ToJsonable { /// Whether the server wants to receive workspace folder change notifications. /// - /// If a string is provided, the string is treated as an ID under which the + /// If a string is provided the string is treated as an ID under which the /// notification is registered on the client side. The ID can be used to /// unregister for these events using the `client/unregisterCapability` /// request. @@ -45294,7 +46356,8 @@ class WorkspaceFoldersServerCapabilities implements ToJsonable { } /// A full document diagnostic report for a workspace diagnostic result. -/// @since 3.17.0 +/// +/// @since 3.17.0 class WorkspaceFullDocumentDiagnosticReport implements FullDocumentDiagnosticReport, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -45486,9 +46549,12 @@ class WorkspaceFullDocumentDiagnosticReport String toString() => jsonEncoder.convert(toJson()); } -/// A special workspace symbol that supports locations without a range -/// @since 3.17.0 -class WorkspaceSymbol implements ToJsonable { +/// A special workspace symbol that supports locations without a range. +/// +/// See also SymbolInformation. +/// +/// @since 3.17.0 +class WorkspaceSymbol implements BaseSymbolInformation, ToJsonable { static const jsonHandler = LspJsonHandler( WorkspaceSymbol.canParse, WorkspaceSymbol.fromJson, @@ -45538,6 +46604,7 @@ class WorkspaceSymbol implements ToJsonable { /// user interface purposes (e.g. to render a qualifier in the user interface /// if necessary). It can't be used to re-infer a hierarchy for the document /// symbols. + @override final String? containerName; /// A data entry field that is preserved on a workspace symbol between a @@ -45545,19 +46612,24 @@ class WorkspaceSymbol implements ToJsonable { final Object? data; /// The kind of this symbol. + @override final SymbolKind kind; - /// The location of this symbol. Whether a server is allowed to return a + /// The location of the symbol. Whether a server is allowed to return a /// location without a range depends on the client capability /// `workspace.symbol.resolveSupport`. /// - /// See also `SymbolInformation.location`. + /// See SymbolInformation#location for more details. final Either2 location; /// The name of this symbol. + @override final String name; - /// Tags for this completion item. + /// Tags for this symbol. + /// + /// @since 3.16.0 + @override final List? tags; @override @@ -45693,6 +46765,7 @@ class WorkspaceSymbol implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Client capabilities for a WorkspaceSymbolRequest. class WorkspaceSymbolClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( WorkspaceSymbolClientCapabilities.canParse, @@ -45737,16 +46810,18 @@ class WorkspaceSymbolClientCapabilities implements ToJsonable { /// The client support partial workspace symbols. The client will send the /// request `workspaceSymbol/resolve` to the server to resolve additional /// properties. - /// @since 3.17.0 - proposedState + /// + /// @since 3.17.0 final WorkspaceSymbolClientCapabilitiesResolveSupport? resolveSupport; /// Specific capabilities for the `SymbolKind` in the `workspace/symbol` /// request. final WorkspaceSymbolClientCapabilitiesSymbolKind? symbolKind; - /// The client supports tags on `SymbolInformation` and `WorkspaceSymbol`. - /// Clients supporting tags have to handle unknown tags gracefully. - /// @since 3.16.0 + /// The client supports tags on `SymbolInformation`. Clients supporting tags + /// have to handle unknown tags gracefully. + /// + /// @since 3.16.0 final WorkspaceSymbolClientCapabilitiesTagSupport? tagSupport; @override @@ -46150,6 +47225,7 @@ class WorkspaceSymbolLocation implements ToJsonable { String toString() => jsonEncoder.convert(toJson()); } +/// Server capabilities for a WorkspaceSymbolRequest. class WorkspaceSymbolOptions implements WorkDoneProgressOptions, ToJsonable { static const jsonHandler = LspJsonHandler( WorkspaceSymbolOptions.canParse, @@ -46177,7 +47253,8 @@ class WorkspaceSymbolOptions implements WorkDoneProgressOptions, ToJsonable { /// The server provides support to resolve additional information for a /// workspace symbol. - /// @since 3.17.0 + /// + /// @since 3.17.0 final bool? resolveProvider; @override final bool? workDoneProgress; @@ -46244,7 +47321,7 @@ class WorkspaceSymbolOptions implements WorkDoneProgressOptions, ToJsonable { String toString() => jsonEncoder.convert(toJson()); } -/// The parameters of a Workspace Symbol Request. +/// The parameters of a WorkspaceSymbolRequest. class WorkspaceSymbolParams implements PartialResultParams, WorkDoneProgressParams, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -46383,6 +47460,7 @@ class WorkspaceSymbolParams String toString() => jsonEncoder.convert(toJson()); } +/// Registration options for a WorkspaceSymbolRequest. class WorkspaceSymbolRegistrationOptions implements WorkspaceSymbolOptions, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -46408,7 +47486,8 @@ class WorkspaceSymbolRegistrationOptions /// The server provides support to resolve additional information for a /// workspace symbol. - /// @since 3.17.0 + /// + /// @since 3.17.0 @override final bool? resolveProvider; @override @@ -46478,7 +47557,8 @@ class WorkspaceSymbolRegistrationOptions } /// An unchanged document diagnostic report for a workspace diagnostic result. -/// @since 3.17.0 +/// +/// @since 3.17.0 class WorkspaceUnchangedDocumentDiagnosticReport implements UnchangedDocumentDiagnosticReport, ToJsonable { static const jsonHandler = LspJsonHandler( diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_rename.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_rename.dart index c283fd2f0e9..c73c919bf5e 100644 --- a/pkg/analysis_server/lib/src/lsp/handlers/handler_rename.dart +++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_rename.dart @@ -11,8 +11,13 @@ import 'package:analysis_server/src/services/refactoring/refactoring.dart'; import 'package:analysis_server/src/services/refactoring/rename_unit_member.dart'; import 'package:analyzer/dart/element/element.dart'; +// TODO(dantup): Generate typedefs in protocol_generated for all named types +// that map onto unions like this after the switch to JSON spec. +typedef PrepareRenameResult + = Either3; + class PrepareRenameHandler - extends MessageHandler { + extends MessageHandler { PrepareRenameHandler(super.server); @override Method get handlesMessage => Method.textDocument_prepareRename; @@ -22,7 +27,7 @@ class PrepareRenameHandler TextDocumentPositionParams.jsonHandler; @override - Future> handle( + Future> handle( TextDocumentPositionParams params, MessageInfo message, CancellationToken token) async { @@ -61,7 +66,7 @@ class PrepareRenameHandler ServerErrorCodes.RenameNotValid, initStatus.problem!.message, null); } - return success(PlaceholderAndRange( + return success(PrepareRenameResult.t2(PlaceholderAndRange( range: toRange( unit.result.lineInfo, // If the offset is set to -1 it means there is no location for the @@ -72,7 +77,7 @@ class PrepareRenameHandler refactorDetails.length, ), placeholder: refactoring.oldName, - )); + ))); }); } } diff --git a/pkg/analysis_server/test/src/computer/color_computer_test.dart b/pkg/analysis_server/test/src/computer/color_computer_test.dart index 159d18eb746..c7b63c2f44a 100644 --- a/pkg/analysis_server/test/src/computer/color_computer_test.dart +++ b/pkg/analysis_server/test/src/computer/color_computer_test.dart @@ -38,6 +38,7 @@ class ColorComputerTest extends AbstractContextTest { 'Color(0xFF0000FF)': 0xFF0000FF, 'Color.fromARGB(255, 0, 0, 255)': 0xFF0000FF, 'Color.fromRGBO(0, 0, 255, 1)': 0xFF0000FF, + 'Color.fromRGBO(0, 0, 255, 1.0)': 0xFF0000FF, // Flutter Painting 'ColorSwatch(0xFF89ABCD, {})': 0xFF89ABCD, // Flutter Material diff --git a/pkg/analysis_server/test/tool/lsp_spec/matchers.dart b/pkg/analysis_server/test/tool/lsp_spec/matchers.dart index 64731c3b847..902ca28e6be 100644 --- a/pkg/analysis_server/test/tool/lsp_spec/matchers.dart +++ b/pkg/analysis_server/test/tool/lsp_spec/matchers.dart @@ -66,7 +66,7 @@ class LiteralTypeMatcher extends Matcher { bool matches(item, Map matchState) { return item is LiteralType && _typeMatcher.matches(item.type, matchState) && - item.literal == _value; + item.valueAsLiteral == _value; } } diff --git a/pkg/analysis_server/test/tool/lsp_spec/typescript_test.dart b/pkg/analysis_server/test/tool/lsp_spec/typescript_test.dart index 386260ec8c3..2befa618209 100644 --- a/pkg/analysis_server/test/tool/lsp_spec/typescript_test.dart +++ b/pkg/analysis_server/test/tool/lsp_spec/typescript_test.dart @@ -8,20 +8,30 @@ import '../../../tool/lsp_spec/typescript_parser.dart'; import 'matchers.dart'; void main() { - group('typescript parser', () { - test('parses an interface', () { - final input = ''' -/** - * Some options. - */ -export interface SomeOptions { - /** - * Options used by something. - */ - options?: OptionKind[]; -} - '''; - final output = parseString(input); + // TODO(dantup): Rename this file in a seperate CL so it doesn't lose its + // history because the number of the large number of changes. + group('meta model reader', () { + test('reads an interface', () { + final input = { + "structures": [ + { + "name": "SomeOptions", + "properties": [ + { + "name": "options", + "type": { + "kind": "array", + "element": {"kind": "reference", "name": "string"} + }, + "optional": true, + "documentation": "Options used by something.", + } + ], + "documentation": "Some options." + }, + ], + }; + final output = readModel(input); expect(output, hasLength(1)); expect(output[0], const TypeMatcher()); final interface = output[0] as Interface; @@ -35,18 +45,37 @@ export interface SomeOptions { expect(field.commentText, equals('''Options used by something.''')); expect(field.allowsNull, isFalse); expect(field.allowsUndefined, isTrue); - expect(field.type, isArrayOf(isSimpleType('OptionKind'))); + expect(field.type, isArrayOf(isSimpleType('string'))); }); - test('parses an interface with a field with an inline/unnamed type', () { - final input = ''' -export interface Capabilities { - textDoc?: { - deprecated?: bool; - }; -} - '''; - final output = parseString(input); + test('reads an interface with a field with an inline/unnamed type', () { + final input = { + "structures": [ + { + "name": "Capabilities", + "properties": [ + { + "name": "textDoc", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "deprecated", + "type": {"kind": "base", "name": "bool"}, + "optional": true, + } + ] + } + }, + "optional": true, + } + ], + "documentation": "Some options." + }, + ], + }; + final output = readModel(input); // Length is two because we'll fabricate the type of textDoc. expect(output, hasLength(2)); @@ -74,20 +103,27 @@ export interface Capabilities { expect(field.type, isSimpleType('CapabilitiesTextDoc')); }); - test('parses an interface with multiple fields', () { - final input = ''' -export interface SomeOptions { - /** - * Options0 used by something. - */ - options0: any; - /** - * Options1 used by something. - */ - options1: any; -} - '''; - final output = parseString(input); + test('reads an interface with multiple fields', () { + final input = { + "structures": [ + { + "name": "SomeOptions", + "properties": [ + { + "name": "options0", + "type": {"kind": "reference", "name": "LSPAny"}, + "documentation": "Options0 used by something.", + }, + { + "name": "options1", + "type": {"kind": "reference", "name": "LSPAny"}, + "documentation": "Options1 used by something.", + } + ], + }, + ], + }; + final output = readModel(input); expect(output, hasLength(1)); expect(output[0], const TypeMatcher()); final interface = output[0] as Interface; @@ -100,59 +136,28 @@ export interface SomeOptions { } }); - test('parses an interface with type args', () { - final input = ''' -interface MyInterface { - data?: D; -} - '''; - final output = parseString(input); - expect(output, hasLength(1)); - expect(output[0], const TypeMatcher()); - final interface = output[0] as Interface; - expect(interface.members, hasLength(1)); - final field = interface.members.first as Field; - expect(field, const TypeMatcher()); - expect(field.name, equals('data')); - expect(field.allowsUndefined, isTrue); - expect(field.allowsNull, isFalse); - expect(field.type, isSimpleType('D')); - }); - - test('parses an interface with Arrays in Array format', () { - final input = ''' -export interface MyMessage { - /** - * The method's params. - */ - params?: Array | string; -} - '''; - final output = parseString(input); - expect(output, hasLength(1)); - expect(output[0], const TypeMatcher()); - final interface = output[0] as Interface; - expect(interface.members, hasLength(1)); - final field = interface.members.first as Field; - expect(field, const TypeMatcher()); - expect(field.name, equals('params')); - expect(field.commentText, equals('''The method's params.''')); - expect(field.allowsUndefined, isTrue); - expect(field.allowsNull, isFalse); - expect(field.type, const TypeMatcher()); - final union = field.type as UnionType; - expect(union.types, hasLength(2)); - expect(union.types[0], isArrayOf(isSimpleType('any'))); - expect(union.types[1], isSimpleType('string')); - }); - - test('parses an interface with a map into a MapType', () { - final input = ''' -export interface WorkspaceEdit { - changes: { [uri: string]: TextEdit[]; }; -} - '''; - final output = parseString(input); + test('reads an interface with a map into a MapType', () { + final input = { + "structures": [ + { + "name": "WorkspaceEdit", + "properties": [ + { + "name": "changes", + "type": { + "kind": "map", + "key": {"kind": "base", "name": "string"}, + "value": { + "kind": "array", + "element": {"kind": "reference", "name": "TextEdit"} + }, + }, + } + ], + }, + ], + }; + final output = readModel(input); expect(output, hasLength(1)); expect(output[0], const TypeMatcher()); final interface = output[0] as Interface; @@ -165,15 +170,46 @@ export interface WorkspaceEdit { }); test('flags nullable undefined values', () { - final input = ''' -export interface A { - canBeBoth?: string | null; - canBeNeither: string; - canBeNull: string | null; - canBeUndefined?: string; -} - '''; - final output = parseString(input); + final input = { + "structures": [ + { + "name": "A", + "properties": [ + { + "name": "canBeBoth", + "type": { + "kind": "or", + "items": [ + {"kind": "base", "name": "string"}, + {"kind": "base", "name": "null"} + ] + }, + "optional": true, + }, + { + "name": "canBeNeither", + "type": {"kind": "base", "name": "string"}, + }, + { + "name": "canBeNull", + "type": { + "kind": "or", + "items": [ + {"kind": "base", "name": "string"}, + {"kind": "base", "name": "null"} + ] + }, + }, + { + "name": "canBeUndefined", + "type": {"kind": "base", "name": "string"}, + "optional": true, + }, + ], + }, + ], + }; + final output = readModel(input); final interface = output[0] as Interface; expect(interface.members, hasLength(4)); for (var m in interface.members) { @@ -194,28 +230,28 @@ export interface A { }); test('formats comments correctly', () { - final input = ''' -/** - * Describes the what this class in lots of words that wrap onto - * multiple lines that will need re-wrapping to format nicely when - * converted into Dart. - * - * Blank lines should remain in-tact, as should: - * - Indented - * - Things - * - * Some docs have: - * - List items that are not indented - * - * Sometimes after a blank line we'll have a note. - * - * *Note* that something. - */ -export interface A { - a: a; -} - '''; - final output = parseString(input); + final input = { + "structures": [ + { + "name": "A", + "properties": [], + "documentation": r""" +Describes the what this class in lots of words that wrap onto multiple lines that will need re-wrapping to format nicely when converted into Dart. + +Blank lines should remain in-tact, as should: + - Indented + - Things + +Some docs have: +- List items that are not indented + +Sometimes after a blank line we'll have a note. + +*Note* that something.""", + }, + ], + }; + final output = readModel(input); final interface = output[0] as Interface; expect(interface.commentText, equals(''' Describes the what this class in lots of words that wrap onto multiple lines that will need re-wrapping to format nicely when converted into Dart. @@ -232,11 +268,19 @@ Sometimes after a blank line we'll have a note. *Note* that something.''')); }); - test('parses a type alias', () { - final input = ''' -export type DocumentSelector = DocumentFilter[]; - '''; - final output = parseString(input); + test('reads a type alias', () { + final input = { + "typeAliases": [ + { + "name": "DocumentSelector", + "type": { + "kind": "array", + "element": {"kind": "reference", "name": "DocumentFilter"} + }, + }, + ], + }; + final output = readModel(input); expect(output, hasLength(1)); expect(output[0], const TypeMatcher()); final typeAlias = output[0] as TypeAlias; @@ -244,23 +288,54 @@ export type DocumentSelector = DocumentFilter[]; expect(typeAlias.baseType, isArrayOf(isSimpleType('DocumentFilter'))); }); - test('parses a type alias that is a union of unnamed types', () { - final input = ''' -export type NameOrLength = { name: string } | { length: number }; - '''; - final output = parseString(input); + test('reads a type alias that is a union of unnamed types', () { + final input = { + "typeAliases": [ + { + "name": "NameOrLength", + "type": { + "kind": "or", + "items": [ + { + "kind": "literal", + "value": { + "properties": [ + { + "name": "name", + "type": {"kind": "base", "name": "string"} + }, + ] + }, + }, + { + "kind": "literal", + "value": { + "properties": [ + { + "name": "length", + "type": {"kind": "base", "name": "number"} + }, + ] + }, + }, + ] + }, + }, + ], + }; + final output = readModel(input); expect(output, hasLength(3)); // Results should be the two inline interfaces followed by the type alias. - expect(output[0], const TypeMatcher()); - final interface1 = output[0] as InlineInterface; + expect(output[0], const TypeMatcher()); + final interface1 = output[0] as Interface; expect(interface1.name, equals('NameOrLength1')); expect(interface1.members, hasLength(1)); expect(interface1.members[0].name, equals('name')); - expect(output[1], const TypeMatcher()); - final interface2 = output[1] as InlineInterface; + expect(output[1], const TypeMatcher()); + final interface2 = output[1] as Interface; expect(interface2.name, equals('NameOrLength2')); expect(interface2.members, hasLength(1)); expect(interface2.members[0].name, equals('length')); @@ -277,27 +352,37 @@ export type NameOrLength = { name: string } | { length: number }; expect(union.types[1], isSimpleType(interface2.name)); }); - test('parses a namespace of constants', () { - final input = ''' -export namespace ResourceOperationKind { - /** - * Supports creating new files and folders. - */ - export const Create: ResourceOperationKind = 'create'; - - /** - * Supports deleting existing files and folders. - */ - export const Delete: ResourceOperationKind = 'delete'; - - /** - * Supports renaming existing files and folders. - */ - export const Rename: ResourceOperationKind = 'rename'; -} - '''; - final output = parseString(input); + test('reads a namespace of constants', () { + final input = { + "enumerations": [ + { + "name": "ResourceOperationKind", + "type": {"kind": "base", "name": "string"}, + "values": [ + { + "name": "Create", + "value": "create", + "documentation": "Supports creating new files and folders.", + }, + { + "name": "Delete", + "value": "delete", + "documentation": + "Supports deleting existing files and folders.", + }, + { + "name": "Rename", + "value": "rename", + "documentation": + "Supports renaming existing files and folders.", + }, + ], + }, + ] + }; + final output = readModel(input); expect(output, hasLength(1)); + expect(output[0], const TypeMatcher()); final namespace = output[0] as Namespace; expect(namespace.members, hasLength(3)); @@ -321,31 +406,33 @@ export namespace ResourceOperationKind { equals('Supports deleting existing files and folders.')); }); - test('parses an enum using keywords as identifiers', () { - final input = ''' -enum Foo { - namespace = 'namespace', - class = 'class', - enum = 'enum', -} - '''; - final output = parseString(input); - expect(output, hasLength(1)); - expect(output.first, const TypeMatcher()); - final enum_ = output.first as Namespace; - expect(enum_.members, hasLength(3)); - expect(enum_.members[0].name, equals('class')); - expect(enum_.members[1].name, equals('enum')); - expect(enum_.members[2].name, equals('namespace')); - }); - - test('parses a tuple in an array', () { - final input = ''' -interface SomeInformation { - label: string | [number, number]; -} - '''; - final output = parseString(input); + test('reads a tuple in an array', () { + final input = { + "structures": [ + { + "name": "SomeInformation", + "properties": [ + { + "name": "label", + "type": { + "kind": "or", + "items": [ + {"kind": "base", "name": "string"}, + { + "kind": "tuple", + "items": [ + {"kind": "base", "name": "number"}, + {"kind": "base", "name": "number"} + ] + } + ] + }, + }, + ], + }, + ], + }; + final output = readModel(input); expect(output, hasLength(1)); expect(output[0], const TypeMatcher()); final interface = output[0] as Interface; @@ -360,13 +447,27 @@ interface SomeInformation { expect(union.types[1], isSimpleType('string')); }); - test('parses an union including Object into a single type', () { - final input = ''' -interface SomeInformation { - label: string | object; -} - '''; - final output = parseString(input); + test('reads an union including LSPObject into a single type', () { + final input = { + "structures": [ + { + "name": "SomeInformation", + "properties": [ + { + "name": "label", + "type": { + "kind": "or", + "items": [ + {"kind": "base", "name": "string"}, + {"kind": "base", "name": "LSPObject"}, + ] + }, + }, + ], + }, + ], + }; + final output = readModel(input); expect(output, hasLength(1)); expect(output[0], const TypeMatcher()); final interface = output[0] as Interface; @@ -374,29 +475,24 @@ interface SomeInformation { final field = interface.members.first as Field; expect(field, const TypeMatcher()); expect(field.name, equals('label')); - expect(field.type, isSimpleType('object')); + expect(field.type, isSimpleType('LSPObject')); }); - test('parses multiple single-line comments into a single token', () { - final input = ''' -// This is line 1 -// This is line 2 -interface SomeInformation { -} - '''; - final output = parseString(input); - expect(output, hasLength(1)); - expect(output[0].commentNode!.token.lexeme, equals('''// This is line 1 -// This is line 2''')); - }); - - test('parses literal string values', () { - final input = ''' -export interface MyType { - kind: 'one'; -} - '''; - final output = parseString(input); + test('reads literal string values', () { + final input = { + "structures": [ + { + "name": "MyType", + "properties": [ + { + "name": "kind", + "type": {"kind": "stringLiteral", "value": "one"}, + }, + ], + }, + ], + }; + final output = readModel(input); expect(output, hasLength(1)); expect(output[0], const TypeMatcher()); final interface = output[0] as Interface; @@ -410,13 +506,27 @@ export interface MyType { expect(field.type, isLiteralOf(isSimpleType('string'), "'one'")); }); - test('parses literal union values', () { - final input = ''' -export interface MyType { - kind: 'one' | 'two'; -} - '''; - final output = parseString(input); + test('reads literal union values', () { + final input = { + "structures": [ + { + "name": "MyType", + "properties": [ + { + "name": "kind", + "type": { + "kind": "or", + "items": [ + {"kind": "stringLiteral", "value": "one"}, + {"kind": "stringLiteral", "value": "two"}, + ] + }, + }, + ], + }, + ], + }; + final output = readModel(input); expect(output, hasLength(1)); expect(output[0], const TypeMatcher()); final interface = output[0] as Interface; @@ -435,3 +545,6 @@ export interface MyType { }); }); } + +List readModel(Map model) => + LspMetaModelCleaner().cleanTypes(LspMetaModelReader().readMap(model).types); diff --git a/pkg/analysis_server/tool/lsp_spec/codegen_dart.dart b/pkg/analysis_server/tool/lsp_spec/codegen_dart.dart index 2fe1e2ee374..8ad832b175e 100644 --- a/pkg/analysis_server/tool/lsp_spec/codegen_dart.dart +++ b/pkg/analysis_server/tool/lsp_spec/codegen_dart.dart @@ -66,62 +66,16 @@ void recordTypes(List types) { _sortSubtypes(); } -/// Renames types that may have been generated with bad names. -Iterable renameTypes(List types) sync* { - const renames = { - // TODO(dantup): These entries can be removed after the - // the migration to JSON meta_model. - 'ClientCapabilitiesWindow': 'WindowClientCapabilities', - 'ClientCapabilitiesWorkspace': 'WorkspaceClientCapabilities', - 'ClientCapabilitiesWorkspaceFileOperations': - 'FileOperationClientCapabilities', - 'ServerCapabilitiesWorkspaceFileOperations': 'FileOperationOptions', - 'ClientCapabilitiesGeneral': 'GeneralClientCapabilities', - 'CompletionClientCapabilitiesCompletionItemInsertTextModeSupport': - 'CompletionItemInsertTextModeSupport', - 'CompletionClientCapabilitiesCompletionItemResolveSupport': - 'CompletionItemResolveSupport', - 'CompletionClientCapabilitiesCompletionItemTagSupport': - 'CompletionItemTagSupport', - 'CodeActionClientCapabilitiesCodeActionLiteralSupportCodeActionKind': - 'CodeActionLiteralSupportCodeActionKind', - // In JSON model this becomes a union of literals which we assign improved - // names to (to avoid numeric suffixes). - 'DocumentFilter': 'TextDocumentFilterWithScheme', - 'ClientCapabilitiesGeneralStaleRequestSupport': - 'GeneralClientCapabilitiesStaleRequestSupport', - 'SignatureHelpClientCapabilitiesSignatureInformationParameterInformation': - 'SignatureInformationParameterInformation', - 'CompletionListItemDefaultsEditRange': 'CompletionItemEditRange', - }; - - for (final type in types) { - if (type is Interface) { - final newName = renames[type.name]; - if (newName != null) { - // Replace with renamed interface. - yield Interface( - type.commentNode, - Token.identifier(newName), - type.typeArgs, - type.baseTypes, - type.members, - ); - // Plus a TypeAlias for the old name. - yield TypeAlias( - type.commentNode, - Token.identifier(type.name), - Type.identifier(newName), - ); - continue; - } - } - yield type; - } -} - TypeBase resolveTypeAlias(TypeBase type, {bool resolveEnumClasses = false}) { if (type is Type) { + if (resolveEnumClasses) { + // Enums are no longer recorded with TypeAliases (as they were in the + // Markdown/TS spec) so must be resolved explicitly to their base types. + final enum_ = _namespaces[type.name]; + if (enum_ != null) { + return enum_.typeOfValues; + } + } // The LSP spec contains type aliases for `integer` and `uinteger` that map // into the `number` type, with comments stating they must be integers. To // preserve the improved typing, do _not_ resolve them to the `number` @@ -165,23 +119,27 @@ String _formatCode(String code) { return code; } -/// Recursively gets all members from superclasses. -List _getAllFields(Interface? interface) { +/// Recursively gets all members from superclasses and returns them sorted +/// alphabetically. +List _getAllFields(Interface? interface) => + _getSortedUnique(_getAllFieldsMap(interface).values.toList()); + +/// Recursively gets all members from superclasses keyed by field name. +Map _getAllFieldsMap(Interface? interface) { // Handle missing interfaces (such as special cased interfaces that won't // be included in this model). if (interface == null) { - return []; + return {}; } - final allFields = interface.members - .whereType() - .followedBy(interface.baseTypes - // This cast is safe because base types are always real types. - .map((type) => _getAllFields(_interfaces[(type as Type).name])) - .expand((ts) => ts)) - .toList(); - - return _getSortedUnique(allFields); + // It's possible our interface redefines something in a base type (for example + // where the base has `String` but this type overrides it with a literal such + // as `ResourceOperation`) so use a map to keep the most-specific by name. + return { + for (final baseType in interface.baseTypes) + ..._getAllFieldsMap(_interfaces[baseType.name]), + for (final field in interface.members.whereType()) field.name: field, + }; } /// Returns a copy of the list sorted by name with duplicates (by name+type) removed. @@ -213,9 +171,9 @@ String _getTypeCheckFailureMessage(TypeBase type) { type = resolveTypeAlias(type); if (type is LiteralType) { - return 'must be the literal ${type.literal}'; + return 'must be the literal ${type.valueAsLiteral}'; } else if (type is LiteralUnionType) { - return 'must be one of the literals ${type.literalTypes.map((t) => t.literal).join(', ')}'; + return 'must be one of the literals ${type.literalTypes.map((t) => t.valueAsLiteral).join(', ')}'; } else { return 'must be of type ${type.dartTypeWithTypeArgs}'; } @@ -223,7 +181,7 @@ String _getTypeCheckFailureMessage(TypeBase type) { bool _isOverride(Interface interface, Field field) { for (var parentType in interface.baseTypes) { - var parent = _interfaces[(parentType as Type).name]; + var parent = _interfaces[parentType.name]; if (parent != null) { if (parent.members.any((m) => m.name == field.name)) { return true; @@ -244,6 +202,7 @@ bool _isSimpleType(TypeBase type) { bool _isSpecType(TypeBase type) { type = resolveTypeAlias(type); return type is Type && + !isAnyType(type) && (_interfaces.containsKey(type.name) || (_namespaces.containsKey(type.name))); } @@ -257,6 +216,7 @@ String _makeValidIdentifier(String identifier) { 'String': 'Str', 'class': 'class_', 'enum': 'enum_', + 'null': 'null_', }; return map[identifier] ?? identifier; } @@ -312,7 +272,7 @@ void _sortSubtypes() { /// for enums. String _specJsonType(TypeBase type) { if (type is Type && _namespaces.containsKey(type.name)) { - final valueType = _namespaces[type.name]!.members.cast().first.type; + final valueType = _namespaces[type.name]!.typeOfValues; return resolveTypeAlias(valueType, resolveEnumClasses: true) .dartTypeWithTypeArgs; } @@ -432,11 +392,13 @@ void _writeConstructor(IndentableStringBuffer buffer, Interface interface) { ..writeIndented('${interface.name}({') ..write(allFields.map((field) { final isLiteral = field.type is LiteralType; - final isRequired = - !isLiteral && !field.allowsNull && !field.allowsUndefined; + final isRequired = !isLiteral && + !field.allowsNull && + !field.allowsUndefined && + !isAnyType(field.type); final requiredKeyword = isRequired ? 'required' : ''; final valueCode = - isLiteral ? ' = ${(field.type as LiteralType).literal}' : ''; + isLiteral ? ' = ${(field.type as LiteralType).valueAsLiteral}' : ''; return '$requiredKeyword this.${field.name}$valueCode, '; }).join()) ..write('})'); @@ -450,10 +412,10 @@ void _writeConstructor(IndentableStringBuffer buffer, Interface interface) { final type = field.type; if (type is LiteralType) { buffer - ..writeIndentedln('if (${field.name} != ${type.literal}) {') + ..writeIndentedln('if (${field.name} != ${type.valueAsLiteral}) {') ..indent() ..writeIndentedln( - "throw '${field.name} may only be the literal ${type.literal.replaceAll("'", "\\'")}';") + "throw '${field.name} may only be the literal ${type.valueAsLiteral.replaceAll("'", "\\'")}';") ..outdent() ..writeIndentedln('}'); } @@ -492,16 +454,10 @@ void _writeDocCommentsAndAnnotations( void _writeEnumClass(IndentableStringBuffer buffer, Namespace namespace) { _writeDocCommentsAndAnnotations(buffer, namespace); final consts = namespace.members.cast().toList(); - final allowsAnyValue = enumClassAllowsAnyValue(namespace.name); - final constructorName = allowsAnyValue ? '' : '._'; - final firstValueType = consts.first.type; - // Enums can have constant values in their fields so if a field is a literal - // use its underlying type for type checking. - final requiredValueType = - firstValueType is LiteralType ? firstValueType.type : firstValueType; - final typeOfValues = - resolveTypeAlias(requiredValueType, resolveEnumClasses: true); final namespaceName = namespace.name; + final typeOfValues = namespace.typeOfValues; + final allowsAnyValue = enumClassAllowsAnyValue(namespaceName); + final constructorName = allowsAnyValue ? '' : '._'; buffer ..writeln('class $namespaceName implements ToJsonable {') @@ -542,8 +498,10 @@ void _writeEnumClass(IndentableStringBuffer buffer, Namespace namespace) { return; } _writeDocCommentsAndAnnotations(buffer, cons); + final memberName = _makeValidIdentifier(cons.name); + final value = cons.valueAsLiteral; buffer.writeIndentedln( - 'static const ${_makeValidIdentifier(cons.name)} = $namespaceName$constructorName(${cons.valueAsLiteral});'); + 'static const $memberName = $namespaceName$constructorName($value);'); }); buffer ..writeln() @@ -683,7 +641,7 @@ void _writeFromJsonCodeForLiteralUnion( {required bool allowsNull}) { final allowedValues = [ if (allowsNull) null, - ...union.literalTypes.map((t) => t.literal) + ...union.literalTypes.map((t) => t.valueAsLiteral) ]; final valueType = union.literalTypes.first.dartTypeWithTypeArgs; final cast = ' as $valueType${allowsNull ? '?' : ''}'; @@ -769,7 +727,7 @@ void _writeFromJsonConstructor( // Add a local variable to allow type promotion (and avoid multiple lookups). final localName = _makeValidIdentifier(field.name); final localNameJson = '${localName}Json'; - buffer.writeIndented("final $localNameJson = json['${field.name}'];"); + buffer.writeIndentedln("final $localNameJson = json['${field.name}'];"); buffer.writeIndented('final $localName = '); _writeFromJsonCode(buffer, field.type, localNameJson, allowsNull: field.allowsNull || field.allowsUndefined); @@ -824,6 +782,7 @@ void _writeHashCode(IndentableStringBuffer buffer, Interface interface) { } void _writeInterface(IndentableStringBuffer buffer, Interface interface) { + final isPrivate = interface.name.startsWith('_'); _writeDocCommentsAndAnnotations(buffer, interface); buffer.writeIndented('class ${interface.nameWithTypeArgs} '); @@ -836,7 +795,9 @@ void _writeInterface(IndentableStringBuffer buffer, Interface interface) { buffer ..writeln('{') ..indent(); - _writeJsonHandler(buffer, interface); + if (!isPrivate) { + _writeJsonHandler(buffer, interface); + } _writeConstructor(buffer, interface); _writeFromJsonConstructor(buffer, interface); // Handle Consts and Fields separately, since we need to include superclass @@ -1019,7 +980,7 @@ void _writeTypeCheckCondition(IndentableStringBuffer buffer, buffer.write('$valueCode is$operator $fullDartType'); } else if (type is LiteralType) { final equals = negation ? '!=' : '=='; - buffer.write('$valueCode $equals ${type.literal}'); + buffer.write('$valueCode $equals ${type.valueAsLiteral}'); } else if (_isSpecType(type)) { buffer.write('$operator$dartType.canParse($valueCode, $reporter)'); } else if (type is ArrayType) { diff --git a/pkg/analysis_server/tool/lsp_spec/generate_all.dart b/pkg/analysis_server/tool/lsp_spec/generate_all.dart index d22b8847a34..0995760be5b 100644 --- a/pkg/analysis_server/tool/lsp_spec/generate_all.dart +++ b/pkg/analysis_server/tool/lsp_spec/generate_all.dart @@ -4,14 +4,11 @@ import 'dart:io'; -import 'package:analysis_server/src/utilities/strings.dart'; import 'package:args/args.dart'; import 'package:http/http.dart' as http; import 'package:path/path.dart' as path; import 'codegen_dart.dart'; -import 'markdown.dart'; -import 'typescript.dart'; import 'typescript_parser.dart'; Future main(List arguments) async { @@ -28,14 +25,9 @@ Future main(List arguments) async { final outFolder = path.join(packageFolder, 'lib', 'lsp_protocol'); Directory(outFolder).createSync(); - // Collect definitions for types in the spec and our custom extensions. - var specTypes = await getSpecClasses(args); - var customTypes = getCustomClasses(); - - // Handle some renames of types where we generate names that might not be - // ideal. - specTypes = renameTypes(specTypes).toList(); - customTypes = renameTypes(customTypes).toList(); + // Collect definitions for types in the model and our custom extensions. + final specTypes = await getSpecClasses(args); + final customTypes = getCustomClasses(); // Record both sets of types in dictionaries for faster lookups, but also so // they can reference each other and we can find the definitions during @@ -65,96 +57,35 @@ final argParser = ArgParser() help: 'Download the latest version of the LSP spec before generating types'); +final String localLicensePath = path.join( + path.dirname(Platform.script.toFilePath()), 'lsp_meta_model.license.txt'); + final String localSpecPath = path.join( - path.dirname(Platform.script.toFilePath()), 'lsp_specification.md'); + path.dirname(Platform.script.toFilePath()), 'lsp_meta_model.json'); final Uri specLicenseUri = Uri.parse( - 'https://raw.githubusercontent.com/Microsoft/language-server-protocol/gh-pages/License.txt'); + 'https://microsoft.github.io/language-server-protocol/License.txt'); -/// The URI of the version of the spec to generate from. This should be periodically updated as -/// there's no longer a stable URI for the latest published version. +/// The URI of the version of the LSP meta model to generate from. This should +/// be periodically updated to the latest version. final Uri specUri = Uri.parse( - 'https://raw.githubusercontent.com/microsoft/language-server-protocol/gh-pages/_specifications/lsp/3.17/specification.md'); - -/// Pattern to extract inline types from the `result: {xx, yy }` notes in the spec. -/// Doesn't parse past full stops as some of these have english sentences tagged on -/// the end that we don't want to parse. -final _resultsInlineTypesPattern = RegExp(r'''\* result:[^\.{}]*({[^\.`]*})'''); + 'https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/metaModel/metaModel.json'); Future downloadSpec() async { final specResp = await http.get(specUri); final licenseResp = await http.get(specLicenseUri); - final text = [ - ''' -This is an unmodified copy of the Language Server Protocol Specification, -downloaded from $specUri. It is the version of the specification that was -used to generate a portion of the Dart code used to support the protocol. -To regenerate the generated code, run the script in -"analysis_server/tool/lsp_spec/generate_all.dart" with no arguments. To -download the latest version of the specification before regenerating the -code, run the same script with an argument of "--download".''', - licenseResp.body, - await _fetchIncludes(specResp.body, specUri), - ]; - await File(localSpecPath).writeAsString(text.join('\n\n---\n\n')); -} + assert(specResp.statusCode == 200); + assert(licenseResp.statusCode == 200); -Namespace extractMethodsEnum(String spec) { - Const toConstant(String value) { - final comment = Comment( - Token(TokenType.COMMENT, '''Constant for the '$value' method.''')); - - // Generate a safe name for the member from the string. Those that start with - // $/ will have the prefix removed and all slashes should be replaced with - // underscores. - final safeMemberName = value.replaceAll(r'$/', '').replaceAll('/', '_'); - - return Const( - comment, - Token.identifier(safeMemberName), - Type.identifier('string'), - Token(TokenType.STRING, "'$value'"), - ); - } - - final comment = Comment(Token(TokenType.COMMENT, - 'Valid LSP methods known at the time of code generation from the spec.')); - final methodConstants = extractMethodNames(spec).map(toConstant).toList(); - - return Namespace(comment, Token.identifier('Method'), methodConstants); -} - -/// Extract inline types found directly in the `results:` sections of the spec -/// that are not declared with their own names elsewhere. -List extractResultsInlineTypes(String spec) { - InlineInterface toInterface(String typeDef) { - // The definition passed here will be a bare inline type, such as: - // - // { range: Range, placeholder: string } - // - // In order to parse this, we'll just format it as a type alias and then - // run it through the standard parsing code. - final typeAlias = 'type temp = ${typeDef.replaceAll(',', ';')};'; - - final parsed = parseString(typeAlias); - - // Extract the InlineInterface that was created. - final interface = - parsed.firstWhere((t) => t is InlineInterface) as InlineInterface; - - // Create a new name based on the fields. - var newName = interface.members.map((m) => capitalize(m.name)).join('And'); - - return InlineInterface(newName, interface.members); - } - - return _resultsInlineTypesPattern - .allMatches(spec) - .map((m) => m.group(1)!.trim()) - .toList() - .map(toInterface) - .toList(); + await File(localSpecPath).writeAsString(specResp.body); + await File(localLicensePath).writeAsString( + 'This license is for the ${path.basename(localSpecPath)} file.\n\n' + '${path.basename(localLicensePath)} downloaded from: $specLicenseUri\n' + '${path.basename(localSpecPath)} downloaded from: $specUri\n' + '\n--\n\n' + '${licenseResp.body}', + ); } String generatedFileHeader(int year, {bool importCustom = false}) => ''' @@ -179,6 +110,7 @@ const jsonEncoder = JsonEncoder.withIndent(' '); '''; List getCustomClasses() { + /// Helper to create an interface type. Interface interface(String name, List fields, {String? baseType}) { return Interface( null, @@ -189,6 +121,7 @@ List getCustomClasses() { ); } + /// Helper to create a field. Field field( String name, { String? comment, @@ -221,6 +154,26 @@ List getCustomClasses() { Token.identifier('LSPObject'), Type.Any, ), + // The DocumentFilter more complex in v3.17's meta_model (to allow + // TextDocumentFilters to be guaranteed to have at least one of language, + // pattern, scheme) but we only ever use a single type in the server so + // for compatibility, alias that type to the original TS-spec name. + // TODO(dantup): Improve this after the TS->JSON Spec migration. + TypeAlias( + null, + Token.identifier('DocumentFilter'), + Type.identifier('TextDocumentFilter2'), + ), + // Similarly, the meta_model includes String as an option for + // DocumentSelector which is deprecated and we never previously supported + // (because the TypeScript spec did not include it in the type) so preserve + // that. + // TODO(dantup): Improve this after the TS->JSON Spec migration. + TypeAlias( + null, + Token.identifier('DocumentSelector'), + ArrayType(Type.identifier('TextDocumentFilterWithScheme')), + ), interface('Message', [ field('jsonrpc', type: 'string'), field('clientRequestTime', type: 'int', canBeUndefined: true), @@ -400,79 +353,10 @@ Future> getSpecClasses(ArgResults args) async { if (download) { await downloadSpec(); } - final spec = await readSpec(); - final types = extractTypeScriptBlocks(spec) - .where(shouldIncludeScriptBlock) - .map(parseString) - .expand((f) => f) - .where(includeTypeDefinitionInOutput) - .toList(); + final file = File(localSpecPath); + var model = LspMetaModelReader().readFile(file); + model = LspMetaModelCleaner().cleanModel(model); - // Generate an enum for all of the request methods to avoid strings. - types.add(extractMethodsEnum(spec)); - - // Extract additional inline types that are specified online in the `results` - // section of the doc. - types.addAll(extractResultsInlineTypes(spec)); - return types; -} - -Future readSpec() => File(localSpecPath).readAsString(); - -/// Returns whether a script block should be parsed or not. -bool shouldIncludeScriptBlock(String input) { - // Skip over some typescript blocks that are known sample code and not part - // of the LSP spec. - if (input.trim() == r"export const EOL: string[] = ['\n', '\r\n', '\r'];" || - input.startsWith('textDocument.codeAction.resolveSupport =') || - input.startsWith('textDocument.inlayHint.resolveSupport =') || - // These two are example definitions, the real definitions start "export" - // and contain some base classes. - input.startsWith('interface HoverParams {') || - input.startsWith('interface HoverResult {')) { - return false; - } - - // There are some code blocks that just have example JSON in them. - if (input.startsWith('{') && input.endsWith('}')) { - return false; - } - - // There are some example blocks that just contain arrays with no definitions. - // They're most easily noted by ending with `]` which no valid TypeScript blocks - // do. - if (input.trim().endsWith(']')) { - return false; - } - - // There's a chunk of typescript that is just a partial snippet from a real - // interface declared elsewhere that we can only detect by the leading comment. - if (input - .replaceAll('\r', '') - .startsWith('/**\n\t * Window specific client capabilities.')) { - return false; - } - - return true; -} - -/// Fetches and in-lines any includes that appear in [spec] in the form -/// `{% include_relative types/uri.md %}`. -Future _fetchIncludes(String spec, Uri baseUri) async { - final pattern = RegExp(r'{% include_relative ([\w\-.\/]+.md) %}'); - final includeStrings = {}; - for (final match in pattern.allMatches(spec)) { - final relativeUri = match.group(1)!; - final fullUri = baseUri.resolve(relativeUri); - final response = await http.get(fullUri); - if (response.statusCode != 200) { - throw 'Failed to fetch $fullUri (${response.statusCode} ${response.reasonPhrase})'; - } - includeStrings[relativeUri] = response.body; - } - return spec.replaceAllMapped( - pattern, - (match) => includeStrings[match.group(1)!]!, - ); + return model.types; } diff --git a/pkg/analysis_server/tool/lsp_spec/lsp_meta_model.json b/pkg/analysis_server/tool/lsp_spec/lsp_meta_model.json new file mode 100644 index 00000000000..eb3205ea7dd --- /dev/null +++ b/pkg/analysis_server/tool/lsp_spec/lsp_meta_model.json @@ -0,0 +1,14316 @@ +{ + "requests": [ + { + "method": "textDocument/implementation", + "result": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "Definition" + }, + { + "kind": "array", + "element": { + "kind": "reference", + "name": "DefinitionLink" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "ImplementationParams" + }, + "partialResult": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "Location" + } + }, + { + "kind": "array", + "element": { + "kind": "reference", + "name": "DefinitionLink" + } + } + ] + }, + "registrationOptions": { + "kind": "reference", + "name": "ImplementationRegistrationOptions" + }, + "documentation": "A request to resolve the implementation locations of a symbol at a given text\ndocument position. The request's parameter is of type [TextDocumentPositionParams]\n(#TextDocumentPositionParams) the response is of type [Definition](#Definition) or a\nThenable that resolves to such." + }, + { + "method": "textDocument/typeDefinition", + "result": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "Definition" + }, + { + "kind": "array", + "element": { + "kind": "reference", + "name": "DefinitionLink" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "TypeDefinitionParams" + }, + "partialResult": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "Location" + } + }, + { + "kind": "array", + "element": { + "kind": "reference", + "name": "DefinitionLink" + } + } + ] + }, + "registrationOptions": { + "kind": "reference", + "name": "TypeDefinitionRegistrationOptions" + }, + "documentation": "A request to resolve the type definition locations of a symbol at a given text\ndocument position. The request's parameter is of type [TextDocumentPositioParams]\n(#TextDocumentPositionParams) the response is of type [Definition](#Definition) or a\nThenable that resolves to such." + }, + { + "method": "workspace/workspaceFolders", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "WorkspaceFolder" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "documentation": "The `workspace/workspaceFolders` is sent from the server to the client to fetch the open workspace folders." + }, + { + "method": "workspace/configuration", + "result": { + "kind": "array", + "element": { + "kind": "reference", + "name": "LSPAny" + } + }, + "params": { + "kind": "and", + "items": [ + { + "kind": "reference", + "name": "ConfigurationParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ] + }, + "documentation": "The 'workspace/configuration' request is sent from the server to the client to fetch a certain\nconfiguration setting.\n\nThis pull model replaces the old push model were the client signaled configuration change via an\nevent. If the server still needs to react to configuration changes (since the server caches the\nresult of `workspace/configuration` requests) the server should register for an empty configuration\nchange event and empty the cache if such an event is received." + }, + { + "method": "textDocument/documentColor", + "result": { + "kind": "array", + "element": { + "kind": "reference", + "name": "ColorInformation" + } + }, + "params": { + "kind": "reference", + "name": "DocumentColorParams" + }, + "partialResult": { + "kind": "array", + "element": { + "kind": "reference", + "name": "ColorInformation" + } + }, + "registrationOptions": { + "kind": "reference", + "name": "DocumentColorRegistrationOptions" + }, + "documentation": "A request to list all color symbols found in a given text document. The request's\nparameter is of type [DocumentColorParams](#DocumentColorParams) the\nresponse is of type [ColorInformation[]](#ColorInformation) or a Thenable\nthat resolves to such." + }, + { + "method": "textDocument/colorPresentation", + "result": { + "kind": "array", + "element": { + "kind": "reference", + "name": "ColorPresentation" + } + }, + "params": { + "kind": "reference", + "name": "ColorPresentationParams" + }, + "partialResult": { + "kind": "array", + "element": { + "kind": "reference", + "name": "ColorPresentation" + } + }, + "registrationOptions": { + "kind": "and", + "items": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + }, + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + } + ] + }, + "documentation": "A request to list all presentation for a color. The request's\nparameter is of type [ColorPresentationParams](#ColorPresentationParams) the\nresponse is of type [ColorInformation[]](#ColorInformation) or a Thenable\nthat resolves to such." + }, + { + "method": "textDocument/foldingRange", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "FoldingRange" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "FoldingRangeParams" + }, + "partialResult": { + "kind": "array", + "element": { + "kind": "reference", + "name": "FoldingRange" + } + }, + "registrationOptions": { + "kind": "reference", + "name": "FoldingRangeRegistrationOptions" + }, + "documentation": "A request to provide folding ranges in a document. The request's\nparameter is of type [FoldingRangeParams](#FoldingRangeParams), the\nresponse is of type [FoldingRangeList](#FoldingRangeList) or a Thenable\nthat resolves to such." + }, + { + "method": "textDocument/declaration", + "result": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "Declaration" + }, + { + "kind": "array", + "element": { + "kind": "reference", + "name": "DeclarationLink" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "DeclarationParams" + }, + "partialResult": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "Location" + } + }, + { + "kind": "array", + "element": { + "kind": "reference", + "name": "DeclarationLink" + } + } + ] + }, + "registrationOptions": { + "kind": "reference", + "name": "DeclarationRegistrationOptions" + }, + "documentation": "A request to resolve the type definition locations of a symbol at a given text\ndocument position. The request's parameter is of type [TextDocumentPositionParams]\n(#TextDocumentPositionParams) the response is of type [Declaration](#Declaration)\nor a typed array of [DeclarationLink](#DeclarationLink) or a Thenable that resolves\nto such." + }, + { + "method": "textDocument/selectionRange", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "SelectionRange" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "SelectionRangeParams" + }, + "partialResult": { + "kind": "array", + "element": { + "kind": "reference", + "name": "SelectionRange" + } + }, + "registrationOptions": { + "kind": "reference", + "name": "SelectionRangeRegistrationOptions" + }, + "documentation": "A request to provide selection ranges in a document. The request's\nparameter is of type [SelectionRangeParams](#SelectionRangeParams), the\nresponse is of type [SelectionRange[]](#SelectionRange[]) or a Thenable\nthat resolves to such." + }, + { + "method": "window/workDoneProgress/create", + "result": { + "kind": "base", + "name": "null" + }, + "params": { + "kind": "reference", + "name": "WorkDoneProgressCreateParams" + }, + "documentation": "The `window/workDoneProgress/create` request is sent from the server to the client to initiate progress\nreporting from the server." + }, + { + "method": "textDocument/prepareCallHierarchy", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "CallHierarchyItem" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "CallHierarchyPrepareParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "CallHierarchyRegistrationOptions" + }, + "documentation": "A request to result a `CallHierarchyItem` in a document at a given position.\nCan be used as an input to an incoming or outgoing call hierarchy.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "method": "callHierarchy/incomingCalls", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "CallHierarchyIncomingCall" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "CallHierarchyIncomingCallsParams" + }, + "partialResult": { + "kind": "array", + "element": { + "kind": "reference", + "name": "CallHierarchyIncomingCall" + } + }, + "documentation": "A request to resolve the incoming calls for a given `CallHierarchyItem`.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "method": "callHierarchy/outgoingCalls", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "CallHierarchyOutgoingCall" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "CallHierarchyOutgoingCallsParams" + }, + "partialResult": { + "kind": "array", + "element": { + "kind": "reference", + "name": "CallHierarchyOutgoingCall" + } + }, + "documentation": "A request to resolve the outgoing calls for a given `CallHierarchyItem`.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "method": "textDocument/semanticTokens/full", + "result": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "SemanticTokens" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "SemanticTokensParams" + }, + "partialResult": { + "kind": "reference", + "name": "SemanticTokensPartialResult" + }, + "registrationOptions": { + "kind": "reference", + "name": "SemanticTokensRegistrationOptions" + }, + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "method": "textDocument/semanticTokens/full/delta", + "result": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "SemanticTokens" + }, + { + "kind": "reference", + "name": "SemanticTokensDelta" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "SemanticTokensDeltaParams" + }, + "partialResult": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "SemanticTokensPartialResult" + }, + { + "kind": "reference", + "name": "SemanticTokensDeltaPartialResult" + } + ] + }, + "registrationOptions": { + "kind": "reference", + "name": "SemanticTokensRegistrationOptions" + }, + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "method": "textDocument/semanticTokens/range", + "result": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "SemanticTokens" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "SemanticTokensRangeParams" + }, + "partialResult": { + "kind": "reference", + "name": "SemanticTokensPartialResult" + }, + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "method": "workspace/semanticTokens/refresh", + "result": { + "kind": "base", + "name": "null" + }, + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "method": "window/showDocument", + "result": { + "kind": "reference", + "name": "ShowDocumentResult" + }, + "params": { + "kind": "reference", + "name": "ShowDocumentParams" + }, + "documentation": "A request to show a document. This request might open an\nexternal program depending on the value of the URI to open.\nFor example a request to open `https://code.visualstudio.com/`\nwill very likely open the URI in a WEB browser.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "method": "textDocument/linkedEditingRange", + "result": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "LinkedEditingRanges" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "LinkedEditingRangeParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "LinkedEditingRangeRegistrationOptions" + }, + "documentation": "A request to provide ranges that can be edited together.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "method": "workspace/willCreateFiles", + "result": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "WorkspaceEdit" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "CreateFilesParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "FileOperationRegistrationOptions" + }, + "documentation": "The will create files request is sent from the client to the server before files are actually\ncreated as long as the creation is triggered from within the client.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "method": "workspace/willRenameFiles", + "result": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "WorkspaceEdit" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "RenameFilesParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "FileOperationRegistrationOptions" + }, + "documentation": "The will rename files request is sent from the client to the server before files are actually\nrenamed as long as the rename is triggered from within the client.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "method": "workspace/willDeleteFiles", + "result": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "WorkspaceEdit" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "DeleteFilesParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "FileOperationRegistrationOptions" + }, + "documentation": "The did delete files notification is sent from the client to the server when\nfiles were deleted from within the client.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "method": "textDocument/moniker", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "Moniker" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "MonikerParams" + }, + "partialResult": { + "kind": "array", + "element": { + "kind": "reference", + "name": "Moniker" + } + }, + "registrationOptions": { + "kind": "reference", + "name": "MonikerRegistrationOptions" + }, + "documentation": "A request to get the moniker of a symbol at a given text document position.\nThe request parameter is of type [TextDocumentPositionParams](#TextDocumentPositionParams).\nThe response is of type [Moniker[]](#Moniker[]) or `null`." + }, + { + "method": "textDocument/prepareTypeHierarchy", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "TypeHierarchyItem" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "TypeHierarchyPrepareParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "TypeHierarchyRegistrationOptions" + }, + "documentation": "A request to result a `TypeHierarchyItem` in a document at a given position.\nCan be used as an input to a subtypes or supertypes type hierarchy.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "method": "typeHierarchy/supertypes", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "TypeHierarchyItem" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "TypeHierarchySupertypesParams" + }, + "partialResult": { + "kind": "array", + "element": { + "kind": "reference", + "name": "TypeHierarchyItem" + } + }, + "documentation": "A request to resolve the supertypes for a given `TypeHierarchyItem`.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "method": "typeHierarchy/subtypes", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "TypeHierarchyItem" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "TypeHierarchySubtypesParams" + }, + "partialResult": { + "kind": "array", + "element": { + "kind": "reference", + "name": "TypeHierarchyItem" + } + }, + "documentation": "A request to resolve the subtypes for a given `TypeHierarchyItem`.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "method": "textDocument/inlineValue", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "InlineValue" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "InlineValueParams" + }, + "partialResult": { + "kind": "array", + "element": { + "kind": "reference", + "name": "InlineValue" + } + }, + "registrationOptions": { + "kind": "reference", + "name": "InlineValueRegistrationOptions" + }, + "documentation": "A request to provide inline values in a document. The request's parameter is of\ntype [InlineValueParams](#InlineValueParams), the response is of type\n[InlineValue[]](#InlineValue[]) or a Thenable that resolves to such.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "method": "workspace/inlineValue/refresh", + "result": { + "kind": "base", + "name": "null" + }, + "documentation": "@since 3.17.0", + "since": "3.17.0" + }, + { + "method": "textDocument/inlayHint", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "InlayHint" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "InlayHintParams" + }, + "partialResult": { + "kind": "array", + "element": { + "kind": "reference", + "name": "InlayHint" + } + }, + "registrationOptions": { + "kind": "reference", + "name": "InlayHintRegistrationOptions" + }, + "documentation": "A request to provide inlay hints in a document. The request's parameter is of\ntype [InlayHintsParams](#InlayHintsParams), the response is of type\n[InlayHint[]](#InlayHint[]) or a Thenable that resolves to such.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "method": "inlayHint/resolve", + "result": { + "kind": "reference", + "name": "InlayHint" + }, + "params": { + "kind": "reference", + "name": "InlayHint" + }, + "documentation": "A request to resolve additional properties for an inlay hint.\nThe request's parameter is of type [InlayHint](#InlayHint), the response is\nof type [InlayHint](#InlayHint) or a Thenable that resolves to such.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "method": "workspace/inlayHint/refresh", + "result": { + "kind": "base", + "name": "null" + }, + "documentation": "@since 3.17.0", + "since": "3.17.0" + }, + { + "method": "textDocument/diagnostic", + "result": { + "kind": "reference", + "name": "DocumentDiagnosticReport" + }, + "params": { + "kind": "reference", + "name": "DocumentDiagnosticParams" + }, + "partialResult": { + "kind": "reference", + "name": "DocumentDiagnosticReportPartialResult" + }, + "errorData": { + "kind": "reference", + "name": "DiagnosticServerCancellationData" + }, + "registrationOptions": { + "kind": "reference", + "name": "DiagnosticRegistrationOptions" + }, + "documentation": "The document diagnostic request definition.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "method": "workspace/diagnostic", + "result": { + "kind": "reference", + "name": "WorkspaceDiagnosticReport" + }, + "params": { + "kind": "reference", + "name": "WorkspaceDiagnosticParams" + }, + "partialResult": { + "kind": "reference", + "name": "WorkspaceDiagnosticReportPartialResult" + }, + "errorData": { + "kind": "reference", + "name": "DiagnosticServerCancellationData" + }, + "documentation": "The workspace diagnostic request definition.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "method": "workspace/diagnostic/refresh", + "result": { + "kind": "base", + "name": "null" + }, + "documentation": "The diagnostic refresh request definition.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "method": "client/registerCapability", + "result": { + "kind": "base", + "name": "null" + }, + "params": { + "kind": "reference", + "name": "RegistrationParams" + }, + "documentation": "The `client/registerCapability` request is sent from the server to the client to register a new capability\nhandler on the client side." + }, + { + "method": "client/unregisterCapability", + "result": { + "kind": "base", + "name": "null" + }, + "params": { + "kind": "reference", + "name": "UnregistrationParams" + }, + "documentation": "The `client/unregisterCapability` request is sent from the server to the client to unregister a previously registered capability\nhandler on the client side." + }, + { + "method": "initialize", + "result": { + "kind": "reference", + "name": "InitializeResult" + }, + "params": { + "kind": "reference", + "name": "InitializeParams" + }, + "errorData": { + "kind": "reference", + "name": "InitializeError" + }, + "documentation": "The initialize request is sent from the client to the server.\nIt is sent once as the request after starting up the server.\nThe requests parameter is of type [InitializeParams](#InitializeParams)\nthe response if of type [InitializeResult](#InitializeResult) of a Thenable that\nresolves to such." + }, + { + "method": "shutdown", + "result": { + "kind": "base", + "name": "null" + }, + "documentation": "A shutdown request is sent from the client to the server.\nIt is sent once when the client decides to shutdown the\nserver. The only notification that is sent after a shutdown request\nis the exit event." + }, + { + "method": "window/showMessageRequest", + "result": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "MessageActionItem" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "ShowMessageRequestParams" + }, + "documentation": "The show message request is sent from the server to the client to show a message\nand a set of options actions to the user." + }, + { + "method": "textDocument/willSaveWaitUntil", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "TextEdit" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "WillSaveTextDocumentParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + "documentation": "A document will save request is sent from the client to the server before\nthe document is actually saved. The request can return an array of TextEdits\nwhich will be applied to the text document before it is saved. Please note that\nclients might drop results if computing the text edits took too long or if a\nserver constantly fails on this request. This is done to keep the save fast and\nreliable." + }, + { + "method": "textDocument/completion", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "CompletionItem" + } + }, + { + "kind": "reference", + "name": "CompletionList" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "CompletionParams" + }, + "partialResult": { + "kind": "array", + "element": { + "kind": "reference", + "name": "CompletionItem" + } + }, + "registrationOptions": { + "kind": "reference", + "name": "CompletionRegistrationOptions" + }, + "documentation": "Request to request completion at a given text document position. The request's\nparameter is of type [TextDocumentPosition](#TextDocumentPosition) the response\nis of type [CompletionItem[]](#CompletionItem) or [CompletionList](#CompletionList)\nor a Thenable that resolves to such.\n\nThe request can delay the computation of the [`detail`](#CompletionItem.detail)\nand [`documentation`](#CompletionItem.documentation) properties to the `completionItem/resolve`\nrequest. However, properties that are needed for the initial sorting and filtering, like `sortText`,\n`filterText`, `insertText`, and `textEdit`, must not be changed during resolve." + }, + { + "method": "completionItem/resolve", + "result": { + "kind": "reference", + "name": "CompletionItem" + }, + "params": { + "kind": "reference", + "name": "CompletionItem" + }, + "documentation": "Request to resolve additional information for a given completion item.The request's\nparameter is of type [CompletionItem](#CompletionItem) the response\nis of type [CompletionItem](#CompletionItem) or a Thenable that resolves to such." + }, + { + "method": "textDocument/hover", + "result": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "Hover" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "HoverParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "HoverRegistrationOptions" + }, + "documentation": "Request to request hover information at a given text document position. The request's\nparameter is of type [TextDocumentPosition](#TextDocumentPosition) the response is of\ntype [Hover](#Hover) or a Thenable that resolves to such." + }, + { + "method": "textDocument/signatureHelp", + "result": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "SignatureHelp" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "SignatureHelpParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "SignatureHelpRegistrationOptions" + } + }, + { + "method": "textDocument/definition", + "result": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "Definition" + }, + { + "kind": "array", + "element": { + "kind": "reference", + "name": "DefinitionLink" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "DefinitionParams" + }, + "partialResult": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "Location" + } + }, + { + "kind": "array", + "element": { + "kind": "reference", + "name": "DefinitionLink" + } + } + ] + }, + "registrationOptions": { + "kind": "reference", + "name": "DefinitionRegistrationOptions" + }, + "documentation": "A request to resolve the definition location of a symbol at a given text\ndocument position. The request's parameter is of type [TextDocumentPosition]\n(#TextDocumentPosition) the response is of either type [Definition](#Definition)\nor a typed array of [DefinitionLink](#DefinitionLink) or a Thenable that resolves\nto such." + }, + { + "method": "textDocument/references", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "Location" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "ReferenceParams" + }, + "partialResult": { + "kind": "array", + "element": { + "kind": "reference", + "name": "Location" + } + }, + "registrationOptions": { + "kind": "reference", + "name": "ReferenceRegistrationOptions" + }, + "documentation": "A request to resolve project-wide references for the symbol denoted\nby the given text document position. The request's parameter is of\ntype [ReferenceParams](#ReferenceParams) the response is of type\n[Location[]](#Location) or a Thenable that resolves to such." + }, + { + "method": "textDocument/documentHighlight", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "DocumentHighlight" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "DocumentHighlightParams" + }, + "partialResult": { + "kind": "array", + "element": { + "kind": "reference", + "name": "DocumentHighlight" + } + }, + "registrationOptions": { + "kind": "reference", + "name": "DocumentHighlightRegistrationOptions" + }, + "documentation": "Request to resolve a [DocumentHighlight](#DocumentHighlight) for a given\ntext document position. The request's parameter is of type [TextDocumentPosition]\n(#TextDocumentPosition) the request response is of type [DocumentHighlight[]]\n(#DocumentHighlight) or a Thenable that resolves to such." + }, + { + "method": "textDocument/documentSymbol", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "SymbolInformation" + } + }, + { + "kind": "array", + "element": { + "kind": "reference", + "name": "DocumentSymbol" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "DocumentSymbolParams" + }, + "partialResult": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "SymbolInformation" + } + }, + { + "kind": "array", + "element": { + "kind": "reference", + "name": "DocumentSymbol" + } + } + ] + }, + "registrationOptions": { + "kind": "reference", + "name": "DocumentSymbolRegistrationOptions" + }, + "documentation": "A request to list all symbols found in a given text document. The request's\nparameter is of type [TextDocumentIdentifier](#TextDocumentIdentifier) the\nresponse is of type [SymbolInformation[]](#SymbolInformation) or a Thenable\nthat resolves to such." + }, + { + "method": "textDocument/codeAction", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "Command" + }, + { + "kind": "reference", + "name": "CodeAction" + } + ] + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "CodeActionParams" + }, + "partialResult": { + "kind": "array", + "element": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "Command" + }, + { + "kind": "reference", + "name": "CodeAction" + } + ] + } + }, + "registrationOptions": { + "kind": "reference", + "name": "CodeActionRegistrationOptions" + }, + "documentation": "A request to provide commands for the given text document and range." + }, + { + "method": "codeAction/resolve", + "result": { + "kind": "reference", + "name": "CodeAction" + }, + "params": { + "kind": "reference", + "name": "CodeAction" + }, + "documentation": "Request to resolve additional information for a given code action.The request's\nparameter is of type [CodeAction](#CodeAction) the response\nis of type [CodeAction](#CodeAction) or a Thenable that resolves to such." + }, + { + "method": "workspace/symbol", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "SymbolInformation" + } + }, + { + "kind": "array", + "element": { + "kind": "reference", + "name": "WorkspaceSymbol" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "WorkspaceSymbolParams" + }, + "partialResult": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "SymbolInformation" + } + }, + { + "kind": "array", + "element": { + "kind": "reference", + "name": "WorkspaceSymbol" + } + } + ] + }, + "registrationOptions": { + "kind": "reference", + "name": "WorkspaceSymbolRegistrationOptions" + }, + "documentation": "A request to list project-wide symbols matching the query string given\nby the [WorkspaceSymbolParams](#WorkspaceSymbolParams). The response is\nof type [SymbolInformation[]](#SymbolInformation) or a Thenable that\nresolves to such.\n\n@since 3.17.0 - support for WorkspaceSymbol in the returned data. Clients\n need to advertise support for WorkspaceSymbols via the client capability\n `workspace.symbol.resolveSupport`.\n", + "since": "3.17.0 - support for WorkspaceSymbol in the returned data. Clients\nneed to advertise support for WorkspaceSymbols via the client capability\n`workspace.symbol.resolveSupport`." + }, + { + "method": "workspaceSymbol/resolve", + "result": { + "kind": "reference", + "name": "WorkspaceSymbol" + }, + "params": { + "kind": "reference", + "name": "WorkspaceSymbol" + }, + "documentation": "A request to resolve the range inside the workspace\nsymbol's location.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "method": "textDocument/codeLens", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "CodeLens" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "CodeLensParams" + }, + "partialResult": { + "kind": "array", + "element": { + "kind": "reference", + "name": "CodeLens" + } + }, + "registrationOptions": { + "kind": "reference", + "name": "CodeLensRegistrationOptions" + }, + "documentation": "A request to provide code lens for the given text document." + }, + { + "method": "codeLens/resolve", + "result": { + "kind": "reference", + "name": "CodeLens" + }, + "params": { + "kind": "reference", + "name": "CodeLens" + }, + "documentation": "A request to resolve a command for a given code lens." + }, + { + "method": "workspace/codeLens/refresh", + "result": { + "kind": "base", + "name": "null" + }, + "documentation": "A request to refresh all code actions\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "method": "textDocument/documentLink", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "DocumentLink" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "DocumentLinkParams" + }, + "partialResult": { + "kind": "array", + "element": { + "kind": "reference", + "name": "DocumentLink" + } + }, + "registrationOptions": { + "kind": "reference", + "name": "DocumentLinkRegistrationOptions" + }, + "documentation": "A request to provide document links" + }, + { + "method": "documentLink/resolve", + "result": { + "kind": "reference", + "name": "DocumentLink" + }, + "params": { + "kind": "reference", + "name": "DocumentLink" + }, + "documentation": "Request to resolve additional information for a given document link. The request's\nparameter is of type [DocumentLink](#DocumentLink) the response\nis of type [DocumentLink](#DocumentLink) or a Thenable that resolves to such." + }, + { + "method": "textDocument/formatting", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "TextEdit" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "DocumentFormattingParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "DocumentFormattingRegistrationOptions" + }, + "documentation": "A request to to format a whole document." + }, + { + "method": "textDocument/rangeFormatting", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "TextEdit" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "DocumentRangeFormattingParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "DocumentRangeFormattingRegistrationOptions" + }, + "documentation": "A request to to format a range in a document." + }, + { + "method": "textDocument/onTypeFormatting", + "result": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "TextEdit" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "DocumentOnTypeFormattingParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "DocumentOnTypeFormattingRegistrationOptions" + }, + "documentation": "A request to format a document on type." + }, + { + "method": "textDocument/rename", + "result": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "WorkspaceEdit" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "RenameParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "RenameRegistrationOptions" + }, + "documentation": "A request to rename a symbol." + }, + { + "method": "textDocument/prepareRename", + "result": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "PrepareRenameResult" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "PrepareRenameParams" + }, + "documentation": "A request to test and perform the setup necessary for a rename.\n\n@since 3.16 - support for default behavior", + "since": "3.16 - support for default behavior" + }, + { + "method": "workspace/executeCommand", + "result": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "LSPAny" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "params": { + "kind": "reference", + "name": "ExecuteCommandParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "ExecuteCommandRegistrationOptions" + }, + "documentation": "A request send from the client to the server to execute a command. The request might return\na workspace edit which the client will apply to the workspace." + }, + { + "method": "workspace/applyEdit", + "result": { + "kind": "reference", + "name": "ApplyWorkspaceEditResult" + }, + "params": { + "kind": "reference", + "name": "ApplyWorkspaceEditParams" + }, + "documentation": "A request sent from the server to the client to modified certain resources." + } + ], + "notifications": [ + { + "method": "workspace/didChangeWorkspaceFolders", + "params": { + "kind": "reference", + "name": "DidChangeWorkspaceFoldersParams" + }, + "documentation": "The `workspace/didChangeWorkspaceFolders` notification is sent from the client to the server when the workspace\nfolder configuration changes." + }, + { + "method": "window/workDoneProgress/cancel", + "params": { + "kind": "reference", + "name": "WorkDoneProgressCancelParams" + }, + "documentation": "The `window/workDoneProgress/cancel` notification is sent from the client to the server to cancel a progress\ninitiated on the server side." + }, + { + "method": "workspace/didCreateFiles", + "params": { + "kind": "reference", + "name": "CreateFilesParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "FileOperationRegistrationOptions" + }, + "documentation": "The did create files notification is sent from the client to the server when\nfiles were created from within the client.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "method": "workspace/didRenameFiles", + "params": { + "kind": "reference", + "name": "RenameFilesParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "FileOperationRegistrationOptions" + }, + "documentation": "The did rename files notification is sent from the client to the server when\nfiles were renamed from within the client.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "method": "workspace/didDeleteFiles", + "params": { + "kind": "reference", + "name": "DeleteFilesParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "FileOperationRegistrationOptions" + }, + "documentation": "The will delete files request is sent from the client to the server before files are actually\ndeleted as long as the deletion is triggered from within the client.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "method": "notebookDocument/didOpen", + "params": { + "kind": "reference", + "name": "DidOpenNotebookDocumentParams" + }, + "documentation": "A notification sent when a notebook opens.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "method": "notebookDocument/didChange", + "params": { + "kind": "reference", + "name": "DidChangeNotebookDocumentParams" + } + }, + { + "method": "notebookDocument/didSave", + "params": { + "kind": "reference", + "name": "DidSaveNotebookDocumentParams" + }, + "documentation": "A notification sent when a notebook document is saved.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "method": "notebookDocument/didClose", + "params": { + "kind": "reference", + "name": "DidCloseNotebookDocumentParams" + }, + "documentation": "A notification sent when a notebook closes.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "method": "initialized", + "params": { + "kind": "reference", + "name": "InitializedParams" + }, + "documentation": "The initialized notification is sent from the client to the\nserver after the client is fully initialized and the server\nis allowed to send requests from the server to the client." + }, + { + "method": "exit", + "documentation": "The exit event is sent from the client to the server to\nask the server to exit its process." + }, + { + "method": "workspace/didChangeConfiguration", + "params": { + "kind": "reference", + "name": "DidChangeConfigurationParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "DidChangeConfigurationRegistrationOptions" + }, + "documentation": "The configuration change notification is sent from the client to the server\nwhen the client's configuration has changed. The notification contains\nthe changed configuration as defined by the language client." + }, + { + "method": "window/showMessage", + "params": { + "kind": "reference", + "name": "ShowMessageParams" + }, + "documentation": "The show message notification is sent from a server to a client to ask\nthe client to display a particular message in the user interface." + }, + { + "method": "window/logMessage", + "params": { + "kind": "reference", + "name": "LogMessageParams" + }, + "documentation": "The log message notification is sent from the server to the client to ask\nthe client to log a particular message." + }, + { + "method": "telemetry/event", + "params": { + "kind": "reference", + "name": "LSPAny" + }, + "documentation": "The telemetry event notification is sent from the server to the client to ask\nthe client to log telemetry data." + }, + { + "method": "textDocument/didOpen", + "params": { + "kind": "reference", + "name": "DidOpenTextDocumentParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + "documentation": "The document open notification is sent from the client to the server to signal\nnewly opened text documents. The document's truth is now managed by the client\nand the server must not try to read the document's truth using the document's\nuri. Open in this sense means it is managed by the client. It doesn't necessarily\nmean that its content is presented in an editor. An open notification must not\nbe sent more than once without a corresponding close notification send before.\nThis means open and close notification must be balanced and the max open count\nis one." + }, + { + "method": "textDocument/didChange", + "params": { + "kind": "reference", + "name": "DidChangeTextDocumentParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "TextDocumentChangeRegistrationOptions" + }, + "documentation": "The document change notification is sent from the client to the server to signal\nchanges to a text document." + }, + { + "method": "textDocument/didClose", + "params": { + "kind": "reference", + "name": "DidCloseTextDocumentParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + "documentation": "The document close notification is sent from the client to the server when\nthe document got closed in the client. The document's truth now exists where\nthe document's uri points to (e.g. if the document's uri is a file uri the\ntruth now exists on disk). As with the open notification the close notification\nis about managing the document's content. Receiving a close notification\ndoesn't mean that the document was open in an editor before. A close\nnotification requires a previous open notification to be sent." + }, + { + "method": "textDocument/didSave", + "params": { + "kind": "reference", + "name": "DidSaveTextDocumentParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "TextDocumentSaveRegistrationOptions" + }, + "documentation": "The document save notification is sent from the client to the server when\nthe document got saved in the client." + }, + { + "method": "textDocument/willSave", + "params": { + "kind": "reference", + "name": "WillSaveTextDocumentParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + "documentation": "A document will save notification is sent from the client to the server before\nthe document is actually saved." + }, + { + "method": "workspace/didChangeWatchedFiles", + "params": { + "kind": "reference", + "name": "DidChangeWatchedFilesParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "DidChangeWatchedFilesRegistrationOptions" + }, + "documentation": "The watched files notification is sent from the client to the server when\nthe client detects changes to file watched by the language client." + }, + { + "method": "textDocument/publishDiagnostics", + "params": { + "kind": "reference", + "name": "PublishDiagnosticsParams" + }, + "documentation": "Diagnostics notification are sent from the server to the client to signal\nresults of validation runs." + }, + { + "method": "$/setTrace", + "params": { + "kind": "reference", + "name": "SetTraceParams" + } + }, + { + "method": "$/logTrace", + "params": { + "kind": "reference", + "name": "LogTraceParams" + } + }, + { + "method": "$/cancelRequest", + "params": { + "kind": "reference", + "name": "CancelParams" + } + }, + { + "method": "$/progress", + "params": { + "kind": "reference", + "name": "ProgressParams" + } + } + ], + "structures": [ + { + "name": "ImplementationParams", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentPositionParams" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ] + }, + { + "name": "Location", + "properties": [ + { + "name": "uri", + "type": { + "kind": "base", + "name": "DocumentUri" + } + }, + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + } + } + ], + "documentation": "Represents a location inside a resource, such as a line\ninside a text file." + }, + { + "name": "ImplementationRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "ImplementationOptions" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "StaticRegistrationOptions" + } + ] + }, + { + "name": "TypeDefinitionParams", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentPositionParams" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ] + }, + { + "name": "TypeDefinitionRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "TypeDefinitionOptions" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "StaticRegistrationOptions" + } + ] + }, + { + "name": "WorkspaceFolder", + "properties": [ + { + "name": "uri", + "type": { + "kind": "reference", + "name": "URI" + }, + "documentation": "The associated URI for this workspace folder." + }, + { + "name": "name", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The name of the workspace folder. Used to refer to this\nworkspace folder in the user interface." + } + ], + "documentation": "A workspace folder inside a client." + }, + { + "name": "DidChangeWorkspaceFoldersParams", + "properties": [ + { + "name": "event", + "type": { + "kind": "reference", + "name": "WorkspaceFoldersChangeEvent" + }, + "documentation": "The actual workspace folder change event." + } + ], + "documentation": "The parameters of a `workspace/didChangeWorkspaceFolders` notification." + }, + { + "name": "ConfigurationParams", + "properties": [ + { + "name": "items", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "ConfigurationItem" + } + } + } + ], + "documentation": "The parameters of a configuration request." + }, + { + "name": "PartialResultParams", + "properties": [ + { + "name": "partialResultToken", + "type": { + "kind": "reference", + "name": "ProgressToken" + }, + "optional": true, + "documentation": "An optional token that a server can use to report partial results (e.g. streaming) to\nthe client." + } + ] + }, + { + "name": "DocumentColorParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The text document." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "Parameters for a [DocumentColorRequest](#DocumentColorRequest)." + }, + { + "name": "ColorInformation", + "properties": [ + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range in the document where this color appears." + }, + { + "name": "color", + "type": { + "kind": "reference", + "name": "Color" + }, + "documentation": "The actual color value for this color range." + } + ], + "documentation": "Represents a color range from a document." + }, + { + "name": "DocumentColorRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "DocumentColorOptions" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "StaticRegistrationOptions" + } + ] + }, + { + "name": "ColorPresentationParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The text document." + }, + { + "name": "color", + "type": { + "kind": "reference", + "name": "Color" + }, + "documentation": "The color to request presentations for." + }, + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range where the color would be inserted. Serves as a context." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "Parameters for a [ColorPresentationRequest](#ColorPresentationRequest)." + }, + { + "name": "ColorPresentation", + "properties": [ + { + "name": "label", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The label of this color presentation. It will be shown on the color\npicker header. By default this is also the text that is inserted when selecting\nthis color presentation." + }, + { + "name": "textEdit", + "type": { + "kind": "reference", + "name": "TextEdit" + }, + "optional": true, + "documentation": "An [edit](#TextEdit) which is applied to a document when selecting\nthis presentation for the color. When `falsy` the [label](#ColorPresentation.label)\nis used." + }, + { + "name": "additionalTextEdits", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "TextEdit" + } + }, + "optional": true, + "documentation": "An optional array of additional [text edits](#TextEdit) that are applied when\nselecting this color presentation. Edits must not overlap with the main [edit](#ColorPresentation.textEdit) nor with themselves." + } + ] + }, + { + "name": "WorkDoneProgressOptions", + "properties": [ + { + "name": "workDoneProgress", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true + } + ] + }, + { + "name": "TextDocumentRegistrationOptions", + "properties": [ + { + "name": "documentSelector", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "DocumentSelector" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "documentation": "A document selector to identify the scope of the registration. If set to null\nthe document selector provided on the client side will be used." + } + ], + "documentation": "General text document registration options." + }, + { + "name": "FoldingRangeParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The text document." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "Parameters for a [FoldingRangeRequest](#FoldingRangeRequest)." + }, + { + "name": "FoldingRange", + "properties": [ + { + "name": "startLine", + "type": { + "kind": "base", + "name": "uinteger" + }, + "documentation": "The zero-based start line of the range to fold. The folded area starts after the line's last character.\nTo be valid, the end must be zero or larger and smaller than the number of lines in the document." + }, + { + "name": "startCharacter", + "type": { + "kind": "base", + "name": "uinteger" + }, + "optional": true, + "documentation": "The zero-based character offset from where the folded range starts. If not defined, defaults to the length of the start line." + }, + { + "name": "endLine", + "type": { + "kind": "base", + "name": "uinteger" + }, + "documentation": "The zero-based end line of the range to fold. The folded area ends with the line's last character.\nTo be valid, the end must be zero or larger and smaller than the number of lines in the document." + }, + { + "name": "endCharacter", + "type": { + "kind": "base", + "name": "uinteger" + }, + "optional": true, + "documentation": "The zero-based character offset before the folded range ends. If not defined, defaults to the length of the end line." + }, + { + "name": "kind", + "type": { + "kind": "reference", + "name": "FoldingRangeKind" + }, + "optional": true, + "documentation": "Describes the kind of the folding range such as `comment' or 'region'. The kind\nis used to categorize folding ranges and used by commands like 'Fold all comments'.\nSee [FoldingRangeKind](#FoldingRangeKind) for an enumeration of standardized kinds." + }, + { + "name": "collapsedText", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The text that the client should show when the specified range is\ncollapsed. If not defined or not supported by the client, a default\nwill be chosen by the client.\n\n@since 3.17.0", + "since": "3.17.0" + } + ], + "documentation": "Represents a folding range. To be valid, start and end line must be bigger than zero and smaller\nthan the number of lines in the document. Clients are free to ignore invalid ranges." + }, + { + "name": "FoldingRangeRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "FoldingRangeOptions" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "StaticRegistrationOptions" + } + ] + }, + { + "name": "DeclarationParams", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentPositionParams" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ] + }, + { + "name": "DeclarationRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "DeclarationOptions" + }, + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "StaticRegistrationOptions" + } + ] + }, + { + "name": "SelectionRangeParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The text document." + }, + { + "name": "positions", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "Position" + } + }, + "documentation": "The positions inside the text document." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "A parameter literal used in selection range requests." + }, + { + "name": "SelectionRange", + "properties": [ + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The [range](#Range) of this selection range." + }, + { + "name": "parent", + "type": { + "kind": "reference", + "name": "SelectionRange" + }, + "optional": true, + "documentation": "The parent selection range containing this range. Therefore `parent.range` must contain `this.range`." + } + ], + "documentation": "A selection range represents a part of a selection hierarchy. A selection range\nmay have a parent selection range that contains it." + }, + { + "name": "SelectionRangeRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "SelectionRangeOptions" + }, + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "StaticRegistrationOptions" + } + ] + }, + { + "name": "WorkDoneProgressCreateParams", + "properties": [ + { + "name": "token", + "type": { + "kind": "reference", + "name": "ProgressToken" + }, + "documentation": "The token to be used to report progress." + } + ] + }, + { + "name": "WorkDoneProgressCancelParams", + "properties": [ + { + "name": "token", + "type": { + "kind": "reference", + "name": "ProgressToken" + }, + "documentation": "The token to be used to report progress." + } + ] + }, + { + "name": "CallHierarchyPrepareParams", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentPositionParams" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + } + ], + "documentation": "The parameter of a `textDocument/prepareCallHierarchy` request.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "CallHierarchyItem", + "properties": [ + { + "name": "name", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The name of this item." + }, + { + "name": "kind", + "type": { + "kind": "reference", + "name": "SymbolKind" + }, + "documentation": "The kind of this item." + }, + { + "name": "tags", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "SymbolTag" + } + }, + "optional": true, + "documentation": "Tags for this item." + }, + { + "name": "detail", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "More detail for this item, e.g. the signature of a function." + }, + { + "name": "uri", + "type": { + "kind": "base", + "name": "DocumentUri" + }, + "documentation": "The resource identifier of this item." + }, + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range enclosing this symbol not including leading/trailing whitespace but everything else, e.g. comments and code." + }, + { + "name": "selectionRange", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range that should be selected and revealed when this symbol is being picked, e.g. the name of a function.\nMust be contained by the [`range`](#CallHierarchyItem.range)." + }, + { + "name": "data", + "type": { + "kind": "reference", + "name": "LSPAny" + }, + "optional": true, + "documentation": "A data entry field that is preserved between a call hierarchy prepare and\nincoming calls or outgoing calls requests." + } + ], + "documentation": "Represents programming constructs like functions or constructors in the context\nof call hierarchy.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "CallHierarchyRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "CallHierarchyOptions" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "StaticRegistrationOptions" + } + ], + "documentation": "Call hierarchy options used during static or dynamic registration.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "CallHierarchyIncomingCallsParams", + "properties": [ + { + "name": "item", + "type": { + "kind": "reference", + "name": "CallHierarchyItem" + } + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "The parameter of a `callHierarchy/incomingCalls` request.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "CallHierarchyIncomingCall", + "properties": [ + { + "name": "from", + "type": { + "kind": "reference", + "name": "CallHierarchyItem" + }, + "documentation": "The item that makes the call." + }, + { + "name": "fromRanges", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "Range" + } + }, + "documentation": "The ranges at which the calls appear. This is relative to the caller\ndenoted by [`this.from`](#CallHierarchyIncomingCall.from)." + } + ], + "documentation": "Represents an incoming call, e.g. a caller of a method or constructor.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "CallHierarchyOutgoingCallsParams", + "properties": [ + { + "name": "item", + "type": { + "kind": "reference", + "name": "CallHierarchyItem" + } + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "The parameter of a `callHierarchy/outgoingCalls` request.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "CallHierarchyOutgoingCall", + "properties": [ + { + "name": "to", + "type": { + "kind": "reference", + "name": "CallHierarchyItem" + }, + "documentation": "The item that is called." + }, + { + "name": "fromRanges", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "Range" + } + }, + "documentation": "The range at which this item is called. This is the range relative to the caller, e.g the item\npassed to [`provideCallHierarchyOutgoingCalls`](#CallHierarchyItemProvider.provideCallHierarchyOutgoingCalls)\nand not [`this.to`](#CallHierarchyOutgoingCall.to)." + } + ], + "documentation": "Represents an outgoing call, e.g. calling a getter from a method or a method from a constructor etc.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "SemanticTokensParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The text document." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "SemanticTokens", + "properties": [ + { + "name": "resultId", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "An optional result id. If provided and clients support delta updating\nthe client will include the result id in the next semantic token request.\nA server can then instead of computing all semantic tokens again simply\nsend a delta." + }, + { + "name": "data", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "uinteger" + } + }, + "documentation": "The actual tokens." + } + ], + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "SemanticTokensPartialResult", + "properties": [ + { + "name": "data", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "uinteger" + } + } + } + ], + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "SemanticTokensRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "SemanticTokensOptions" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "StaticRegistrationOptions" + } + ], + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "SemanticTokensDeltaParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The text document." + }, + { + "name": "previousResultId", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The result id of a previous response. The result Id can either point to a full response\nor a delta response depending on what was received last." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "SemanticTokensDelta", + "properties": [ + { + "name": "resultId", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true + }, + { + "name": "edits", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "SemanticTokensEdit" + } + }, + "documentation": "The semantic token edits to transform a previous result into a new result." + } + ], + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "SemanticTokensDeltaPartialResult", + "properties": [ + { + "name": "edits", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "SemanticTokensEdit" + } + } + } + ], + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "SemanticTokensRangeParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The text document." + }, + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range the semantic tokens are requested for." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "ShowDocumentParams", + "properties": [ + { + "name": "uri", + "type": { + "kind": "reference", + "name": "URI" + }, + "documentation": "The document uri to show." + }, + { + "name": "external", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Indicates to show the resource in an external program.\nTo show for example `https://code.visualstudio.com/`\nin the default WEB browser set `external` to `true`." + }, + { + "name": "takeFocus", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "An optional property to indicate whether the editor\nshowing the document should take focus or not.\nClients might ignore this property if an external\nprogram is started." + }, + { + "name": "selection", + "type": { + "kind": "reference", + "name": "Range" + }, + "optional": true, + "documentation": "An optional selection range if the document is a text\ndocument. Clients might ignore the property if an\nexternal program is started or the file is not a text\nfile." + } + ], + "documentation": "Params to show a document.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "ShowDocumentResult", + "properties": [ + { + "name": "success", + "type": { + "kind": "base", + "name": "boolean" + }, + "documentation": "A boolean indicating if the show was successful." + } + ], + "documentation": "The result of a showDocument request.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "LinkedEditingRangeParams", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentPositionParams" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + } + ] + }, + { + "name": "LinkedEditingRanges", + "properties": [ + { + "name": "ranges", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "Range" + } + }, + "documentation": "A list of ranges that can be edited together. The ranges must have\nidentical length and contain identical text content. The ranges cannot overlap." + }, + { + "name": "wordPattern", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "An optional word pattern (regular expression) that describes valid contents for\nthe given ranges. If no pattern is provided, the client configuration's word\npattern will be used." + } + ], + "documentation": "The result of a linked editing range request.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "LinkedEditingRangeRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "LinkedEditingRangeOptions" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "StaticRegistrationOptions" + } + ] + }, + { + "name": "CreateFilesParams", + "properties": [ + { + "name": "files", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "FileCreate" + } + }, + "documentation": "An array of all files/folders created in this operation." + } + ], + "documentation": "The parameters sent in notifications/requests for user-initiated creation of\nfiles.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "WorkspaceEdit", + "properties": [ + { + "name": "changes", + "type": { + "kind": "map", + "key": { + "kind": "base", + "name": "DocumentUri" + }, + "value": { + "kind": "array", + "element": { + "kind": "reference", + "name": "TextEdit" + } + } + }, + "optional": true, + "documentation": "Holds changes to existing resources." + }, + { + "name": "documentChanges", + "type": { + "kind": "array", + "element": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "TextDocumentEdit" + }, + { + "kind": "reference", + "name": "CreateFile" + }, + { + "kind": "reference", + "name": "RenameFile" + }, + { + "kind": "reference", + "name": "DeleteFile" + } + ] + } + }, + "optional": true, + "documentation": "Depending on the client capability `workspace.workspaceEdit.resourceOperations` document changes\nare either an array of `TextDocumentEdit`s to express changes to n different text documents\nwhere each text document edit addresses a specific version of a text document. Or it can contain\nabove `TextDocumentEdit`s mixed with create, rename and delete file / folder operations.\n\nWhether a client supports versioned document edits is expressed via\n`workspace.workspaceEdit.documentChanges` client capability.\n\nIf a client neither supports `documentChanges` nor `workspace.workspaceEdit.resourceOperations` then\nonly plain `TextEdit`s using the `changes` property are supported." + }, + { + "name": "changeAnnotations", + "type": { + "kind": "map", + "key": { + "kind": "reference", + "name": "ChangeAnnotationIdentifier" + }, + "value": { + "kind": "reference", + "name": "ChangeAnnotation" + } + }, + "optional": true, + "documentation": "A map of change annotations that can be referenced in `AnnotatedTextEdit`s or create, rename and\ndelete file / folder operations.\n\nWhether clients honor this property depends on the client capability `workspace.changeAnnotationSupport`.\n\n@since 3.16.0", + "since": "3.16.0" + } + ], + "documentation": "A workspace edit represents changes to many resources managed in the workspace. The edit\nshould either provide `changes` or `documentChanges`. If documentChanges are present\nthey are preferred over `changes` if the client can handle versioned document edits.\n\nSince version 3.13.0 a workspace edit can contain resource operations as well. If resource\noperations are present clients need to execute the operations in the order in which they\nare provided. So a workspace edit for example can consist of the following two changes:\n(1) a create file a.txt and (2) a text document edit which insert text into file a.txt.\n\nAn invalid sequence (e.g. (1) delete file a.txt and (2) insert text into file a.txt) will\ncause failure of the operation. How the client recovers from the failure is described by\nthe client capability: `workspace.workspaceEdit.failureHandling`" + }, + { + "name": "FileOperationRegistrationOptions", + "properties": [ + { + "name": "filters", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "FileOperationFilter" + } + }, + "documentation": "The actual filters." + } + ], + "documentation": "The options to register for file operations.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "RenameFilesParams", + "properties": [ + { + "name": "files", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "FileRename" + } + }, + "documentation": "An array of all files/folders renamed in this operation. When a folder is renamed, only\nthe folder will be included, and not its children." + } + ], + "documentation": "The parameters sent in notifications/requests for user-initiated renames of\nfiles.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "DeleteFilesParams", + "properties": [ + { + "name": "files", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "FileDelete" + } + }, + "documentation": "An array of all files/folders deleted in this operation." + } + ], + "documentation": "The parameters sent in notifications/requests for user-initiated deletes of\nfiles.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "MonikerParams", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentPositionParams" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ] + }, + { + "name": "Moniker", + "properties": [ + { + "name": "scheme", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The scheme of the moniker. For example tsc or .Net" + }, + { + "name": "identifier", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The identifier of the moniker. The value is opaque in LSIF however\nschema owners are allowed to define the structure if they want." + }, + { + "name": "unique", + "type": { + "kind": "reference", + "name": "UniquenessLevel" + }, + "documentation": "The scope in which the moniker is unique" + }, + { + "name": "kind", + "type": { + "kind": "reference", + "name": "MonikerKind" + }, + "optional": true, + "documentation": "The moniker kind if known." + } + ], + "documentation": "Moniker definition to match LSIF 0.5 moniker definition.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "MonikerRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "MonikerOptions" + } + ] + }, + { + "name": "TypeHierarchyPrepareParams", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentPositionParams" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + } + ], + "documentation": "The parameter of a `textDocument/prepareTypeHierarchy` request.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "TypeHierarchyItem", + "properties": [ + { + "name": "name", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The name of this item." + }, + { + "name": "kind", + "type": { + "kind": "reference", + "name": "SymbolKind" + }, + "documentation": "The kind of this item." + }, + { + "name": "tags", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "SymbolTag" + } + }, + "optional": true, + "documentation": "Tags for this item." + }, + { + "name": "detail", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "More detail for this item, e.g. the signature of a function." + }, + { + "name": "uri", + "type": { + "kind": "base", + "name": "DocumentUri" + }, + "documentation": "The resource identifier of this item." + }, + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range enclosing this symbol not including leading/trailing whitespace\nbut everything else, e.g. comments and code." + }, + { + "name": "selectionRange", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range that should be selected and revealed when this symbol is being\npicked, e.g. the name of a function. Must be contained by the\n[`range`](#TypeHierarchyItem.range)." + }, + { + "name": "data", + "type": { + "kind": "reference", + "name": "LSPAny" + }, + "optional": true, + "documentation": "A data entry field that is preserved between a type hierarchy prepare and\nsupertypes or subtypes requests. It could also be used to identify the\ntype hierarchy in the server, helping improve the performance on\nresolving supertypes and subtypes." + } + ], + "documentation": "@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "TypeHierarchyRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "TypeHierarchyOptions" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "StaticRegistrationOptions" + } + ], + "documentation": "Type hierarchy options used during static or dynamic registration.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "TypeHierarchySupertypesParams", + "properties": [ + { + "name": "item", + "type": { + "kind": "reference", + "name": "TypeHierarchyItem" + } + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "The parameter of a `typeHierarchy/supertypes` request.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "TypeHierarchySubtypesParams", + "properties": [ + { + "name": "item", + "type": { + "kind": "reference", + "name": "TypeHierarchyItem" + } + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "The parameter of a `typeHierarchy/subtypes` request.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "InlineValueParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The text document." + }, + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The document range for which inline values should be computed." + }, + { + "name": "context", + "type": { + "kind": "reference", + "name": "InlineValueContext" + }, + "documentation": "Additional information about the context in which inline values were\nrequested." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + } + ], + "documentation": "A parameter literal used in inline value requests.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "InlineValueRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "InlineValueOptions" + }, + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "StaticRegistrationOptions" + } + ], + "documentation": "Inline value options used during static or dynamic registration.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "InlayHintParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The text document." + }, + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The document range for which inlay hints should be computed." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + } + ], + "documentation": "A parameter literal used in inlay hint requests.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "InlayHint", + "properties": [ + { + "name": "position", + "type": { + "kind": "reference", + "name": "Position" + }, + "documentation": "The position of this hint." + }, + { + "name": "label", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "string" + }, + { + "kind": "array", + "element": { + "kind": "reference", + "name": "InlayHintLabelPart" + } + } + ] + }, + "documentation": "The label of this hint. A human readable string or an array of\nInlayHintLabelPart label parts.\n\n*Note* that neither the string nor the label part can be empty." + }, + { + "name": "kind", + "type": { + "kind": "reference", + "name": "InlayHintKind" + }, + "optional": true, + "documentation": "The kind of this hint. Can be omitted in which case the client\nshould fall back to a reasonable default." + }, + { + "name": "textEdits", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "TextEdit" + } + }, + "optional": true, + "documentation": "Optional text edits that are performed when accepting this inlay hint.\n\n*Note* that edits are expected to change the document so that the inlay\nhint (or its nearest variant) is now part of the document and the inlay\nhint itself is now obsolete." + }, + { + "name": "tooltip", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "string" + }, + { + "kind": "reference", + "name": "MarkupContent" + } + ] + }, + "optional": true, + "documentation": "The tooltip text when you hover over this item." + }, + { + "name": "paddingLeft", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Render padding before the hint.\n\nNote: Padding should use the editor's background color, not the\nbackground color of the hint itself. That means padding can be used\nto visually align/separate an inlay hint." + }, + { + "name": "paddingRight", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Render padding after the hint.\n\nNote: Padding should use the editor's background color, not the\nbackground color of the hint itself. That means padding can be used\nto visually align/separate an inlay hint." + }, + { + "name": "data", + "type": { + "kind": "reference", + "name": "LSPAny" + }, + "optional": true, + "documentation": "A data entry field that is preserved on an inlay hint between\na `textDocument/inlayHint` and a `inlayHint/resolve` request." + } + ], + "documentation": "Inlay hint information.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "InlayHintRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "InlayHintOptions" + }, + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "StaticRegistrationOptions" + } + ], + "documentation": "Inlay hint options used during static or dynamic registration.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "DocumentDiagnosticParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The text document." + }, + { + "name": "identifier", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The additional identifier provided during registration." + }, + { + "name": "previousResultId", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The result id of a previous response if provided." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "Parameters of the document diagnostic request.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "DocumentDiagnosticReportPartialResult", + "properties": [ + { + "name": "relatedDocuments", + "type": { + "kind": "map", + "key": { + "kind": "base", + "name": "DocumentUri" + }, + "value": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "FullDocumentDiagnosticReport" + }, + { + "kind": "reference", + "name": "UnchangedDocumentDiagnosticReport" + } + ] + } + } + } + ], + "documentation": "A partial result for a document diagnostic report.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "DiagnosticServerCancellationData", + "properties": [ + { + "name": "retriggerRequest", + "type": { + "kind": "base", + "name": "boolean" + } + } + ], + "documentation": "Cancellation data returned from a diagnostic request.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "DiagnosticRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "DiagnosticOptions" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "StaticRegistrationOptions" + } + ], + "documentation": "Diagnostic registration options.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "WorkspaceDiagnosticParams", + "properties": [ + { + "name": "identifier", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The additional identifier provided during registration." + }, + { + "name": "previousResultIds", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "PreviousResultId" + } + }, + "documentation": "The currently known diagnostic reports with their\nprevious result ids." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "Parameters of the workspace diagnostic request.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "WorkspaceDiagnosticReport", + "properties": [ + { + "name": "items", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "WorkspaceDocumentDiagnosticReport" + } + } + } + ], + "documentation": "A workspace diagnostic report.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "WorkspaceDiagnosticReportPartialResult", + "properties": [ + { + "name": "items", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "WorkspaceDocumentDiagnosticReport" + } + } + } + ], + "documentation": "A partial result for a workspace diagnostic report.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "DidOpenNotebookDocumentParams", + "properties": [ + { + "name": "notebookDocument", + "type": { + "kind": "reference", + "name": "NotebookDocument" + }, + "documentation": "The notebook document that got opened." + }, + { + "name": "cellTextDocuments", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "TextDocumentItem" + } + }, + "documentation": "The text documents that represent the content\nof a notebook cell." + } + ], + "documentation": "The params sent in an open notebook document notification.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "DidChangeNotebookDocumentParams", + "properties": [ + { + "name": "notebookDocument", + "type": { + "kind": "reference", + "name": "VersionedNotebookDocumentIdentifier" + }, + "documentation": "The notebook document that did change. The version number points\nto the version after all provided changes have been applied. If\nonly the text document content of a cell changes the notebook version\ndoesn't necessarily have to change." + }, + { + "name": "change", + "type": { + "kind": "reference", + "name": "NotebookDocumentChangeEvent" + }, + "documentation": "The actual changes to the notebook document.\n\nThe changes describe single state changes to the notebook document.\nSo if there are two changes c1 (at array index 0) and c2 (at array\nindex 1) for a notebook in state S then c1 moves the notebook from\nS to S' and c2 from S' to S''. So c1 is computed on the state S and\nc2 is computed on the state S'.\n\nTo mirror the content of a notebook using change events use the following approach:\n- start with the same initial content\n- apply the 'notebookDocument/didChange' notifications in the order you receive them.\n- apply the `NotebookChangeEvent`s in a single notification in the order\n you receive them." + } + ], + "documentation": "The params sent in a change notebook document notification.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "DidSaveNotebookDocumentParams", + "properties": [ + { + "name": "notebookDocument", + "type": { + "kind": "reference", + "name": "NotebookDocumentIdentifier" + }, + "documentation": "The notebook document that got saved." + } + ], + "documentation": "The params sent in a save notebook document notification.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "DidCloseNotebookDocumentParams", + "properties": [ + { + "name": "notebookDocument", + "type": { + "kind": "reference", + "name": "NotebookDocumentIdentifier" + }, + "documentation": "The notebook document that got closed." + }, + { + "name": "cellTextDocuments", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "TextDocumentIdentifier" + } + }, + "documentation": "The text documents that represent the content\nof a notebook cell that got closed." + } + ], + "documentation": "The params sent in a close notebook document notification.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "RegistrationParams", + "properties": [ + { + "name": "registrations", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "Registration" + } + } + } + ] + }, + { + "name": "UnregistrationParams", + "properties": [ + { + "name": "unregisterations", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "Unregistration" + } + } + } + ] + }, + { + "name": "InitializeParams", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "_InitializeParams" + }, + { + "kind": "reference", + "name": "WorkspaceFoldersInitializeParams" + } + ] + }, + { + "name": "InitializeResult", + "properties": [ + { + "name": "capabilities", + "type": { + "kind": "reference", + "name": "ServerCapabilities" + }, + "documentation": "The capabilities the language server provides." + }, + { + "name": "serverInfo", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "name", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The name of the server as defined by the server." + }, + { + "name": "version", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The server's version as defined by the server." + } + ] + } + }, + "optional": true, + "documentation": "Information about the server.\n\n@since 3.15.0", + "since": "3.15.0" + } + ], + "documentation": "The result returned from an initialize request." + }, + { + "name": "InitializeError", + "properties": [ + { + "name": "retry", + "type": { + "kind": "base", + "name": "boolean" + }, + "documentation": "Indicates whether the client execute the following retry logic:\n(1) show the message provided by the ResponseError to the user\n(2) user selects retry or cancel\n(3) if user selected retry the initialize method is sent again." + } + ], + "documentation": "The data type of the ResponseError if the\ninitialize request fails." + }, + { + "name": "InitializedParams", + "properties": [] + }, + { + "name": "DidChangeConfigurationParams", + "properties": [ + { + "name": "settings", + "type": { + "kind": "reference", + "name": "LSPAny" + }, + "documentation": "The actual changed settings" + } + ], + "documentation": "The parameters of a change configuration notification." + }, + { + "name": "DidChangeConfigurationRegistrationOptions", + "properties": [ + { + "name": "section", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "string" + }, + { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + } + ] + }, + "optional": true + } + ] + }, + { + "name": "ShowMessageParams", + "properties": [ + { + "name": "type", + "type": { + "kind": "reference", + "name": "MessageType" + }, + "documentation": "The message type. See {@link MessageType}" + }, + { + "name": "message", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The actual message." + } + ], + "documentation": "The parameters of a notification message." + }, + { + "name": "ShowMessageRequestParams", + "properties": [ + { + "name": "type", + "type": { + "kind": "reference", + "name": "MessageType" + }, + "documentation": "The message type. See {@link MessageType}" + }, + { + "name": "message", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The actual message." + }, + { + "name": "actions", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "MessageActionItem" + } + }, + "optional": true, + "documentation": "The message action items to present." + } + ] + }, + { + "name": "MessageActionItem", + "properties": [ + { + "name": "title", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A short title like 'Retry', 'Open Log' etc." + } + ] + }, + { + "name": "LogMessageParams", + "properties": [ + { + "name": "type", + "type": { + "kind": "reference", + "name": "MessageType" + }, + "documentation": "The message type. See {@link MessageType}" + }, + { + "name": "message", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The actual message." + } + ], + "documentation": "The log message parameters." + }, + { + "name": "DidOpenTextDocumentParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentItem" + }, + "documentation": "The document that was opened." + } + ], + "documentation": "The parameters sent in an open text document notification" + }, + { + "name": "DidChangeTextDocumentParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "VersionedTextDocumentIdentifier" + }, + "documentation": "The document that did change. The version number points\nto the version after all provided content changes have\nbeen applied." + }, + { + "name": "contentChanges", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "TextDocumentContentChangeEvent" + } + }, + "documentation": "The actual content changes. The content changes describe single state changes\nto the document. So if there are two content changes c1 (at array index 0) and\nc2 (at array index 1) for a document in state S then c1 moves the document from\nS to S' and c2 from S' to S''. So c1 is computed on the state S and c2 is computed\non the state S'.\n\nTo mirror the content of a document using change events use the following approach:\n- start with the same initial content\n- apply the 'textDocument/didChange' notifications in the order you receive them.\n- apply the `TextDocumentContentChangeEvent`s in a single notification in the order\n you receive them." + } + ], + "documentation": "The change text document notification's parameters." + }, + { + "name": "TextDocumentChangeRegistrationOptions", + "properties": [ + { + "name": "syncKind", + "type": { + "kind": "reference", + "name": "TextDocumentSyncKind" + }, + "documentation": "How documents are synced to the server." + } + ], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + } + ], + "documentation": "Describe options to be used when registered for text document change events." + }, + { + "name": "DidCloseTextDocumentParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The document that was closed." + } + ], + "documentation": "The parameters sent in a close text document notification" + }, + { + "name": "DidSaveTextDocumentParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The document that was saved." + }, + { + "name": "text", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "Optional the content when saved. Depends on the includeText value\nwhen the save notification was requested." + } + ], + "documentation": "The parameters sent in a save text document notification" + }, + { + "name": "TextDocumentSaveRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "SaveOptions" + } + ], + "documentation": "Save registration options." + }, + { + "name": "WillSaveTextDocumentParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The document that will be saved." + }, + { + "name": "reason", + "type": { + "kind": "reference", + "name": "TextDocumentSaveReason" + }, + "documentation": "The 'TextDocumentSaveReason'." + } + ], + "documentation": "The parameters sent in a will save text document notification." + }, + { + "name": "TextEdit", + "properties": [ + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range of the text document to be manipulated. To insert\ntext into a document create a range where start === end." + }, + { + "name": "newText", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The string to be inserted. For delete operations use an\nempty string." + } + ], + "documentation": "A text edit applicable to a text document." + }, + { + "name": "DidChangeWatchedFilesParams", + "properties": [ + { + "name": "changes", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "FileEvent" + } + }, + "documentation": "The actual file events." + } + ], + "documentation": "The watched files change notification's parameters." + }, + { + "name": "DidChangeWatchedFilesRegistrationOptions", + "properties": [ + { + "name": "watchers", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "FileSystemWatcher" + } + }, + "documentation": "The watchers to register." + } + ], + "documentation": "Describe options to be used when registered for text document change events." + }, + { + "name": "PublishDiagnosticsParams", + "properties": [ + { + "name": "uri", + "type": { + "kind": "base", + "name": "DocumentUri" + }, + "documentation": "The URI for which diagnostic information is reported." + }, + { + "name": "version", + "type": { + "kind": "base", + "name": "integer" + }, + "optional": true, + "documentation": "Optional the version number of the document the diagnostics are published for.\n\n@since 3.15.0", + "since": "3.15.0" + }, + { + "name": "diagnostics", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "Diagnostic" + } + }, + "documentation": "An array of diagnostic information items." + } + ], + "documentation": "The publish diagnostic notification's parameters." + }, + { + "name": "CompletionParams", + "properties": [ + { + "name": "context", + "type": { + "kind": "reference", + "name": "CompletionContext" + }, + "optional": true, + "documentation": "The completion context. This is only available it the client specifies\nto send this using the client capability `textDocument.completion.contextSupport === true`" + } + ], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentPositionParams" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "Completion parameters" + }, + { + "name": "CompletionItem", + "properties": [ + { + "name": "label", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The label of this completion item.\n\nThe label property is also by default the text that\nis inserted when selecting this completion.\n\nIf label details are provided the label itself should\nbe an unqualified name of the completion item." + }, + { + "name": "labelDetails", + "type": { + "kind": "reference", + "name": "CompletionItemLabelDetails" + }, + "optional": true, + "documentation": "Additional details for the label\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "kind", + "type": { + "kind": "reference", + "name": "CompletionItemKind" + }, + "optional": true, + "documentation": "The kind of this completion item. Based of the kind\nan icon is chosen by the editor." + }, + { + "name": "tags", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "CompletionItemTag" + } + }, + "optional": true, + "documentation": "Tags for this completion item.\n\n@since 3.15.0", + "since": "3.15.0" + }, + { + "name": "detail", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A human-readable string with additional information\nabout this item, like type or symbol information." + }, + { + "name": "documentation", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "string" + }, + { + "kind": "reference", + "name": "MarkupContent" + } + ] + }, + "optional": true, + "documentation": "A human-readable string that represents a doc-comment." + }, + { + "name": "deprecated", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Indicates if this item is deprecated.\n@deprecated Use `tags` instead." + }, + { + "name": "preselect", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Select this item when showing.\n\n*Note* that only one completion item can be selected and that the\ntool / client decides which item that is. The rule is that the *first*\nitem of those that match best is selected." + }, + { + "name": "sortText", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A string that should be used when comparing this item\nwith other items. When `falsy` the [label](#CompletionItem.label)\nis used." + }, + { + "name": "filterText", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A string that should be used when filtering a set of\ncompletion items. When `falsy` the [label](#CompletionItem.label)\nis used." + }, + { + "name": "insertText", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A string that should be inserted into a document when selecting\nthis completion. When `falsy` the [label](#CompletionItem.label)\nis used.\n\nThe `insertText` is subject to interpretation by the client side.\nSome tools might not take the string literally. For example\nVS Code when code complete is requested in this example\n`con` and a completion item with an `insertText` of\n`console` is provided it will only insert `sole`. Therefore it is\nrecommended to use `textEdit` instead since it avoids additional client\nside interpretation." + }, + { + "name": "insertTextFormat", + "type": { + "kind": "reference", + "name": "InsertTextFormat" + }, + "optional": true, + "documentation": "The format of the insert text. The format applies to both the\n`insertText` property and the `newText` property of a provided\n`textEdit`. If omitted defaults to `InsertTextFormat.PlainText`.\n\nPlease note that the insertTextFormat doesn't apply to\n`additionalTextEdits`." + }, + { + "name": "insertTextMode", + "type": { + "kind": "reference", + "name": "InsertTextMode" + }, + "optional": true, + "documentation": "How whitespace and indentation is handled during completion\nitem insertion. If not provided the clients default value depends on\nthe `textDocument.completion.insertTextMode` client capability.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "textEdit", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "TextEdit" + }, + { + "kind": "reference", + "name": "InsertReplaceEdit" + } + ] + }, + "optional": true, + "documentation": "An [edit](#TextEdit) which is applied to a document when selecting\nthis completion. When an edit is provided the value of\n[insertText](#CompletionItem.insertText) is ignored.\n\nMost editors support two different operations when accepting a completion\nitem. One is to insert a completion text and the other is to replace an\nexisting text with a completion text. Since this can usually not be\npredetermined by a server it can report both ranges. Clients need to\nsignal support for `InsertReplaceEdits` via the\n`textDocument.completion.insertReplaceSupport` client capability\nproperty.\n\n*Note 1:* The text edit's range as well as both ranges from an insert\nreplace edit must be a [single line] and they must contain the position\nat which completion has been requested.\n*Note 2:* If an `InsertReplaceEdit` is returned the edit's insert range\nmust be a prefix of the edit's replace range, that means it must be\ncontained and starting at the same position.\n\n@since 3.16.0 additional type `InsertReplaceEdit`", + "since": "3.16.0 additional type `InsertReplaceEdit`" + }, + { + "name": "textEditText", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The edit text used if the completion item is part of a CompletionList and\nCompletionList defines an item default for the text edit range.\n\nClients will only honor this property if they opt into completion list\nitem defaults using the capability `completionList.itemDefaults`.\n\nIf not provided and a list's default range is provided the label\nproperty is used as a text.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "additionalTextEdits", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "TextEdit" + } + }, + "optional": true, + "documentation": "An optional array of additional [text edits](#TextEdit) that are applied when\nselecting this completion. Edits must not overlap (including the same insert position)\nwith the main [edit](#CompletionItem.textEdit) nor with themselves.\n\nAdditional text edits should be used to change text unrelated to the current cursor position\n(for example adding an import statement at the top of the file if the completion item will\ninsert an unqualified type)." + }, + { + "name": "commitCharacters", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "optional": true, + "documentation": "An optional set of characters that when pressed while this completion is active will accept it first and\nthen type that character. *Note* that all commit characters should have `length=1` and that superfluous\ncharacters will be ignored." + }, + { + "name": "command", + "type": { + "kind": "reference", + "name": "Command" + }, + "optional": true, + "documentation": "An optional [command](#Command) that is executed *after* inserting this completion. *Note* that\nadditional modifications to the current document should be described with the\n[additionalTextEdits](#CompletionItem.additionalTextEdits)-property." + }, + { + "name": "data", + "type": { + "kind": "reference", + "name": "LSPAny" + }, + "optional": true, + "documentation": "A data entry field that is preserved on a completion item between a\n[CompletionRequest](#CompletionRequest) and a [CompletionResolveRequest](#CompletionResolveRequest)." + } + ], + "documentation": "A completion item represents a text snippet that is\nproposed to complete text that is being typed." + }, + { + "name": "CompletionList", + "properties": [ + { + "name": "isIncomplete", + "type": { + "kind": "base", + "name": "boolean" + }, + "documentation": "This list it not complete. Further typing results in recomputing this list.\n\nRecomputed lists have all their items replaced (not appended) in the\nincomplete completion sessions." + }, + { + "name": "itemDefaults", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "commitCharacters", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "optional": true, + "documentation": "A default commit character set.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "editRange", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "Range" + }, + { + "kind": "literal", + "value": { + "properties": [ + { + "name": "insert", + "type": { + "kind": "reference", + "name": "Range" + } + }, + { + "name": "replace", + "type": { + "kind": "reference", + "name": "Range" + } + } + ] + } + } + ] + }, + "optional": true, + "documentation": "A default edit range.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "insertTextFormat", + "type": { + "kind": "reference", + "name": "InsertTextFormat" + }, + "optional": true, + "documentation": "A default insert text format.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "insertTextMode", + "type": { + "kind": "reference", + "name": "InsertTextMode" + }, + "optional": true, + "documentation": "A default insert text mode.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "data", + "type": { + "kind": "reference", + "name": "LSPAny" + }, + "optional": true, + "documentation": "A default data value.\n\n@since 3.17.0", + "since": "3.17.0" + } + ] + } + }, + "optional": true, + "documentation": "In many cases the items of an actual completion result share the same\nvalue for properties like `commitCharacters` or the range of a text\nedit. A completion list can therefore define item defaults which will\nbe used if a completion item itself doesn't specify the value.\n\nIf a completion list specifies a default value and a completion item\nalso specifies a corresponding value the one from the item is used.\n\nServers are only allowed to return default values if the client\nsignals support for this via the `completionList.itemDefaults`\ncapability.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "items", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "CompletionItem" + } + }, + "documentation": "The completion items." + } + ], + "documentation": "Represents a collection of [completion items](#CompletionItem) to be presented\nin the editor." + }, + { + "name": "CompletionRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "CompletionOptions" + } + ], + "documentation": "Registration options for a [CompletionRequest](#CompletionRequest)." + }, + { + "name": "HoverParams", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentPositionParams" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + } + ], + "documentation": "Parameters for a [HoverRequest](#HoverRequest)." + }, + { + "name": "Hover", + "properties": [ + { + "name": "contents", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "MarkupContent" + }, + { + "kind": "reference", + "name": "MarkedString" + }, + { + "kind": "array", + "element": { + "kind": "reference", + "name": "MarkedString" + } + } + ] + }, + "documentation": "The hover's content" + }, + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "optional": true, + "documentation": "An optional range inside the text document that is used to\nvisualize the hover, e.g. by changing the background color." + } + ], + "documentation": "The result of a hover request." + }, + { + "name": "HoverRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "HoverOptions" + } + ], + "documentation": "Registration options for a [HoverRequest](#HoverRequest)." + }, + { + "name": "SignatureHelpParams", + "properties": [ + { + "name": "context", + "type": { + "kind": "reference", + "name": "SignatureHelpContext" + }, + "optional": true, + "documentation": "The signature help context. This is only available if the client specifies\nto send this using the client capability `textDocument.signatureHelp.contextSupport === true`\n\n@since 3.15.0", + "since": "3.15.0" + } + ], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentPositionParams" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + } + ], + "documentation": "Parameters for a [SignatureHelpRequest](#SignatureHelpRequest)." + }, + { + "name": "SignatureHelp", + "properties": [ + { + "name": "signatures", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "SignatureInformation" + } + }, + "documentation": "One or more signatures." + }, + { + "name": "activeSignature", + "type": { + "kind": "base", + "name": "uinteger" + }, + "optional": true, + "documentation": "The active signature. If omitted or the value lies outside the\nrange of `signatures` the value defaults to zero or is ignored if\nthe `SignatureHelp` has no signatures.\n\nWhenever possible implementors should make an active decision about\nthe active signature and shouldn't rely on a default value.\n\nIn future version of the protocol this property might become\nmandatory to better express this." + }, + { + "name": "activeParameter", + "type": { + "kind": "base", + "name": "uinteger" + }, + "optional": true, + "documentation": "The active parameter of the active signature. If omitted or the value\nlies outside the range of `signatures[activeSignature].parameters`\ndefaults to 0 if the active signature has parameters. If\nthe active signature has no parameters it is ignored.\nIn future version of the protocol this property might become\nmandatory to better express the active parameter if the\nactive signature does have any." + } + ], + "documentation": "Signature help represents the signature of something\ncallable. There can be multiple signature but only one\nactive and only one active parameter." + }, + { + "name": "SignatureHelpRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "SignatureHelpOptions" + } + ], + "documentation": "Registration options for a [SignatureHelpRequest](#SignatureHelpRequest)." + }, + { + "name": "DefinitionParams", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentPositionParams" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "Parameters for a [DefinitionRequest](#DefinitionRequest)." + }, + { + "name": "DefinitionRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "DefinitionOptions" + } + ], + "documentation": "Registration options for a [DefinitionRequest](#DefinitionRequest)." + }, + { + "name": "ReferenceParams", + "properties": [ + { + "name": "context", + "type": { + "kind": "reference", + "name": "ReferenceContext" + } + } + ], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentPositionParams" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "Parameters for a [ReferencesRequest](#ReferencesRequest)." + }, + { + "name": "ReferenceRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "ReferenceOptions" + } + ], + "documentation": "Registration options for a [ReferencesRequest](#ReferencesRequest)." + }, + { + "name": "DocumentHighlightParams", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentPositionParams" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "Parameters for a [DocumentHighlightRequest](#DocumentHighlightRequest)." + }, + { + "name": "DocumentHighlight", + "properties": [ + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range this highlight applies to." + }, + { + "name": "kind", + "type": { + "kind": "reference", + "name": "DocumentHighlightKind" + }, + "optional": true, + "documentation": "The highlight kind, default is [text](#DocumentHighlightKind.Text)." + } + ], + "documentation": "A document highlight is a range inside a text document which deserves\nspecial attention. Usually a document highlight is visualized by changing\nthe background color of its range." + }, + { + "name": "DocumentHighlightRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "DocumentHighlightOptions" + } + ], + "documentation": "Registration options for a [DocumentHighlightRequest](#DocumentHighlightRequest)." + }, + { + "name": "DocumentSymbolParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The text document." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "Parameters for a [DocumentSymbolRequest](#DocumentSymbolRequest)." + }, + { + "name": "SymbolInformation", + "properties": [ + { + "name": "deprecated", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Indicates if this symbol is deprecated.\n\n@deprecated Use tags instead" + }, + { + "name": "location", + "type": { + "kind": "reference", + "name": "Location" + }, + "documentation": "The location of this symbol. The location's range is used by a tool\nto reveal the location in the editor. If the symbol is selected in the\ntool the range's start information is used to position the cursor. So\nthe range usually spans more than the actual symbol's name and does\nnormally include things like visibility modifiers.\n\nThe range doesn't have to denote a node range in the sense of an abstract\nsyntax tree. It can therefore not be used to re-construct a hierarchy of\nthe symbols." + } + ], + "extends": [ + { + "kind": "reference", + "name": "BaseSymbolInformation" + } + ], + "documentation": "Represents information about programming constructs like variables, classes,\ninterfaces etc." + }, + { + "name": "DocumentSymbol", + "properties": [ + { + "name": "name", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The name of this symbol. Will be displayed in the user interface and therefore must not be\nan empty string or a string only consisting of white spaces." + }, + { + "name": "detail", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "More detail for this symbol, e.g the signature of a function." + }, + { + "name": "kind", + "type": { + "kind": "reference", + "name": "SymbolKind" + }, + "documentation": "The kind of this symbol." + }, + { + "name": "tags", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "SymbolTag" + } + }, + "optional": true, + "documentation": "Tags for this document symbol.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "deprecated", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Indicates if this symbol is deprecated.\n\n@deprecated Use tags instead" + }, + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range enclosing this symbol not including leading/trailing whitespace but everything else\nlike comments. This information is typically used to determine if the clients cursor is\ninside the symbol to reveal in the symbol in the UI." + }, + { + "name": "selectionRange", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range that should be selected and revealed when this symbol is being picked, e.g the name of a function.\nMust be contained by the `range`." + }, + { + "name": "children", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "DocumentSymbol" + } + }, + "optional": true, + "documentation": "Children of this symbol, e.g. properties of a class." + } + ], + "documentation": "Represents programming constructs like variables, classes, interfaces etc.\nthat appear in a document. Document symbols can be hierarchical and they\nhave two ranges: one that encloses its definition and one that points to\nits most interesting range, e.g. the range of an identifier." + }, + { + "name": "DocumentSymbolRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "DocumentSymbolOptions" + } + ], + "documentation": "Registration options for a [DocumentSymbolRequest](#DocumentSymbolRequest)." + }, + { + "name": "CodeActionParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The document in which the command was invoked." + }, + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range for which the command was invoked." + }, + { + "name": "context", + "type": { + "kind": "reference", + "name": "CodeActionContext" + }, + "documentation": "Context carrying additional information." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "The parameters of a [CodeActionRequest](#CodeActionRequest)." + }, + { + "name": "Command", + "properties": [ + { + "name": "title", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "Title of the command, like `save`." + }, + { + "name": "command", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The identifier of the actual command handler." + }, + { + "name": "arguments", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "LSPAny" + } + }, + "optional": true, + "documentation": "Arguments that the command handler should be\ninvoked with." + } + ], + "documentation": "Represents a reference to a command. Provides a title which\nwill be used to represent a command in the UI and, optionally,\nan array of arguments which will be passed to the command handler\nfunction when invoked." + }, + { + "name": "CodeAction", + "properties": [ + { + "name": "title", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A short, human-readable, title for this code action." + }, + { + "name": "kind", + "type": { + "kind": "reference", + "name": "CodeActionKind" + }, + "optional": true, + "documentation": "The kind of the code action.\n\nUsed to filter code actions." + }, + { + "name": "diagnostics", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "Diagnostic" + } + }, + "optional": true, + "documentation": "The diagnostics that this code action resolves." + }, + { + "name": "isPreferred", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Marks this as a preferred action. Preferred actions are used by the `auto fix` command and can be targeted\nby keybindings.\n\nA quick fix should be marked preferred if it properly addresses the underlying error.\nA refactoring should be marked preferred if it is the most reasonable choice of actions to take.\n\n@since 3.15.0", + "since": "3.15.0" + }, + { + "name": "disabled", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "reason", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "Human readable description of why the code action is currently disabled.\n\nThis is displayed in the code actions UI." + } + ] + } + }, + "optional": true, + "documentation": "Marks that the code action cannot currently be applied.\n\nClients should follow the following guidelines regarding disabled code actions:\n\n - Disabled code actions are not shown in automatic [lightbulbs](https://code.visualstudio.com/docs/editor/editingevolved#_code-action)\n code action menus.\n\n - Disabled actions are shown as faded out in the code action menu when the user requests a more specific type\n of code action, such as refactorings.\n\n - If the user has a [keybinding](https://code.visualstudio.com/docs/editor/refactoring#_keybindings-for-code-actions)\n that auto applies a code action and only disabled code actions are returned, the client should show the user an\n error message with `reason` in the editor.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "edit", + "type": { + "kind": "reference", + "name": "WorkspaceEdit" + }, + "optional": true, + "documentation": "The workspace edit this code action performs." + }, + { + "name": "command", + "type": { + "kind": "reference", + "name": "Command" + }, + "optional": true, + "documentation": "A command this code action executes. If a code action\nprovides an edit and a command, first the edit is\nexecuted and then the command." + }, + { + "name": "data", + "type": { + "kind": "reference", + "name": "LSPAny" + }, + "optional": true, + "documentation": "A data entry field that is preserved on a code action between\na `textDocument/codeAction` and a `codeAction/resolve` request.\n\n@since 3.16.0", + "since": "3.16.0" + } + ], + "documentation": "A code action represents a change that can be performed in code, e.g. to fix a problem or\nto refactor code.\n\nA CodeAction must set either `edit` and/or a `command`. If both are supplied, the `edit` is applied first, then the `command` is executed." + }, + { + "name": "CodeActionRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "CodeActionOptions" + } + ], + "documentation": "Registration options for a [CodeActionRequest](#CodeActionRequest)." + }, + { + "name": "WorkspaceSymbolParams", + "properties": [ + { + "name": "query", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A query string to filter symbols by. Clients may send an empty\nstring here to request all symbols." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "The parameters of a [WorkspaceSymbolRequest](#WorkspaceSymbolRequest)." + }, + { + "name": "WorkspaceSymbol", + "properties": [ + { + "name": "location", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "Location" + }, + { + "kind": "literal", + "value": { + "properties": [ + { + "name": "uri", + "type": { + "kind": "base", + "name": "DocumentUri" + } + } + ] + } + } + ] + }, + "documentation": "The location of the symbol. Whether a server is allowed to\nreturn a location without a range depends on the client\ncapability `workspace.symbol.resolveSupport`.\n\nSee SymbolInformation#location for more details." + }, + { + "name": "data", + "type": { + "kind": "reference", + "name": "LSPAny" + }, + "optional": true, + "documentation": "A data entry field that is preserved on a workspace symbol between a\nworkspace symbol request and a workspace symbol resolve request." + } + ], + "extends": [ + { + "kind": "reference", + "name": "BaseSymbolInformation" + } + ], + "documentation": "A special workspace symbol that supports locations without a range.\n\nSee also SymbolInformation.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "WorkspaceSymbolRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "WorkspaceSymbolOptions" + } + ], + "documentation": "Registration options for a [WorkspaceSymbolRequest](#WorkspaceSymbolRequest)." + }, + { + "name": "CodeLensParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The document to request code lens for." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "The parameters of a [CodeLensRequest](#CodeLensRequest)." + }, + { + "name": "CodeLens", + "properties": [ + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range in which this code lens is valid. Should only span a single line." + }, + { + "name": "command", + "type": { + "kind": "reference", + "name": "Command" + }, + "optional": true, + "documentation": "The command this code lens represents." + }, + { + "name": "data", + "type": { + "kind": "reference", + "name": "LSPAny" + }, + "optional": true, + "documentation": "A data entry field that is preserved on a code lens item between\na [CodeLensRequest](#CodeLensRequest) and a [CodeLensResolveRequest]\n(#CodeLensResolveRequest)" + } + ], + "documentation": "A code lens represents a [command](#Command) that should be shown along with\nsource text, like the number of references, a way to run tests, etc.\n\nA code lens is _unresolved_ when no command is associated to it. For performance\nreasons the creation of a code lens and resolving should be done in two stages." + }, + { + "name": "CodeLensRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "CodeLensOptions" + } + ], + "documentation": "Registration options for a [CodeLensRequest](#CodeLensRequest)." + }, + { + "name": "DocumentLinkParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The document to provide document links for." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + }, + { + "kind": "reference", + "name": "PartialResultParams" + } + ], + "documentation": "The parameters of a [DocumentLinkRequest](#DocumentLinkRequest)." + }, + { + "name": "DocumentLink", + "properties": [ + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range this link applies to." + }, + { + "name": "target", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The uri this link points to. If missing a resolve request is sent later." + }, + { + "name": "tooltip", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The tooltip text when you hover over this link.\n\nIf a tooltip is provided, is will be displayed in a string that includes instructions on how to\ntrigger the link, such as `{0} (ctrl + click)`. The specific instructions vary depending on OS,\nuser settings, and localization.\n\n@since 3.15.0", + "since": "3.15.0" + }, + { + "name": "data", + "type": { + "kind": "reference", + "name": "LSPAny" + }, + "optional": true, + "documentation": "A data entry field that is preserved on a document link between a\nDocumentLinkRequest and a DocumentLinkResolveRequest." + } + ], + "documentation": "A document link is a range in a text document that links to an internal or external resource, like another\ntext document or a web site." + }, + { + "name": "DocumentLinkRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "DocumentLinkOptions" + } + ], + "documentation": "Registration options for a [DocumentLinkRequest](#DocumentLinkRequest)." + }, + { + "name": "DocumentFormattingParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The document to format." + }, + { + "name": "options", + "type": { + "kind": "reference", + "name": "FormattingOptions" + }, + "documentation": "The format options." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + } + ], + "documentation": "The parameters of a [DocumentFormattingRequest](#DocumentFormattingRequest)." + }, + { + "name": "DocumentFormattingRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "DocumentFormattingOptions" + } + ], + "documentation": "Registration options for a [DocumentFormattingRequest](#DocumentFormattingRequest)." + }, + { + "name": "DocumentRangeFormattingParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The document to format." + }, + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range to format" + }, + { + "name": "options", + "type": { + "kind": "reference", + "name": "FormattingOptions" + }, + "documentation": "The format options" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + } + ], + "documentation": "The parameters of a [DocumentRangeFormattingRequest](#DocumentRangeFormattingRequest)." + }, + { + "name": "DocumentRangeFormattingRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "DocumentRangeFormattingOptions" + } + ], + "documentation": "Registration options for a [DocumentRangeFormattingRequest](#DocumentRangeFormattingRequest)." + }, + { + "name": "DocumentOnTypeFormattingParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The document to format." + }, + { + "name": "position", + "type": { + "kind": "reference", + "name": "Position" + }, + "documentation": "The position around which the on type formatting should happen.\nThis is not necessarily the exact position where the character denoted\nby the property `ch` got typed." + }, + { + "name": "ch", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The character that has been typed that triggered the formatting\non type request. That is not necessarily the last character that\ngot inserted into the document since the client could auto insert\ncharacters as well (e.g. like automatic brace completion)." + }, + { + "name": "options", + "type": { + "kind": "reference", + "name": "FormattingOptions" + }, + "documentation": "The formatting options." + } + ], + "documentation": "The parameters of a [DocumentOnTypeFormattingRequest](#DocumentOnTypeFormattingRequest)." + }, + { + "name": "DocumentOnTypeFormattingRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "DocumentOnTypeFormattingOptions" + } + ], + "documentation": "Registration options for a [DocumentOnTypeFormattingRequest](#DocumentOnTypeFormattingRequest)." + }, + { + "name": "RenameParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The document to rename." + }, + { + "name": "position", + "type": { + "kind": "reference", + "name": "Position" + }, + "documentation": "The position at which this request was sent." + }, + { + "name": "newName", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The new name of the symbol. If the given name is not valid the\nrequest must return a [ResponseError](#ResponseError) with an\nappropriate message set." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + } + ], + "documentation": "The parameters of a [RenameRequest](#RenameRequest)." + }, + { + "name": "RenameRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + }, + { + "kind": "reference", + "name": "RenameOptions" + } + ], + "documentation": "Registration options for a [RenameRequest](#RenameRequest)." + }, + { + "name": "PrepareRenameParams", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentPositionParams" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + } + ] + }, + { + "name": "ExecuteCommandParams", + "properties": [ + { + "name": "command", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The identifier of the actual command handler." + }, + { + "name": "arguments", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "LSPAny" + } + }, + "optional": true, + "documentation": "Arguments that the command should be invoked with." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + } + ], + "documentation": "The parameters of a [ExecuteCommandRequest](#ExecuteCommandRequest)." + }, + { + "name": "ExecuteCommandRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "ExecuteCommandOptions" + } + ], + "documentation": "Registration options for a [ExecuteCommandRequest](#ExecuteCommandRequest)." + }, + { + "name": "ApplyWorkspaceEditParams", + "properties": [ + { + "name": "label", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "An optional label of the workspace edit. This label is\npresented in the user interface for example on an undo\nstack to undo the workspace edit." + }, + { + "name": "edit", + "type": { + "kind": "reference", + "name": "WorkspaceEdit" + }, + "documentation": "The edits to apply." + } + ], + "documentation": "The parameters passed via a apply workspace edit request." + }, + { + "name": "ApplyWorkspaceEditResult", + "properties": [ + { + "name": "applied", + "type": { + "kind": "base", + "name": "boolean" + }, + "documentation": "Indicates whether the edit was applied or not." + }, + { + "name": "failureReason", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "An optional textual description for why the edit was not applied.\nThis may be used by the server for diagnostic logging or to provide\na suitable error for a request that triggered the edit." + }, + { + "name": "failedChange", + "type": { + "kind": "base", + "name": "uinteger" + }, + "optional": true, + "documentation": "Depending on the client's failure handling strategy `failedChange` might\ncontain the index of the change that failed. This property is only available\nif the client signals a `failureHandlingStrategy` in its client capabilities." + } + ], + "documentation": "The result returned from the apply workspace edit request.\n\n@since 3.17 renamed from ApplyWorkspaceEditResponse", + "since": "3.17 renamed from ApplyWorkspaceEditResponse" + }, + { + "name": "WorkDoneProgressBegin", + "properties": [ + { + "name": "kind", + "type": { + "kind": "stringLiteral", + "value": "begin" + } + }, + { + "name": "title", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "Mandatory title of the progress operation. Used to briefly inform about\nthe kind of operation being performed.\n\nExamples: \"Indexing\" or \"Linking dependencies\"." + }, + { + "name": "cancellable", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Controls if a cancel button should show to allow the user to cancel the\nlong running operation. Clients that don't support cancellation are allowed\nto ignore the setting." + }, + { + "name": "message", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "Optional, more detailed associated progress message. Contains\ncomplementary information to the `title`.\n\nExamples: \"3/25 files\", \"project/src/module2\", \"node_modules/some_dep\".\nIf unset, the previous progress message (if any) is still valid." + }, + { + "name": "percentage", + "type": { + "kind": "base", + "name": "uinteger" + }, + "optional": true, + "documentation": "Optional progress percentage to display (value 100 is considered 100%).\nIf not provided infinite progress is assumed and clients are allowed\nto ignore the `percentage` value in subsequent in report notifications.\n\nThe value should be steadily rising. Clients are free to ignore values\nthat are not following this rule. The value range is [0, 100]." + } + ] + }, + { + "name": "WorkDoneProgressReport", + "properties": [ + { + "name": "kind", + "type": { + "kind": "stringLiteral", + "value": "report" + } + }, + { + "name": "cancellable", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Controls enablement state of a cancel button.\n\nClients that don't support cancellation or don't support controlling the button's\nenablement state are allowed to ignore the property." + }, + { + "name": "message", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "Optional, more detailed associated progress message. Contains\ncomplementary information to the `title`.\n\nExamples: \"3/25 files\", \"project/src/module2\", \"node_modules/some_dep\".\nIf unset, the previous progress message (if any) is still valid." + }, + { + "name": "percentage", + "type": { + "kind": "base", + "name": "uinteger" + }, + "optional": true, + "documentation": "Optional progress percentage to display (value 100 is considered 100%).\nIf not provided infinite progress is assumed and clients are allowed\nto ignore the `percentage` value in subsequent in report notifications.\n\nThe value should be steadily rising. Clients are free to ignore values\nthat are not following this rule. The value range is [0, 100]" + } + ] + }, + { + "name": "WorkDoneProgressEnd", + "properties": [ + { + "name": "kind", + "type": { + "kind": "stringLiteral", + "value": "end" + } + }, + { + "name": "message", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "Optional, a final message indicating to for example indicate the outcome\nof the operation." + } + ] + }, + { + "name": "SetTraceParams", + "properties": [ + { + "name": "value", + "type": { + "kind": "reference", + "name": "TraceValues" + } + } + ] + }, + { + "name": "LogTraceParams", + "properties": [ + { + "name": "message", + "type": { + "kind": "base", + "name": "string" + } + }, + { + "name": "verbose", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true + } + ] + }, + { + "name": "CancelParams", + "properties": [ + { + "name": "id", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "integer" + }, + { + "kind": "base", + "name": "string" + } + ] + }, + "documentation": "The request id to cancel." + } + ] + }, + { + "name": "ProgressParams", + "properties": [ + { + "name": "token", + "type": { + "kind": "reference", + "name": "ProgressToken" + }, + "documentation": "The progress token provided by the client or server." + }, + { + "name": "value", + "type": { + "kind": "reference", + "name": "LSPAny" + }, + "documentation": "The progress data." + } + ] + }, + { + "name": "TextDocumentPositionParams", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentIdentifier" + }, + "documentation": "The text document." + }, + { + "name": "position", + "type": { + "kind": "reference", + "name": "Position" + }, + "documentation": "The position inside the text document." + } + ], + "documentation": "A parameter literal used in requests to pass a text document and a position inside that\ndocument." + }, + { + "name": "WorkDoneProgressParams", + "properties": [ + { + "name": "workDoneToken", + "type": { + "kind": "reference", + "name": "ProgressToken" + }, + "optional": true, + "documentation": "An optional token that a server can use to report work done progress." + } + ] + }, + { + "name": "LocationLink", + "properties": [ + { + "name": "originSelectionRange", + "type": { + "kind": "reference", + "name": "Range" + }, + "optional": true, + "documentation": "Span of the origin of this link.\n\nUsed as the underlined span for mouse interaction. Defaults to the word range at\nthe definition position." + }, + { + "name": "targetUri", + "type": { + "kind": "base", + "name": "DocumentUri" + }, + "documentation": "The target resource identifier of this link." + }, + { + "name": "targetRange", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The full target range of this link. If the target for example is a symbol then target range is the\nrange enclosing this symbol not including leading/trailing whitespace but everything else\nlike comments. This information is typically used to highlight the range in the editor." + }, + { + "name": "targetSelectionRange", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range that should be selected and revealed when this link is being followed, e.g the name of a function.\nMust be contained by the `targetRange`. See also `DocumentSymbol#range`" + } + ], + "documentation": "Represents the connection of two locations. Provides additional metadata over normal [locations](#Location),\nincluding an origin range." + }, + { + "name": "Range", + "properties": [ + { + "name": "start", + "type": { + "kind": "reference", + "name": "Position" + }, + "documentation": "The range's start position." + }, + { + "name": "end", + "type": { + "kind": "reference", + "name": "Position" + }, + "documentation": "The range's end position." + } + ], + "documentation": "A range in a text document expressed as (zero-based) start and end positions.\n\nIf you want to specify a range that contains a line including the line ending\ncharacter(s) then use an end position denoting the start of the next line.\nFor example:\n```ts\n{\n start: { line: 5, character: 23 }\n end : { line 6, character : 0 }\n}\n```" + }, + { + "name": "ImplementationOptions", + "properties": [], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ] + }, + { + "name": "StaticRegistrationOptions", + "properties": [ + { + "name": "id", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The id used to register the request. The id can be used to deregister\nthe request again. See also Registration#id." + } + ], + "documentation": "Static registration options to be returned in the initialize\nrequest." + }, + { + "name": "TypeDefinitionOptions", + "properties": [], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ] + }, + { + "name": "WorkspaceFoldersChangeEvent", + "properties": [ + { + "name": "added", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "WorkspaceFolder" + } + }, + "documentation": "The array of added workspace folders" + }, + { + "name": "removed", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "WorkspaceFolder" + } + }, + "documentation": "The array of the removed workspace folders" + } + ], + "documentation": "The workspace folder change event." + }, + { + "name": "ConfigurationItem", + "properties": [ + { + "name": "scopeUri", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The scope to get the configuration section for." + }, + { + "name": "section", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The configuration section asked for." + } + ] + }, + { + "name": "TextDocumentIdentifier", + "properties": [ + { + "name": "uri", + "type": { + "kind": "base", + "name": "DocumentUri" + }, + "documentation": "The text document's uri." + } + ], + "documentation": "A literal to identify a text document in the client." + }, + { + "name": "Color", + "properties": [ + { + "name": "red", + "type": { + "kind": "base", + "name": "decimal" + }, + "documentation": "The red component of this color in the range [0-1]." + }, + { + "name": "green", + "type": { + "kind": "base", + "name": "decimal" + }, + "documentation": "The green component of this color in the range [0-1]." + }, + { + "name": "blue", + "type": { + "kind": "base", + "name": "decimal" + }, + "documentation": "The blue component of this color in the range [0-1]." + }, + { + "name": "alpha", + "type": { + "kind": "base", + "name": "decimal" + }, + "documentation": "The alpha component of this color in the range [0-1]." + } + ], + "documentation": "Represents a color in RGBA space." + }, + { + "name": "DocumentColorOptions", + "properties": [], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ] + }, + { + "name": "FoldingRangeOptions", + "properties": [], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ] + }, + { + "name": "DeclarationOptions", + "properties": [], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ] + }, + { + "name": "Position", + "properties": [ + { + "name": "line", + "type": { + "kind": "base", + "name": "uinteger" + }, + "documentation": "Line position in a document (zero-based).\n\nIf a line number is greater than the number of lines in a document, it defaults back to the number of lines in the document.\nIf a line number is negative, it defaults to 0." + }, + { + "name": "character", + "type": { + "kind": "base", + "name": "uinteger" + }, + "documentation": "Character offset on a line in a document (zero-based).\n\nThe meaning of this offset is determined by the negotiated\n`PositionEncodingKind`.\n\nIf the character value is greater than the line length it defaults back to the\nline length." + } + ], + "documentation": "Position in a text document expressed as zero-based line and character\noffset. Prior to 3.17 the offsets were always based on a UTF-16 string\nrepresentation. So a string of the form `a𐐀b` the character offset of the\ncharacter `a` is 0, the character offset of `𐐀` is 1 and the character\noffset of b is 3 since `𐐀` is represented using two code units in UTF-16.\nSince 3.17 clients and servers can agree on a different string encoding\nrepresentation (e.g. UTF-8). The client announces it's supported encoding\nvia the client capability [`general.positionEncodings`](#clientCapabilities).\nThe value is an array of position encodings the client supports, with\ndecreasing preference (e.g. the encoding at index `0` is the most preferred\none). To stay backwards compatible the only mandatory encoding is UTF-16\nrepresented via the string `utf-16`. The server can pick one of the\nencodings offered by the client and signals that encoding back to the\nclient via the initialize result's property\n[`capabilities.positionEncoding`](#serverCapabilities). If the string value\n`utf-16` is missing from the client's capability `general.positionEncodings`\nservers can safely assume that the client supports UTF-16. If the server\nomits the position encoding in its initialize result the encoding defaults\nto the string value `utf-16`. Implementation considerations: since the\nconversion from one encoding into another requires the content of the\nfile / line the conversion is best done where the file is read which is\nusually on the server side.\n\nPositions are line end character agnostic. So you can not specify a position\nthat denotes `\\r|\\n` or `\\n|` where `|` represents the character offset.\n\n@since 3.17.0 - support for negotiated position encoding.", + "since": "3.17.0 - support for negotiated position encoding." + }, + { + "name": "SelectionRangeOptions", + "properties": [], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ] + }, + { + "name": "CallHierarchyOptions", + "properties": [], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "Call hierarchy options used during static registration.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "SemanticTokensOptions", + "properties": [ + { + "name": "legend", + "type": { + "kind": "reference", + "name": "SemanticTokensLegend" + }, + "documentation": "The legend used by the server" + }, + { + "name": "range", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "literal", + "value": { + "properties": [] + } + } + ] + }, + "optional": true, + "documentation": "Server supports providing semantic tokens for a specific range\nof a document." + }, + { + "name": "full", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "literal", + "value": { + "properties": [ + { + "name": "delta", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The server supports deltas for full documents." + } + ] + } + } + ] + }, + "optional": true, + "documentation": "Server supports providing semantic tokens for a full document." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "SemanticTokensEdit", + "properties": [ + { + "name": "start", + "type": { + "kind": "base", + "name": "uinteger" + }, + "documentation": "The start offset of the edit." + }, + { + "name": "deleteCount", + "type": { + "kind": "base", + "name": "uinteger" + }, + "documentation": "The count of elements to remove." + }, + { + "name": "data", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "uinteger" + } + }, + "optional": true, + "documentation": "The elements to insert." + } + ], + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "LinkedEditingRangeOptions", + "properties": [], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ] + }, + { + "name": "FileCreate", + "properties": [ + { + "name": "uri", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A file:// URI for the location of the file/folder being created." + } + ], + "documentation": "Represents information on a file/folder create.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "TextDocumentEdit", + "properties": [ + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "OptionalVersionedTextDocumentIdentifier" + }, + "documentation": "The text document to change." + }, + { + "name": "edits", + "type": { + "kind": "array", + "element": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "TextEdit" + }, + { + "kind": "reference", + "name": "AnnotatedTextEdit" + } + ] + } + }, + "documentation": "The edits to be applied.\n\n@since 3.16.0 - support for AnnotatedTextEdit. This is guarded using a\nclient capability.", + "since": "3.16.0 - support for AnnotatedTextEdit. This is guarded using a\nclient capability." + } + ], + "documentation": "Describes textual changes on a text document. A TextDocumentEdit describes all changes\non a document version Si and after they are applied move the document to version Si+1.\nSo the creator of a TextDocumentEdit doesn't need to sort the array of edits or do any\nkind of ordering. However the edits must be non overlapping." + }, + { + "name": "CreateFile", + "properties": [ + { + "name": "kind", + "type": { + "kind": "stringLiteral", + "value": "create" + }, + "documentation": "A create" + }, + { + "name": "uri", + "type": { + "kind": "base", + "name": "DocumentUri" + }, + "documentation": "The resource to create." + }, + { + "name": "options", + "type": { + "kind": "reference", + "name": "CreateFileOptions" + }, + "optional": true, + "documentation": "Additional options" + } + ], + "extends": [ + { + "kind": "reference", + "name": "ResourceOperation" + } + ], + "documentation": "Create file operation." + }, + { + "name": "RenameFile", + "properties": [ + { + "name": "kind", + "type": { + "kind": "stringLiteral", + "value": "rename" + }, + "documentation": "A rename" + }, + { + "name": "oldUri", + "type": { + "kind": "base", + "name": "DocumentUri" + }, + "documentation": "The old (existing) location." + }, + { + "name": "newUri", + "type": { + "kind": "base", + "name": "DocumentUri" + }, + "documentation": "The new location." + }, + { + "name": "options", + "type": { + "kind": "reference", + "name": "RenameFileOptions" + }, + "optional": true, + "documentation": "Rename options." + } + ], + "extends": [ + { + "kind": "reference", + "name": "ResourceOperation" + } + ], + "documentation": "Rename file operation" + }, + { + "name": "DeleteFile", + "properties": [ + { + "name": "kind", + "type": { + "kind": "stringLiteral", + "value": "delete" + }, + "documentation": "A delete" + }, + { + "name": "uri", + "type": { + "kind": "base", + "name": "DocumentUri" + }, + "documentation": "The file to delete." + }, + { + "name": "options", + "type": { + "kind": "reference", + "name": "DeleteFileOptions" + }, + "optional": true, + "documentation": "Delete options." + } + ], + "extends": [ + { + "kind": "reference", + "name": "ResourceOperation" + } + ], + "documentation": "Delete file operation" + }, + { + "name": "ChangeAnnotation", + "properties": [ + { + "name": "label", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A human-readable string describing the actual change. The string\nis rendered prominent in the user interface." + }, + { + "name": "needsConfirmation", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "A flag which indicates that user confirmation is needed\nbefore applying the change." + }, + { + "name": "description", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A human-readable string which is rendered less prominent in\nthe user interface." + } + ], + "documentation": "Additional information that describes document changes.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "FileOperationFilter", + "properties": [ + { + "name": "scheme", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A Uri scheme like `file` or `untitled`." + }, + { + "name": "pattern", + "type": { + "kind": "reference", + "name": "FileOperationPattern" + }, + "documentation": "The actual file operation pattern." + } + ], + "documentation": "A filter to describe in which file operation requests or notifications\nthe server is interested in receiving.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "FileRename", + "properties": [ + { + "name": "oldUri", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A file:// URI for the original location of the file/folder being renamed." + }, + { + "name": "newUri", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A file:// URI for the new location of the file/folder being renamed." + } + ], + "documentation": "Represents information on a file/folder rename.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "FileDelete", + "properties": [ + { + "name": "uri", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A file:// URI for the location of the file/folder being deleted." + } + ], + "documentation": "Represents information on a file/folder delete.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "MonikerOptions", + "properties": [], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ] + }, + { + "name": "TypeHierarchyOptions", + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "properties": [], + "documentation": "Type hierarchy options used during static registration.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "InlineValueContext", + "properties": [ + { + "name": "frameId", + "type": { + "kind": "base", + "name": "integer" + }, + "documentation": "The stack frame (as a DAP Id) where the execution has stopped." + }, + { + "name": "stoppedLocation", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The document range where execution has stopped.\nTypically the end position of the range denotes the line where the inline values are shown." + } + ], + "documentation": "@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "InlineValueText", + "properties": [ + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The document range for which the inline value applies." + }, + { + "name": "text", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The text of the inline value." + } + ], + "documentation": "Provide inline value as text.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "InlineValueVariableLookup", + "properties": [ + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The document range for which the inline value applies.\nThe range is used to extract the variable name from the underlying document." + }, + { + "name": "variableName", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "If specified the name of the variable to look up." + }, + { + "name": "caseSensitiveLookup", + "type": { + "kind": "base", + "name": "boolean" + }, + "documentation": "How to perform the lookup." + } + ], + "documentation": "Provide inline value through a variable lookup.\nIf only a range is specified, the variable name will be extracted from the underlying document.\nAn optional variable name can be used to override the extracted name.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "InlineValueEvaluatableExpression", + "properties": [ + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The document range for which the inline value applies.\nThe range is used to extract the evaluatable expression from the underlying document." + }, + { + "name": "expression", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "If specified the expression overrides the extracted expression." + } + ], + "documentation": "Provide an inline value through an expression evaluation.\nIf only a range is specified, the expression will be extracted from the underlying document.\nAn optional expression can be used to override the extracted expression.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "InlineValueOptions", + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "properties": [], + "documentation": "Inline value options used during static registration.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "InlayHintLabelPart", + "properties": [ + { + "name": "value", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The value of this label part." + }, + { + "name": "tooltip", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "string" + }, + { + "kind": "reference", + "name": "MarkupContent" + } + ] + }, + "optional": true, + "documentation": "The tooltip text when you hover over this label part. Depending on\nthe client capability `inlayHint.resolveSupport` clients might resolve\nthis property late using the resolve request." + }, + { + "name": "location", + "type": { + "kind": "reference", + "name": "Location" + }, + "optional": true, + "documentation": "An optional source code location that represents this\nlabel part.\n\nThe editor will use this location for the hover and for code navigation\nfeatures: This part will become a clickable link that resolves to the\ndefinition of the symbol at the given location (not necessarily the\nlocation itself), it shows the hover that shows at the given location,\nand it shows a context menu with further code navigation commands.\n\nDepending on the client capability `inlayHint.resolveSupport` clients\nmight resolve this property late using the resolve request." + }, + { + "name": "command", + "type": { + "kind": "reference", + "name": "Command" + }, + "optional": true, + "documentation": "An optional command for this label part.\n\nDepending on the client capability `inlayHint.resolveSupport` clients\nmight resolve this property late using the resolve request." + } + ], + "documentation": "An inlay hint label part allows for interactive and composite labels\nof inlay hints.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "MarkupContent", + "properties": [ + { + "name": "kind", + "type": { + "kind": "reference", + "name": "MarkupKind" + }, + "documentation": "The type of the Markup" + }, + { + "name": "value", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The content itself" + } + ], + "documentation": "A `MarkupContent` literal represents a string value which content is interpreted base on its\nkind flag. Currently the protocol supports `plaintext` and `markdown` as markup kinds.\n\nIf the kind is `markdown` then the value can contain fenced code blocks like in GitHub issues.\nSee https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting\n\nHere is an example how such a string can be constructed using JavaScript / TypeScript:\n```ts\nlet markdown: MarkdownContent = {\n kind: MarkupKind.Markdown,\n value: [\n '# Header',\n 'Some text',\n '```typescript',\n 'someCode();',\n '```'\n ].join('\\n')\n};\n```\n\n*Please Note* that clients might sanitize the return markdown. A client could decide to\nremove HTML from the markdown to avoid script execution." + }, + { + "name": "InlayHintOptions", + "properties": [ + { + "name": "resolveProvider", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The server provides support to resolve additional\ninformation for an inlay hint item." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "Inlay hint options used during static registration.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "RelatedFullDocumentDiagnosticReport", + "properties": [ + { + "name": "relatedDocuments", + "type": { + "kind": "map", + "key": { + "kind": "base", + "name": "DocumentUri" + }, + "value": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "FullDocumentDiagnosticReport" + }, + { + "kind": "reference", + "name": "UnchangedDocumentDiagnosticReport" + } + ] + } + }, + "optional": true, + "documentation": "Diagnostics of related documents. This information is useful\nin programming languages where code in a file A can generate\ndiagnostics in a file B which A depends on. An example of\nsuch a language is C/C++ where marco definitions in a file\na.cpp and result in errors in a header file b.hpp.\n\n@since 3.17.0", + "since": "3.17.0" + } + ], + "extends": [ + { + "kind": "reference", + "name": "FullDocumentDiagnosticReport" + } + ], + "documentation": "A full diagnostic report with a set of related documents.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "RelatedUnchangedDocumentDiagnosticReport", + "properties": [ + { + "name": "relatedDocuments", + "type": { + "kind": "map", + "key": { + "kind": "base", + "name": "DocumentUri" + }, + "value": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "FullDocumentDiagnosticReport" + }, + { + "kind": "reference", + "name": "UnchangedDocumentDiagnosticReport" + } + ] + } + }, + "optional": true, + "documentation": "Diagnostics of related documents. This information is useful\nin programming languages where code in a file A can generate\ndiagnostics in a file B which A depends on. An example of\nsuch a language is C/C++ where marco definitions in a file\na.cpp and result in errors in a header file b.hpp.\n\n@since 3.17.0", + "since": "3.17.0" + } + ], + "extends": [ + { + "kind": "reference", + "name": "UnchangedDocumentDiagnosticReport" + } + ], + "documentation": "An unchanged diagnostic report with a set of related documents.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "FullDocumentDiagnosticReport", + "properties": [ + { + "name": "kind", + "type": { + "kind": "stringLiteral", + "value": "full" + }, + "documentation": "A full document diagnostic report." + }, + { + "name": "resultId", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "An optional result id. If provided it will\nbe sent on the next diagnostic request for the\nsame document." + }, + { + "name": "items", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "Diagnostic" + } + }, + "documentation": "The actual items." + } + ], + "documentation": "A diagnostic report with a full set of problems.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "UnchangedDocumentDiagnosticReport", + "properties": [ + { + "name": "kind", + "type": { + "kind": "stringLiteral", + "value": "unchanged" + }, + "documentation": "A document diagnostic report indicating\nno changes to the last result. A server can\nonly return `unchanged` if result ids are\nprovided." + }, + { + "name": "resultId", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A result id which will be sent on the next\ndiagnostic request for the same document." + } + ], + "documentation": "A diagnostic report indicating that the last returned\nreport is still accurate.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "DiagnosticOptions", + "properties": [ + { + "name": "identifier", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "An optional identifier under which the diagnostics are\nmanaged by the client." + }, + { + "name": "interFileDependencies", + "type": { + "kind": "base", + "name": "boolean" + }, + "documentation": "Whether the language has inter file dependencies meaning that\nediting code in one file can result in a different diagnostic\nset in another file. Inter file dependencies are common for\nmost programming languages and typically uncommon for linters." + }, + { + "name": "workspaceDiagnostics", + "type": { + "kind": "base", + "name": "boolean" + }, + "documentation": "The server provides support for workspace diagnostics as well." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "Diagnostic options.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "PreviousResultId", + "properties": [ + { + "name": "uri", + "type": { + "kind": "base", + "name": "DocumentUri" + }, + "documentation": "The URI for which the client knowns a\nresult id." + }, + { + "name": "value", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The value of the previous result id." + } + ], + "documentation": "A previous result id in a workspace pull request.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "NotebookDocument", + "properties": [ + { + "name": "uri", + "type": { + "kind": "reference", + "name": "URI" + }, + "documentation": "The notebook document's uri." + }, + { + "name": "notebookType", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The type of the notebook." + }, + { + "name": "version", + "type": { + "kind": "base", + "name": "integer" + }, + "documentation": "The version number of this document (it will increase after each\nchange, including undo/redo)." + }, + { + "name": "metadata", + "type": { + "kind": "reference", + "name": "LSPObject" + }, + "optional": true, + "documentation": "Additional metadata stored with the notebook\ndocument.\n\nNote: should always be an object literal (e.g. LSPObject)" + }, + { + "name": "cells", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "NotebookCell" + } + }, + "documentation": "The cells of a notebook." + } + ], + "documentation": "A notebook document.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "TextDocumentItem", + "properties": [ + { + "name": "uri", + "type": { + "kind": "base", + "name": "DocumentUri" + }, + "documentation": "The text document's uri." + }, + { + "name": "languageId", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The text document's language identifier." + }, + { + "name": "version", + "type": { + "kind": "base", + "name": "integer" + }, + "documentation": "The version number of this document (it will increase after each\nchange, including undo/redo)." + }, + { + "name": "text", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The content of the opened text document." + } + ], + "documentation": "An item to transfer a text document from the client to the\nserver." + }, + { + "name": "VersionedNotebookDocumentIdentifier", + "properties": [ + { + "name": "version", + "type": { + "kind": "base", + "name": "integer" + }, + "documentation": "The version number of this notebook document." + }, + { + "name": "uri", + "type": { + "kind": "reference", + "name": "URI" + }, + "documentation": "The notebook document's uri." + } + ], + "documentation": "A versioned notebook document identifier.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "NotebookDocumentChangeEvent", + "properties": [ + { + "name": "metadata", + "type": { + "kind": "reference", + "name": "LSPObject" + }, + "optional": true, + "documentation": "The changed meta data if any.\n\nNote: should always be an object literal (e.g. LSPObject)" + }, + { + "name": "cells", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "structure", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "array", + "type": { + "kind": "reference", + "name": "NotebookCellArrayChange" + }, + "documentation": "The change to the cell array." + }, + { + "name": "didOpen", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "TextDocumentItem" + } + }, + "optional": true, + "documentation": "Additional opened cell text documents." + }, + { + "name": "didClose", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "TextDocumentIdentifier" + } + }, + "optional": true, + "documentation": "Additional closed cell text documents." + } + ] + } + }, + "optional": true, + "documentation": "Changes to the cell structure to add or\nremove cells." + }, + { + "name": "data", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "NotebookCell" + } + }, + "optional": true, + "documentation": "Changes to notebook cells properties like its\nkind, execution summary or metadata." + }, + { + "name": "textContent", + "type": { + "kind": "array", + "element": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "document", + "type": { + "kind": "reference", + "name": "VersionedTextDocumentIdentifier" + } + }, + { + "name": "changes", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "TextDocumentContentChangeEvent" + } + } + } + ] + } + } + }, + "optional": true, + "documentation": "Changes to the text content of notebook cells." + } + ] + } + }, + "optional": true, + "documentation": "Changes to cells" + } + ], + "documentation": "A change event for a notebook document.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "NotebookDocumentIdentifier", + "properties": [ + { + "name": "uri", + "type": { + "kind": "reference", + "name": "URI" + }, + "documentation": "The notebook document's uri." + } + ], + "documentation": "A literal to identify a notebook document in the client.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "Registration", + "properties": [ + { + "name": "id", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The id used to register the request. The id can be used to deregister\nthe request again." + }, + { + "name": "method", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The method / capability to register for." + }, + { + "name": "registerOptions", + "type": { + "kind": "reference", + "name": "LSPAny" + }, + "optional": true, + "documentation": "Options necessary for the registration." + } + ], + "documentation": "General parameters to to register for an notification or to register a provider." + }, + { + "name": "Unregistration", + "properties": [ + { + "name": "id", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The id used to unregister the request or notification. Usually an id\nprovided during the register request." + }, + { + "name": "method", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The method to unregister for." + } + ], + "documentation": "General parameters to unregister a request or notification." + }, + { + "name": "_InitializeParams", + "properties": [ + { + "name": "processId", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "integer" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "documentation": "The process Id of the parent process that started\nthe server.\n\nIs `null` if the process has not been started by another process.\nIf the parent process is not alive then the server should exit." + }, + { + "name": "clientInfo", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "name", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The name of the client as defined by the client." + }, + { + "name": "version", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The client's version as defined by the client." + } + ] + } + }, + "optional": true, + "documentation": "Information about the client\n\n@since 3.15.0", + "since": "3.15.0" + }, + { + "name": "locale", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The locale the client is currently showing the user interface\nin. This must not necessarily be the locale of the operating\nsystem.\n\nUses IETF language tags as the value's syntax\n(See https://en.wikipedia.org/wiki/IETF_language_tag)\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "rootPath", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "string" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "optional": true, + "documentation": "The rootPath of the workspace. Is null\nif no folder is open.\n\n@deprecated in favour of rootUri." + }, + { + "name": "rootUri", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "DocumentUri" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "documentation": "The rootUri of the workspace. Is null if no\nfolder is open. If both `rootPath` and `rootUri` are set\n`rootUri` wins.\n\n@deprecated in favour of workspaceFolders." + }, + { + "name": "capabilities", + "type": { + "kind": "reference", + "name": "ClientCapabilities" + }, + "documentation": "The capabilities provided by the client (editor or tool)" + }, + { + "name": "initializationOptions", + "type": { + "kind": "reference", + "name": "LSPAny" + }, + "optional": true, + "documentation": "User provided initialization options." + }, + { + "name": "trace", + "type": { + "kind": "or", + "items": [ + { + "kind": "stringLiteral", + "value": "off" + }, + { + "kind": "stringLiteral", + "value": "messages" + }, + { + "kind": "stringLiteral", + "value": "compact" + }, + { + "kind": "stringLiteral", + "value": "verbose" + } + ] + }, + "optional": true, + "documentation": "The initial trace setting. If omitted trace is disabled ('off')." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + } + ], + "documentation": "The initialize parameters" + }, + { + "name": "WorkspaceFoldersInitializeParams", + "properties": [ + { + "name": "workspaceFolders", + "type": { + "kind": "or", + "items": [ + { + "kind": "array", + "element": { + "kind": "reference", + "name": "WorkspaceFolder" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "optional": true, + "documentation": "The workspace folders configured in the client when the server starts.\n\nThis property is only available if the client supports workspace folders.\nIt can be `null` if the client supports workspace folders but none are\nconfigured.\n\n@since 3.6.0", + "since": "3.6.0" + } + ] + }, + { + "name": "ServerCapabilities", + "properties": [ + { + "name": "positionEncoding", + "type": { + "kind": "reference", + "name": "PositionEncodingKind" + }, + "optional": true, + "documentation": "The position encoding the server picked from the encodings offered\nby the client via the client capability `general.positionEncodings`.\n\nIf the client didn't provide any position encodings the only valid\nvalue that a server can return is 'utf-16'.\n\nIf omitted it defaults to 'utf-16'.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "textDocumentSync", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "TextDocumentSyncOptions" + }, + { + "kind": "reference", + "name": "TextDocumentSyncKind" + } + ] + }, + "optional": true, + "documentation": "Defines how text documents are synced. Is either a detailed structure\ndefining each notification or for backwards compatibility the\nTextDocumentSyncKind number." + }, + { + "name": "notebookDocumentSync", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "NotebookDocumentSyncOptions" + }, + { + "kind": "reference", + "name": "NotebookDocumentSyncRegistrationOptions" + } + ] + }, + "optional": true, + "documentation": "Defines how notebook documents are synced.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "completionProvider", + "type": { + "kind": "reference", + "name": "CompletionOptions" + }, + "optional": true, + "documentation": "The server provides completion support." + }, + { + "name": "hoverProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "HoverOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides hover support." + }, + { + "name": "signatureHelpProvider", + "type": { + "kind": "reference", + "name": "SignatureHelpOptions" + }, + "optional": true, + "documentation": "The server provides signature help support." + }, + { + "name": "declarationProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "DeclarationOptions" + }, + { + "kind": "reference", + "name": "DeclarationRegistrationOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides Goto Declaration support." + }, + { + "name": "definitionProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "DefinitionOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides goto definition support." + }, + { + "name": "typeDefinitionProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "TypeDefinitionOptions" + }, + { + "kind": "reference", + "name": "TypeDefinitionRegistrationOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides Goto Type Definition support." + }, + { + "name": "implementationProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "ImplementationOptions" + }, + { + "kind": "reference", + "name": "ImplementationRegistrationOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides Goto Implementation support." + }, + { + "name": "referencesProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "ReferenceOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides find references support." + }, + { + "name": "documentHighlightProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "DocumentHighlightOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides document highlight support." + }, + { + "name": "documentSymbolProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "DocumentSymbolOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides document symbol support." + }, + { + "name": "codeActionProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "CodeActionOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides code actions. CodeActionOptions may only be\nspecified if the client states that it supports\n`codeActionLiteralSupport` in its initial `initialize` request." + }, + { + "name": "codeLensProvider", + "type": { + "kind": "reference", + "name": "CodeLensOptions" + }, + "optional": true, + "documentation": "The server provides code lens." + }, + { + "name": "documentLinkProvider", + "type": { + "kind": "reference", + "name": "DocumentLinkOptions" + }, + "optional": true, + "documentation": "The server provides document link support." + }, + { + "name": "colorProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "DocumentColorOptions" + }, + { + "kind": "reference", + "name": "DocumentColorRegistrationOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides color provider support." + }, + { + "name": "workspaceSymbolProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "WorkspaceSymbolOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides workspace symbol support." + }, + { + "name": "documentFormattingProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "DocumentFormattingOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides document formatting." + }, + { + "name": "documentRangeFormattingProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "DocumentRangeFormattingOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides document range formatting." + }, + { + "name": "documentOnTypeFormattingProvider", + "type": { + "kind": "reference", + "name": "DocumentOnTypeFormattingOptions" + }, + "optional": true, + "documentation": "The server provides document formatting on typing." + }, + { + "name": "renameProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "RenameOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides rename support. RenameOptions may only be\nspecified if the client states that it supports\n`prepareSupport` in its initial `initialize` request." + }, + { + "name": "foldingRangeProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "FoldingRangeOptions" + }, + { + "kind": "reference", + "name": "FoldingRangeRegistrationOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides folding provider support." + }, + { + "name": "selectionRangeProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "SelectionRangeOptions" + }, + { + "kind": "reference", + "name": "SelectionRangeRegistrationOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides selection range support." + }, + { + "name": "executeCommandProvider", + "type": { + "kind": "reference", + "name": "ExecuteCommandOptions" + }, + "optional": true, + "documentation": "The server provides execute command support." + }, + { + "name": "callHierarchyProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "CallHierarchyOptions" + }, + { + "kind": "reference", + "name": "CallHierarchyRegistrationOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides call hierarchy support.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "linkedEditingRangeProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "LinkedEditingRangeOptions" + }, + { + "kind": "reference", + "name": "LinkedEditingRangeRegistrationOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides linked editing range support.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "semanticTokensProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "SemanticTokensOptions" + }, + { + "kind": "reference", + "name": "SemanticTokensRegistrationOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides semantic tokens support.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "monikerProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "MonikerOptions" + }, + { + "kind": "reference", + "name": "MonikerRegistrationOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides moniker support.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "typeHierarchyProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "TypeHierarchyOptions" + }, + { + "kind": "reference", + "name": "TypeHierarchyRegistrationOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides type hierarchy support.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "inlineValueProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "InlineValueOptions" + }, + { + "kind": "reference", + "name": "InlineValueRegistrationOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides inline values.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "inlayHintProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "InlayHintOptions" + }, + { + "kind": "reference", + "name": "InlayHintRegistrationOptions" + } + ] + }, + "optional": true, + "documentation": "The server provides inlay hints.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "diagnosticProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "DiagnosticOptions" + }, + { + "kind": "reference", + "name": "DiagnosticRegistrationOptions" + } + ] + }, + "optional": true, + "documentation": "The server has support for pull model diagnostics.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "workspace", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "workspaceFolders", + "type": { + "kind": "reference", + "name": "WorkspaceFoldersServerCapabilities" + }, + "optional": true, + "documentation": "The server supports workspace folder.\n\n@since 3.6.0", + "since": "3.6.0" + }, + { + "name": "fileOperations", + "type": { + "kind": "reference", + "name": "FileOperationOptions" + }, + "optional": true, + "documentation": "The server is interested in notifications/requests for operations on files.\n\n@since 3.16.0", + "since": "3.16.0" + } + ] + } + }, + "optional": true, + "documentation": "Workspace specific server capabilities." + }, + { + "name": "experimental", + "type": { + "kind": "reference", + "name": "LSPAny" + }, + "optional": true, + "documentation": "Experimental server capabilities." + } + ], + "documentation": "Defines the capabilities provided by a language\nserver." + }, + { + "name": "VersionedTextDocumentIdentifier", + "properties": [ + { + "name": "version", + "type": { + "kind": "base", + "name": "integer" + }, + "documentation": "The version number of this document." + } + ], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentIdentifier" + } + ], + "documentation": "A text document identifier to denote a specific version of a text document." + }, + { + "name": "SaveOptions", + "properties": [ + { + "name": "includeText", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client is supposed to include the content on save." + } + ], + "documentation": "Save options." + }, + { + "name": "FileEvent", + "properties": [ + { + "name": "uri", + "type": { + "kind": "base", + "name": "DocumentUri" + }, + "documentation": "The file's uri." + }, + { + "name": "type", + "type": { + "kind": "reference", + "name": "FileChangeType" + }, + "documentation": "The change type." + } + ], + "documentation": "An event describing a file change." + }, + { + "name": "FileSystemWatcher", + "properties": [ + { + "name": "globPattern", + "type": { + "kind": "reference", + "name": "GlobPattern" + }, + "documentation": "The glob pattern to watch. See {@link GlobPattern glob pattern} for more detail.\n\n@since 3.17.0 support for relative patterns.", + "since": "3.17.0 support for relative patterns." + }, + { + "name": "kind", + "type": { + "kind": "reference", + "name": "WatchKind" + }, + "optional": true, + "documentation": "The kind of events of interest. If omitted it defaults\nto WatchKind.Create | WatchKind.Change | WatchKind.Delete\nwhich is 7." + } + ] + }, + { + "name": "Diagnostic", + "properties": [ + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range at which the message applies" + }, + { + "name": "severity", + "type": { + "kind": "reference", + "name": "DiagnosticSeverity" + }, + "optional": true, + "documentation": "The diagnostic's severity. Can be omitted. If omitted it is up to the\nclient to interpret diagnostics as error, warning, info or hint." + }, + { + "name": "code", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "integer" + }, + { + "kind": "base", + "name": "string" + } + ] + }, + "optional": true, + "documentation": "The diagnostic's code, which usually appear in the user interface." + }, + { + "name": "codeDescription", + "type": { + "kind": "reference", + "name": "CodeDescription" + }, + "optional": true, + "documentation": "An optional property to describe the error code.\nRequires the code field (above) to be present/not null.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "source", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A human-readable string describing the source of this\ndiagnostic, e.g. 'typescript' or 'super lint'. It usually\nappears in the user interface." + }, + { + "name": "message", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The diagnostic's message. It usually appears in the user interface" + }, + { + "name": "tags", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "DiagnosticTag" + } + }, + "optional": true, + "documentation": "Additional metadata about the diagnostic.\n\n@since 3.15.0", + "since": "3.15.0" + }, + { + "name": "relatedInformation", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "DiagnosticRelatedInformation" + } + }, + "optional": true, + "documentation": "An array of related diagnostic information, e.g. when symbol-names within\na scope collide all definitions can be marked via this property." + }, + { + "name": "data", + "type": { + "kind": "reference", + "name": "LSPAny" + }, + "optional": true, + "documentation": "A data entry field that is preserved between a `textDocument/publishDiagnostics`\nnotification and `textDocument/codeAction` request.\n\n@since 3.16.0", + "since": "3.16.0" + } + ], + "documentation": "Represents a diagnostic, such as a compiler error or warning. Diagnostic objects\nare only valid in the scope of a resource." + }, + { + "name": "CompletionContext", + "properties": [ + { + "name": "triggerKind", + "type": { + "kind": "reference", + "name": "CompletionTriggerKind" + }, + "documentation": "How the completion was triggered." + }, + { + "name": "triggerCharacter", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The trigger character (a single character) that has trigger code complete.\nIs undefined if `triggerKind !== CompletionTriggerKind.TriggerCharacter`" + } + ], + "documentation": "Contains additional information about the context in which a completion request is triggered." + }, + { + "name": "CompletionItemLabelDetails", + "properties": [ + { + "name": "detail", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "An optional string which is rendered less prominently directly after {@link CompletionItem.label label},\nwithout any spacing. Should be used for function signatures and type annotations." + }, + { + "name": "description", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "An optional string which is rendered less prominently after {@link CompletionItem.detail}. Should be used\nfor fully qualified names and file paths." + } + ], + "documentation": "Additional details for a completion item label.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "InsertReplaceEdit", + "properties": [ + { + "name": "newText", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The string to be inserted." + }, + { + "name": "insert", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range if the insert is requested" + }, + { + "name": "replace", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range if the replace is requested." + } + ], + "documentation": "A special text edit to provide an insert and a replace operation.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "CompletionOptions", + "properties": [ + { + "name": "triggerCharacters", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "optional": true, + "documentation": "Most tools trigger completion request automatically without explicitly requesting\nit using a keyboard shortcut (e.g. Ctrl+Space). Typically they do so when the user\nstarts to type an identifier. For example if the user types `c` in a JavaScript file\ncode complete will automatically pop up present `console` besides others as a\ncompletion item. Characters that make up identifiers don't need to be listed here.\n\nIf code complete should automatically be trigger on characters not being valid inside\nan identifier (for example `.` in JavaScript) list them in `triggerCharacters`." + }, + { + "name": "allCommitCharacters", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "optional": true, + "documentation": "The list of all possible characters that commit a completion. This field can be used\nif clients don't support individual commit characters per completion item. See\n`ClientCapabilities.textDocument.completion.completionItem.commitCharactersSupport`\n\nIf a server provides both `allCommitCharacters` and commit characters on an individual\ncompletion item the ones on the completion item win.\n\n@since 3.2.0", + "since": "3.2.0" + }, + { + "name": "resolveProvider", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The server provides support to resolve additional\ninformation for a completion item." + }, + { + "name": "completionItem", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "labelDetailsSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The server has support for completion item label\ndetails (see also `CompletionItemLabelDetails`) when\nreceiving a completion item in a resolve call.\n\n@since 3.17.0", + "since": "3.17.0" + } + ] + } + }, + "optional": true, + "documentation": "The server supports the following `CompletionItem` specific\ncapabilities.\n\n@since 3.17.0", + "since": "3.17.0" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "Completion options." + }, + { + "name": "HoverOptions", + "properties": [], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "Hover options." + }, + { + "name": "SignatureHelpContext", + "properties": [ + { + "name": "triggerKind", + "type": { + "kind": "reference", + "name": "SignatureHelpTriggerKind" + }, + "documentation": "Action that caused signature help to be triggered." + }, + { + "name": "triggerCharacter", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "Character that caused signature help to be triggered.\n\nThis is undefined when `triggerKind !== SignatureHelpTriggerKind.TriggerCharacter`" + }, + { + "name": "isRetrigger", + "type": { + "kind": "base", + "name": "boolean" + }, + "documentation": "`true` if signature help was already showing when it was triggered.\n\nRetriggers occurs when the signature help is already active and can be caused by actions such as\ntyping a trigger character, a cursor move, or document content changes." + }, + { + "name": "activeSignatureHelp", + "type": { + "kind": "reference", + "name": "SignatureHelp" + }, + "optional": true, + "documentation": "The currently active `SignatureHelp`.\n\nThe `activeSignatureHelp` has its `SignatureHelp.activeSignature` field updated based on\nthe user navigating through available signatures." + } + ], + "documentation": "Additional information about the context in which a signature help request was triggered.\n\n@since 3.15.0", + "since": "3.15.0" + }, + { + "name": "SignatureInformation", + "properties": [ + { + "name": "label", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The label of this signature. Will be shown in\nthe UI." + }, + { + "name": "documentation", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "string" + }, + { + "kind": "reference", + "name": "MarkupContent" + } + ] + }, + "optional": true, + "documentation": "The human-readable doc-comment of this signature. Will be shown\nin the UI but can be omitted." + }, + { + "name": "parameters", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "ParameterInformation" + } + }, + "optional": true, + "documentation": "The parameters of this signature." + }, + { + "name": "activeParameter", + "type": { + "kind": "base", + "name": "uinteger" + }, + "optional": true, + "documentation": "The index of the active parameter.\n\nIf provided, this is used in place of `SignatureHelp.activeParameter`.\n\n@since 3.16.0", + "since": "3.16.0" + } + ], + "documentation": "Represents the signature of something callable. A signature\ncan have a label, like a function-name, a doc-comment, and\na set of parameters." + }, + { + "name": "SignatureHelpOptions", + "properties": [ + { + "name": "triggerCharacters", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "optional": true, + "documentation": "List of characters that trigger signature help automatically." + }, + { + "name": "retriggerCharacters", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "optional": true, + "documentation": "List of characters that re-trigger signature help.\n\nThese trigger characters are only active when signature help is already showing. All trigger characters\nare also counted as re-trigger characters.\n\n@since 3.15.0", + "since": "3.15.0" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "Server Capabilities for a [SignatureHelpRequest](#SignatureHelpRequest)." + }, + { + "name": "DefinitionOptions", + "properties": [], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "Server Capabilities for a [DefinitionRequest](#DefinitionRequest)." + }, + { + "name": "ReferenceContext", + "properties": [ + { + "name": "includeDeclaration", + "type": { + "kind": "base", + "name": "boolean" + }, + "documentation": "Include the declaration of the current symbol." + } + ], + "documentation": "Value-object that contains additional information when\nrequesting references." + }, + { + "name": "ReferenceOptions", + "properties": [], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "Reference options." + }, + { + "name": "DocumentHighlightOptions", + "properties": [], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "Provider options for a [DocumentHighlightRequest](#DocumentHighlightRequest)." + }, + { + "name": "BaseSymbolInformation", + "properties": [ + { + "name": "name", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The name of this symbol." + }, + { + "name": "kind", + "type": { + "kind": "reference", + "name": "SymbolKind" + }, + "documentation": "The kind of this symbol." + }, + { + "name": "tags", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "SymbolTag" + } + }, + "optional": true, + "documentation": "Tags for this symbol.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "containerName", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The name of the symbol containing this symbol. This information is for\nuser interface purposes (e.g. to render a qualifier in the user interface\nif necessary). It can't be used to re-infer a hierarchy for the document\nsymbols." + } + ], + "documentation": "A base for all symbol information." + }, + { + "name": "DocumentSymbolOptions", + "properties": [ + { + "name": "label", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A human-readable string that is shown when multiple outlines trees\nare shown for the same document.\n\n@since 3.16.0", + "since": "3.16.0" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "Provider options for a [DocumentSymbolRequest](#DocumentSymbolRequest)." + }, + { + "name": "CodeActionContext", + "properties": [ + { + "name": "diagnostics", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "Diagnostic" + } + }, + "documentation": "An array of diagnostics known on the client side overlapping the range provided to the\n`textDocument/codeAction` request. They are provided so that the server knows which\nerrors are currently presented to the user for the given range. There is no guarantee\nthat these accurately reflect the error state of the resource. The primary parameter\nto compute code actions is the provided range." + }, + { + "name": "only", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "CodeActionKind" + } + }, + "optional": true, + "documentation": "Requested kind of actions to return.\n\nActions not of this kind are filtered out by the client before being shown. So servers\ncan omit computing them." + }, + { + "name": "triggerKind", + "type": { + "kind": "reference", + "name": "CodeActionTriggerKind" + }, + "optional": true, + "documentation": "The reason why code actions were requested.\n\n@since 3.17.0", + "since": "3.17.0" + } + ], + "documentation": "Contains additional diagnostic information about the context in which\na [code action](#CodeActionProvider.provideCodeActions) is run." + }, + { + "name": "CodeActionOptions", + "properties": [ + { + "name": "codeActionKinds", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "CodeActionKind" + } + }, + "optional": true, + "documentation": "CodeActionKinds that this server may return.\n\nThe list of kinds may be generic, such as `CodeActionKind.Refactor`, or the server\nmay list out every specific kind they provide." + }, + { + "name": "resolveProvider", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The server provides support to resolve additional\ninformation for a code action.\n\n@since 3.16.0", + "since": "3.16.0" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "Provider options for a [CodeActionRequest](#CodeActionRequest)." + }, + { + "name": "WorkspaceSymbolOptions", + "properties": [ + { + "name": "resolveProvider", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The server provides support to resolve additional\ninformation for a workspace symbol.\n\n@since 3.17.0", + "since": "3.17.0" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "Server capabilities for a [WorkspaceSymbolRequest](#WorkspaceSymbolRequest)." + }, + { + "name": "CodeLensOptions", + "properties": [ + { + "name": "resolveProvider", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Code lens has a resolve provider as well." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "Code Lens provider options of a [CodeLensRequest](#CodeLensRequest)." + }, + { + "name": "DocumentLinkOptions", + "properties": [ + { + "name": "resolveProvider", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Document links have a resolve provider as well." + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "Provider options for a [DocumentLinkRequest](#DocumentLinkRequest)." + }, + { + "name": "FormattingOptions", + "properties": [ + { + "name": "tabSize", + "type": { + "kind": "base", + "name": "uinteger" + }, + "documentation": "Size of a tab in spaces." + }, + { + "name": "insertSpaces", + "type": { + "kind": "base", + "name": "boolean" + }, + "documentation": "Prefer spaces over tabs." + }, + { + "name": "trimTrailingWhitespace", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Trim trailing whitespace on a line.\n\n@since 3.15.0", + "since": "3.15.0" + }, + { + "name": "insertFinalNewline", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Insert a newline character at the end of the file if one does not exist.\n\n@since 3.15.0", + "since": "3.15.0" + }, + { + "name": "trimFinalNewlines", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Trim all newlines after the final newline at the end of the file.\n\n@since 3.15.0", + "since": "3.15.0" + } + ], + "documentation": "Value-object describing what options formatting should use." + }, + { + "name": "DocumentFormattingOptions", + "properties": [], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "Provider options for a [DocumentFormattingRequest](#DocumentFormattingRequest)." + }, + { + "name": "DocumentRangeFormattingOptions", + "properties": [], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "Provider options for a [DocumentRangeFormattingRequest](#DocumentRangeFormattingRequest)." + }, + { + "name": "DocumentOnTypeFormattingOptions", + "properties": [ + { + "name": "firstTriggerCharacter", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A character on which formatting should be triggered, like `{`." + }, + { + "name": "moreTriggerCharacter", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "optional": true, + "documentation": "More trigger characters." + } + ], + "documentation": "Provider options for a [DocumentOnTypeFormattingRequest](#DocumentOnTypeFormattingRequest)." + }, + { + "name": "RenameOptions", + "properties": [ + { + "name": "prepareProvider", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Renames should be checked and tested before being executed.\n\n@since version 3.12.0", + "since": "version 3.12.0" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "Provider options for a [RenameRequest](#RenameRequest)." + }, + { + "name": "ExecuteCommandOptions", + "properties": [ + { + "name": "commands", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "documentation": "The commands to be executed on the server" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "documentation": "The server capabilities of a [ExecuteCommandRequest](#ExecuteCommandRequest)." + }, + { + "name": "SemanticTokensLegend", + "properties": [ + { + "name": "tokenTypes", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "documentation": "The token types a server uses." + }, + { + "name": "tokenModifiers", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "documentation": "The token modifiers a server uses." + } + ], + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "OptionalVersionedTextDocumentIdentifier", + "properties": [ + { + "name": "version", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "integer" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "documentation": "The version number of this document. If a versioned text document identifier\nis sent from the server to the client and the file is not open in the editor\n(the server has not received an open notification before) the server can send\n`null` to indicate that the version is unknown and the content on disk is the\ntruth (as specified with document content ownership)." + } + ], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentIdentifier" + } + ], + "documentation": "A text document identifier to optionally denote a specific version of a text document." + }, + { + "name": "AnnotatedTextEdit", + "properties": [ + { + "name": "annotationId", + "type": { + "kind": "reference", + "name": "ChangeAnnotationIdentifier" + }, + "documentation": "The actual identifier of the change annotation" + } + ], + "extends": [ + { + "kind": "reference", + "name": "TextEdit" + } + ], + "documentation": "A special text edit with an additional change annotation.\n\n@since 3.16.0.", + "since": "3.16.0." + }, + { + "name": "ResourceOperation", + "properties": [ + { + "name": "kind", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The resource operation kind." + }, + { + "name": "annotationId", + "type": { + "kind": "reference", + "name": "ChangeAnnotationIdentifier" + }, + "optional": true, + "documentation": "An optional annotation identifier describing the operation.\n\n@since 3.16.0", + "since": "3.16.0" + } + ], + "documentation": "A generic resource operation." + }, + { + "name": "CreateFileOptions", + "properties": [ + { + "name": "overwrite", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Overwrite existing file. Overwrite wins over `ignoreIfExists`" + }, + { + "name": "ignoreIfExists", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Ignore if exists." + } + ], + "documentation": "Options to create a file." + }, + { + "name": "RenameFileOptions", + "properties": [ + { + "name": "overwrite", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Overwrite target if existing. Overwrite wins over `ignoreIfExists`" + }, + { + "name": "ignoreIfExists", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Ignores if target exists." + } + ], + "documentation": "Rename file options" + }, + { + "name": "DeleteFileOptions", + "properties": [ + { + "name": "recursive", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Delete the content recursively if a folder is denoted." + }, + { + "name": "ignoreIfNotExists", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Ignore the operation if the file doesn't exist." + } + ], + "documentation": "Delete file options" + }, + { + "name": "FileOperationPattern", + "properties": [ + { + "name": "glob", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The glob pattern to match. Glob patterns can have the following syntax:\n- `*` to match one or more characters in a path segment\n- `?` to match on one character in a path segment\n- `**` to match any number of path segments, including none\n- `{}` to group sub patterns into an OR expression. (e.g. `**​/*.{ts,js}` matches all TypeScript and JavaScript files)\n- `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)\n- `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)" + }, + { + "name": "matches", + "type": { + "kind": "reference", + "name": "FileOperationPatternKind" + }, + "optional": true, + "documentation": "Whether to match files or folders with this pattern.\n\nMatches both if undefined." + }, + { + "name": "options", + "type": { + "kind": "reference", + "name": "FileOperationPatternOptions" + }, + "optional": true, + "documentation": "Additional options used during matching." + } + ], + "documentation": "A pattern to describe in which file operation requests or notifications\nthe server is interested in receiving.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "WorkspaceFullDocumentDiagnosticReport", + "properties": [ + { + "name": "uri", + "type": { + "kind": "base", + "name": "DocumentUri" + }, + "documentation": "The URI for which diagnostic information is reported." + }, + { + "name": "version", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "integer" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "documentation": "The version number for which the diagnostics are reported.\nIf the document is not marked as open `null` can be provided." + } + ], + "extends": [ + { + "kind": "reference", + "name": "FullDocumentDiagnosticReport" + } + ], + "documentation": "A full document diagnostic report for a workspace diagnostic result.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "WorkspaceUnchangedDocumentDiagnosticReport", + "properties": [ + { + "name": "uri", + "type": { + "kind": "base", + "name": "DocumentUri" + }, + "documentation": "The URI for which diagnostic information is reported." + }, + { + "name": "version", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "integer" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "documentation": "The version number for which the diagnostics are reported.\nIf the document is not marked as open `null` can be provided." + } + ], + "extends": [ + { + "kind": "reference", + "name": "UnchangedDocumentDiagnosticReport" + } + ], + "documentation": "An unchanged document diagnostic report for a workspace diagnostic result.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "LSPObject", + "properties": [], + "documentation": "LSP object definition.\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "NotebookCell", + "properties": [ + { + "name": "kind", + "type": { + "kind": "reference", + "name": "NotebookCellKind" + }, + "documentation": "The cell's kind" + }, + { + "name": "document", + "type": { + "kind": "base", + "name": "DocumentUri" + }, + "documentation": "The URI of the cell's text document\ncontent." + }, + { + "name": "metadata", + "type": { + "kind": "reference", + "name": "LSPObject" + }, + "optional": true, + "documentation": "Additional metadata stored with the cell.\n\nNote: should always be an object literal (e.g. LSPObject)" + }, + { + "name": "executionSummary", + "type": { + "kind": "reference", + "name": "ExecutionSummary" + }, + "optional": true, + "documentation": "Additional execution summary information\nif supported by the client." + } + ], + "documentation": "A notebook cell.\n\nA cell's document URI must be unique across ALL notebook\ncells and can therefore be used to uniquely identify a\nnotebook cell or the cell's text document.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "NotebookCellArrayChange", + "properties": [ + { + "name": "start", + "type": { + "kind": "base", + "name": "uinteger" + }, + "documentation": "The start oftest of the cell that changed." + }, + { + "name": "deleteCount", + "type": { + "kind": "base", + "name": "uinteger" + }, + "documentation": "The deleted cells" + }, + { + "name": "cells", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "NotebookCell" + } + }, + "optional": true, + "documentation": "The new cells, if any" + } + ], + "documentation": "A change describing how to move a `NotebookCell`\narray from state S to S'.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "ClientCapabilities", + "properties": [ + { + "name": "workspace", + "type": { + "kind": "reference", + "name": "WorkspaceClientCapabilities" + }, + "optional": true, + "documentation": "Workspace specific client capabilities." + }, + { + "name": "textDocument", + "type": { + "kind": "reference", + "name": "TextDocumentClientCapabilities" + }, + "optional": true, + "documentation": "Text document specific client capabilities." + }, + { + "name": "notebookDocument", + "type": { + "kind": "reference", + "name": "NotebookDocumentClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the notebook document support.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "window", + "type": { + "kind": "reference", + "name": "WindowClientCapabilities" + }, + "optional": true, + "documentation": "Window specific client capabilities." + }, + { + "name": "general", + "type": { + "kind": "reference", + "name": "GeneralClientCapabilities" + }, + "optional": true, + "documentation": "General client capabilities.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "experimental", + "type": { + "kind": "reference", + "name": "LSPAny" + }, + "optional": true, + "documentation": "Experimental client capabilities." + } + ], + "documentation": "Defines the capabilities provided by the client." + }, + { + "name": "TextDocumentSyncOptions", + "properties": [ + { + "name": "openClose", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Open and close notifications are sent to the server. If omitted open close notification should not\nbe sent." + }, + { + "name": "change", + "type": { + "kind": "reference", + "name": "TextDocumentSyncKind" + }, + "optional": true, + "documentation": "Change notifications are sent to the server. See TextDocumentSyncKind.None, TextDocumentSyncKind.Full\nand TextDocumentSyncKind.Incremental. If omitted it defaults to TextDocumentSyncKind.None." + }, + { + "name": "willSave", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "If present will save notifications are sent to the server. If omitted the notification should not be\nsent." + }, + { + "name": "willSaveWaitUntil", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "If present will save wait until requests are sent to the server. If omitted the request should not be\nsent." + }, + { + "name": "save", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "SaveOptions" + } + ] + }, + "optional": true, + "documentation": "If present save notifications are sent to the server. If omitted the notification should not be\nsent." + } + ] + }, + { + "name": "NotebookDocumentSyncOptions", + "properties": [ + { + "name": "notebookSelector", + "type": { + "kind": "array", + "element": { + "kind": "or", + "items": [ + { + "kind": "literal", + "value": { + "properties": [ + { + "name": "notebook", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "string" + }, + { + "kind": "reference", + "name": "NotebookDocumentFilter" + } + ] + }, + "documentation": "The notebook to be synced If a string\nvalue is provided it matches against the\nnotebook type. '*' matches every notebook." + }, + { + "name": "cells", + "type": { + "kind": "array", + "element": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "language", + "type": { + "kind": "base", + "name": "string" + } + } + ] + } + } + }, + "optional": true, + "documentation": "The cells of the matching notebook to be synced." + } + ] + } + }, + { + "kind": "literal", + "value": { + "properties": [ + { + "name": "notebook", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "string" + }, + { + "kind": "reference", + "name": "NotebookDocumentFilter" + } + ] + }, + "optional": true, + "documentation": "The notebook to be synced If a string\nvalue is provided it matches against the\nnotebook type. '*' matches every notebook." + }, + { + "name": "cells", + "type": { + "kind": "array", + "element": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "language", + "type": { + "kind": "base", + "name": "string" + } + } + ] + } + } + }, + "documentation": "The cells of the matching notebook to be synced." + } + ] + } + } + ] + } + }, + "documentation": "The notebooks to be synced" + }, + { + "name": "save", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether save notification should be forwarded to\nthe server. Will only be honored if mode === `notebook`." + } + ], + "documentation": "Options specific to a notebook plus its cells\nto be synced to the server.\n\nIf a selector provides a notebook document\nfilter but no cell selector all cells of a\nmatching notebook document will be synced.\n\nIf a selector provides no notebook document\nfilter but only a cell selector all notebook\ndocument that contain at least one matching\ncell will be synced.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "NotebookDocumentSyncRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "NotebookDocumentSyncOptions" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "StaticRegistrationOptions" + } + ], + "documentation": "Registration options specific to a notebook.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "WorkspaceFoldersServerCapabilities", + "properties": [ + { + "name": "supported", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The server has support for workspace folders" + }, + { + "name": "changeNotifications", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "string" + }, + { + "kind": "base", + "name": "boolean" + } + ] + }, + "optional": true, + "documentation": "Whether the server wants to receive workspace folder\nchange notifications.\n\nIf a string is provided the string is treated as an ID\nunder which the notification is registered on the client\nside. The ID can be used to unregister for these events\nusing the `client/unregisterCapability` request." + } + ] + }, + { + "name": "FileOperationOptions", + "properties": [ + { + "name": "didCreate", + "type": { + "kind": "reference", + "name": "FileOperationRegistrationOptions" + }, + "optional": true, + "documentation": "The server is interested in receiving didCreateFiles notifications." + }, + { + "name": "willCreate", + "type": { + "kind": "reference", + "name": "FileOperationRegistrationOptions" + }, + "optional": true, + "documentation": "The server is interested in receiving willCreateFiles requests." + }, + { + "name": "didRename", + "type": { + "kind": "reference", + "name": "FileOperationRegistrationOptions" + }, + "optional": true, + "documentation": "The server is interested in receiving didRenameFiles notifications." + }, + { + "name": "willRename", + "type": { + "kind": "reference", + "name": "FileOperationRegistrationOptions" + }, + "optional": true, + "documentation": "The server is interested in receiving willRenameFiles requests." + }, + { + "name": "didDelete", + "type": { + "kind": "reference", + "name": "FileOperationRegistrationOptions" + }, + "optional": true, + "documentation": "The server is interested in receiving didDeleteFiles file notifications." + }, + { + "name": "willDelete", + "type": { + "kind": "reference", + "name": "FileOperationRegistrationOptions" + }, + "optional": true, + "documentation": "The server is interested in receiving willDeleteFiles file requests." + } + ], + "documentation": "Options for notifications/requests for user operations on files.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "T", + "properties": [] + }, + { + "name": "CodeDescription", + "properties": [ + { + "name": "href", + "type": { + "kind": "reference", + "name": "URI" + }, + "documentation": "An URI to open with more information about the diagnostic error." + } + ], + "documentation": "Structure to capture a description for an error code.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "DiagnosticRelatedInformation", + "properties": [ + { + "name": "location", + "type": { + "kind": "reference", + "name": "Location" + }, + "documentation": "The location of this related diagnostic information." + }, + { + "name": "message", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The message of this related diagnostic information." + } + ], + "documentation": "Represents a related message and source code location for a diagnostic. This should be\nused to point to code locations that cause or related to a diagnostics, e.g when duplicating\na symbol in a scope." + }, + { + "name": "ParameterInformation", + "properties": [ + { + "name": "label", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "string" + }, + { + "kind": "tuple", + "items": [ + { + "kind": "base", + "name": "uinteger" + }, + { + "kind": "base", + "name": "uinteger" + } + ] + } + ] + }, + "documentation": "The label of this parameter information.\n\nEither a string or an inclusive start and exclusive end offsets within its containing\nsignature label. (see SignatureInformation.label). The offsets are based on a UTF-16\nstring representation as `Position` and `Range` does.\n\n*Note*: a label of type string should be a substring of its containing signature label.\nIts intended use case is to highlight the parameter label part in the `SignatureInformation.label`." + }, + { + "name": "documentation", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "string" + }, + { + "kind": "reference", + "name": "MarkupContent" + } + ] + }, + "optional": true, + "documentation": "The human-readable doc-comment of this parameter. Will be shown\nin the UI but can be omitted." + } + ], + "documentation": "Represents a parameter of a callable-signature. A parameter can\nhave a label and a doc-comment." + }, + { + "name": "NotebookCellTextDocumentFilter", + "properties": [ + { + "name": "notebook", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "string" + }, + { + "kind": "reference", + "name": "NotebookDocumentFilter" + } + ] + }, + "documentation": "A filter that matches against the notebook\ncontaining the notebook cell. If a string\nvalue is provided it matches against the\nnotebook type. '*' matches every notebook." + }, + { + "name": "language", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A language id like `python`.\n\nWill be matched against the language id of the\nnotebook cell document. '*' matches every language." + } + ], + "documentation": "A notebook cell text document filter denotes a cell text\ndocument by different properties.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "FileOperationPatternOptions", + "properties": [ + { + "name": "ignoreCase", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The pattern should be matched ignoring casing." + } + ], + "documentation": "Matching options for the file operation pattern.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "ExecutionSummary", + "properties": [ + { + "name": "executionOrder", + "type": { + "kind": "base", + "name": "uinteger" + }, + "documentation": "A strict monotonically increasing value\nindicating the execution order of a cell\ninside a notebook." + }, + { + "name": "success", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the execution was successful or\nnot if known by the client." + } + ] + }, + { + "name": "WorkspaceClientCapabilities", + "properties": [ + { + "name": "applyEdit", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports applying batch edits\nto the workspace by supporting the request\n'workspace/applyEdit'" + }, + { + "name": "workspaceEdit", + "type": { + "kind": "reference", + "name": "WorkspaceEditClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to `WorkspaceEdit`s." + }, + { + "name": "didChangeConfiguration", + "type": { + "kind": "reference", + "name": "DidChangeConfigurationClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `workspace/didChangeConfiguration` notification." + }, + { + "name": "didChangeWatchedFiles", + "type": { + "kind": "reference", + "name": "DidChangeWatchedFilesClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `workspace/didChangeWatchedFiles` notification." + }, + { + "name": "symbol", + "type": { + "kind": "reference", + "name": "WorkspaceSymbolClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `workspace/symbol` request." + }, + { + "name": "executeCommand", + "type": { + "kind": "reference", + "name": "ExecuteCommandClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `workspace/executeCommand` request." + }, + { + "name": "workspaceFolders", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client has support for workspace folders.\n\n@since 3.6.0", + "since": "3.6.0" + }, + { + "name": "configuration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports `workspace/configuration` requests.\n\n@since 3.6.0", + "since": "3.6.0" + }, + { + "name": "semanticTokens", + "type": { + "kind": "reference", + "name": "SemanticTokensWorkspaceClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the semantic token requests scoped to the\nworkspace.\n\n@since 3.16.0.", + "since": "3.16.0." + }, + { + "name": "codeLens", + "type": { + "kind": "reference", + "name": "CodeLensWorkspaceClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the code lens requests scoped to the\nworkspace.\n\n@since 3.16.0.", + "since": "3.16.0." + }, + { + "name": "fileOperations", + "type": { + "kind": "reference", + "name": "FileOperationClientCapabilities" + }, + "optional": true, + "documentation": "The client has support for file notifications/requests for user operations on files.\n\nSince 3.16.0" + }, + { + "name": "inlineValue", + "type": { + "kind": "reference", + "name": "InlineValueWorkspaceClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the inline values requests scoped to the\nworkspace.\n\n@since 3.17.0.", + "since": "3.17.0." + }, + { + "name": "inlayHint", + "type": { + "kind": "reference", + "name": "InlayHintWorkspaceClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the inlay hint requests scoped to the\nworkspace.\n\n@since 3.17.0.", + "since": "3.17.0." + }, + { + "name": "diagnostics", + "type": { + "kind": "reference", + "name": "DiagnosticWorkspaceClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the diagnostic requests scoped to the\nworkspace.\n\n@since 3.17.0.", + "since": "3.17.0." + } + ], + "documentation": "Workspace specific client capabilities." + }, + { + "name": "TextDocumentClientCapabilities", + "properties": [ + { + "name": "synchronization", + "type": { + "kind": "reference", + "name": "TextDocumentSyncClientCapabilities" + }, + "optional": true, + "documentation": "Defines which synchronization capabilities the client supports." + }, + { + "name": "completion", + "type": { + "kind": "reference", + "name": "CompletionClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/completion` request." + }, + { + "name": "hover", + "type": { + "kind": "reference", + "name": "HoverClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/hover` request." + }, + { + "name": "signatureHelp", + "type": { + "kind": "reference", + "name": "SignatureHelpClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/signatureHelp` request." + }, + { + "name": "declaration", + "type": { + "kind": "reference", + "name": "DeclarationClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/declaration` request.\n\n@since 3.14.0", + "since": "3.14.0" + }, + { + "name": "definition", + "type": { + "kind": "reference", + "name": "DefinitionClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/definition` request." + }, + { + "name": "typeDefinition", + "type": { + "kind": "reference", + "name": "TypeDefinitionClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/typeDefinition` request.\n\n@since 3.6.0", + "since": "3.6.0" + }, + { + "name": "implementation", + "type": { + "kind": "reference", + "name": "ImplementationClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/implementation` request.\n\n@since 3.6.0", + "since": "3.6.0" + }, + { + "name": "references", + "type": { + "kind": "reference", + "name": "ReferenceClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/references` request." + }, + { + "name": "documentHighlight", + "type": { + "kind": "reference", + "name": "DocumentHighlightClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/documentHighlight` request." + }, + { + "name": "documentSymbol", + "type": { + "kind": "reference", + "name": "DocumentSymbolClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/documentSymbol` request." + }, + { + "name": "codeAction", + "type": { + "kind": "reference", + "name": "CodeActionClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/codeAction` request." + }, + { + "name": "codeLens", + "type": { + "kind": "reference", + "name": "CodeLensClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/codeLens` request." + }, + { + "name": "documentLink", + "type": { + "kind": "reference", + "name": "DocumentLinkClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/documentLink` request." + }, + { + "name": "colorProvider", + "type": { + "kind": "reference", + "name": "DocumentColorClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/documentColor` and the\n`textDocument/colorPresentation` request.\n\n@since 3.6.0", + "since": "3.6.0" + }, + { + "name": "formatting", + "type": { + "kind": "reference", + "name": "DocumentFormattingClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/formatting` request." + }, + { + "name": "rangeFormatting", + "type": { + "kind": "reference", + "name": "DocumentRangeFormattingClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/rangeFormatting` request." + }, + { + "name": "onTypeFormatting", + "type": { + "kind": "reference", + "name": "DocumentOnTypeFormattingClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/onTypeFormatting` request." + }, + { + "name": "rename", + "type": { + "kind": "reference", + "name": "RenameClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/rename` request." + }, + { + "name": "foldingRange", + "type": { + "kind": "reference", + "name": "FoldingRangeClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/foldingRange` request.\n\n@since 3.10.0", + "since": "3.10.0" + }, + { + "name": "selectionRange", + "type": { + "kind": "reference", + "name": "SelectionRangeClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/selectionRange` request.\n\n@since 3.15.0", + "since": "3.15.0" + }, + { + "name": "publishDiagnostics", + "type": { + "kind": "reference", + "name": "PublishDiagnosticsClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/publishDiagnostics` notification." + }, + { + "name": "callHierarchy", + "type": { + "kind": "reference", + "name": "CallHierarchyClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the various call hierarchy requests.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "semanticTokens", + "type": { + "kind": "reference", + "name": "SemanticTokensClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the various semantic token request.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "linkedEditingRange", + "type": { + "kind": "reference", + "name": "LinkedEditingRangeClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/linkedEditingRange` request.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "moniker", + "type": { + "kind": "reference", + "name": "MonikerClientCapabilities" + }, + "optional": true, + "documentation": "Client capabilities specific to the `textDocument/moniker` request.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "typeHierarchy", + "type": { + "kind": "reference", + "name": "TypeHierarchyClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the various type hierarchy requests.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "inlineValue", + "type": { + "kind": "reference", + "name": "InlineValueClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/inlineValue` request.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "inlayHint", + "type": { + "kind": "reference", + "name": "InlayHintClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `textDocument/inlayHint` request.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "diagnostic", + "type": { + "kind": "reference", + "name": "DiagnosticClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the diagnostic pull model.\n\n@since 3.17.0", + "since": "3.17.0" + } + ], + "documentation": "Text document specific client capabilities." + }, + { + "name": "NotebookDocumentClientCapabilities", + "properties": [ + { + "name": "synchronization", + "type": { + "kind": "reference", + "name": "NotebookDocumentSyncClientCapabilities" + }, + "documentation": "Capabilities specific to notebook document synchronization\n\n@since 3.17.0", + "since": "3.17.0" + } + ], + "documentation": "Capabilities specific to the notebook document support.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "WindowClientCapabilities", + "properties": [ + { + "name": "workDoneProgress", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "It indicates whether the client supports server initiated\nprogress using the `window/workDoneProgress/create` request.\n\nThe capability also controls Whether client supports handling\nof progress notifications. If set servers are allowed to report a\n`workDoneProgress` property in the request specific server\ncapabilities.\n\n@since 3.15.0", + "since": "3.15.0" + }, + { + "name": "showMessage", + "type": { + "kind": "reference", + "name": "ShowMessageRequestClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the showMessage request.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "showDocument", + "type": { + "kind": "reference", + "name": "ShowDocumentClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the showDocument request.\n\n@since 3.16.0", + "since": "3.16.0" + } + ] + }, + { + "name": "GeneralClientCapabilities", + "properties": [ + { + "name": "staleRequestSupport", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "cancel", + "type": { + "kind": "base", + "name": "boolean" + }, + "documentation": "The client will actively cancel the request." + }, + { + "name": "retryOnContentModified", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "documentation": "The list of requests for which the client\nwill retry the request if it receives a\nresponse with error code `ContentModified`" + } + ] + } + }, + "optional": true, + "documentation": "Client capability that signals how the client\nhandles stale requests (e.g. a request\nfor which the client will not process the response\nanymore since the information is outdated).\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "regularExpressions", + "type": { + "kind": "reference", + "name": "RegularExpressionsClientCapabilities" + }, + "optional": true, + "documentation": "Client capabilities specific to regular expressions.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "markdown", + "type": { + "kind": "reference", + "name": "MarkdownClientCapabilities" + }, + "optional": true, + "documentation": "Client capabilities specific to the client's markdown parser.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "positionEncodings", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "PositionEncodingKind" + } + }, + "optional": true, + "documentation": "The position encodings supported by the client. Client and server\nhave to agree on the same position encoding to ensure that offsets\n(e.g. character position in a line) are interpreted the same on both\nsides.\n\nTo keep the protocol backwards compatible the following applies: if\nthe value 'utf-16' is missing from the array of position encodings\nservers can assume that the client supports UTF-16. UTF-16 is\ntherefore a mandatory encoding.\n\nIf omitted it defaults to ['utf-16'].\n\nImplementation considerations: since the conversion from one encoding\ninto another requires the content of the file / line the conversion\nis best done where the file is read which is usually on the server\nside.\n\n@since 3.17.0", + "since": "3.17.0" + } + ], + "documentation": "General client capabilities.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "RelativePattern", + "properties": [ + { + "name": "baseUri", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "WorkspaceFolder" + }, + { + "kind": "reference", + "name": "URI" + } + ] + }, + "documentation": "A workspace folder or a base URI to which this pattern will be matched\nagainst relatively." + }, + { + "name": "pattern", + "type": { + "kind": "reference", + "name": "Pattern" + }, + "documentation": "The actual glob pattern;" + } + ], + "documentation": "A relative pattern is a helper to construct glob patterns that are matched\nrelatively to a base URI. The common value for a `baseUri` is a workspace\nfolder root, but it can be another absolute URI as well.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "WorkspaceEditClientCapabilities", + "properties": [ + { + "name": "documentChanges", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports versioned document changes in `WorkspaceEdit`s" + }, + { + "name": "resourceOperations", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "ResourceOperationKind" + } + }, + "optional": true, + "documentation": "The resource operations the client supports. Clients should at least\nsupport 'create', 'rename' and 'delete' files and folders.\n\n@since 3.13.0", + "since": "3.13.0" + }, + { + "name": "failureHandling", + "type": { + "kind": "reference", + "name": "FailureHandlingKind" + }, + "optional": true, + "documentation": "The failure handling strategy of a client if applying the workspace edit\nfails.\n\n@since 3.13.0", + "since": "3.13.0" + }, + { + "name": "normalizesLineEndings", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client normalizes line endings to the client specific\nsetting.\nIf set to `true` the client will normalize line ending characters\nin a workspace edit to the client-specified new line\ncharacter.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "changeAnnotationSupport", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "groupsOnLabel", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client groups edits with equal labels into tree nodes,\nfor instance all edits labelled with \"Changes in Strings\" would\nbe a tree node." + } + ] + } + }, + "optional": true, + "documentation": "Whether the client in general supports change annotations on text edits,\ncreate file, rename file and delete file changes.\n\n@since 3.16.0", + "since": "3.16.0" + } + ] + }, + { + "name": "DidChangeConfigurationClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Did change configuration notification supports dynamic registration." + } + ] + }, + { + "name": "DidChangeWatchedFilesClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Did change watched files notification supports dynamic registration. Please note\nthat the current protocol doesn't support static configuration for file changes\nfrom the server side." + }, + { + "name": "relativePatternSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client has support for {@link RelativePattern relative pattern}\nor not.\n\n@since 3.17.0", + "since": "3.17.0" + } + ] + }, + { + "name": "WorkspaceSymbolClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Symbol request supports dynamic registration." + }, + { + "name": "symbolKind", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "valueSet", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "SymbolKind" + } + }, + "optional": true, + "documentation": "The symbol kind values the client supports. When this\nproperty exists the client also guarantees that it will\nhandle values outside its set gracefully and falls back\nto a default value when unknown.\n\nIf this property is not present the client only supports\nthe symbol kinds from `File` to `Array` as defined in\nthe initial version of the protocol." + } + ] + } + }, + "optional": true, + "documentation": "Specific capabilities for the `SymbolKind` in the `workspace/symbol` request." + }, + { + "name": "tagSupport", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "valueSet", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "SymbolTag" + } + }, + "documentation": "The tags supported by the client." + } + ] + } + }, + "optional": true, + "documentation": "The client supports tags on `SymbolInformation`.\nClients supporting tags have to handle unknown tags gracefully.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "resolveSupport", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "properties", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "documentation": "The properties that a client can resolve lazily. Usually\n`location.range`" + } + ] + } + }, + "optional": true, + "documentation": "The client support partial workspace symbols. The client will send the\nrequest `workspaceSymbol/resolve` to the server to resolve additional\nproperties.\n\n@since 3.17.0", + "since": "3.17.0" + } + ], + "documentation": "Client capabilities for a [WorkspaceSymbolRequest](#WorkspaceSymbolRequest)." + }, + { + "name": "ExecuteCommandClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Execute command supports dynamic registration." + } + ], + "documentation": "The client capabilities of a [ExecuteCommandRequest](#ExecuteCommandRequest)." + }, + { + "name": "SemanticTokensWorkspaceClientCapabilities", + "properties": [ + { + "name": "refreshSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client implementation supports a refresh request sent from\nthe server to the client.\n\nNote that this event is global and will force the client to refresh all\nsemantic tokens currently shown. It should be used with absolute care\nand is useful for situation where a server for example detects a project\nwide change that requires such a calculation." + } + ], + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "CodeLensWorkspaceClientCapabilities", + "properties": [ + { + "name": "refreshSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client implementation supports a refresh request sent from the\nserver to the client.\n\nNote that this event is global and will force the client to refresh all\ncode lenses currently shown. It should be used with absolute care and is\nuseful for situation where a server for example detect a project wide\nchange that requires such a calculation." + } + ], + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "FileOperationClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client supports dynamic registration for file requests/notifications." + }, + { + "name": "didCreate", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client has support for sending didCreateFiles notifications." + }, + { + "name": "willCreate", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client has support for sending willCreateFiles requests." + }, + { + "name": "didRename", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client has support for sending didRenameFiles notifications." + }, + { + "name": "willRename", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client has support for sending willRenameFiles requests." + }, + { + "name": "didDelete", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client has support for sending didDeleteFiles notifications." + }, + { + "name": "willDelete", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client has support for sending willDeleteFiles requests." + } + ], + "documentation": "Capabilities relating to events from file operations by the user in the client.\n\nThese events do not come from the file system, they come from user operations\nlike renaming a file in the UI.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "InlineValueWorkspaceClientCapabilities", + "properties": [ + { + "name": "refreshSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client implementation supports a refresh request sent from the\nserver to the client.\n\nNote that this event is global and will force the client to refresh all\ninline values currently shown. It should be used with absolute care and is\nuseful for situation where a server for example detects a project wide\nchange that requires such a calculation." + } + ], + "documentation": "Client workspace capabilities specific to inline values.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "InlayHintWorkspaceClientCapabilities", + "properties": [ + { + "name": "refreshSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client implementation supports a refresh request sent from\nthe server to the client.\n\nNote that this event is global and will force the client to refresh all\ninlay hints currently shown. It should be used with absolute care and\nis useful for situation where a server for example detects a project wide\nchange that requires such a calculation." + } + ], + "documentation": "Client workspace capabilities specific to inlay hints.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "DiagnosticWorkspaceClientCapabilities", + "properties": [ + { + "name": "refreshSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client implementation supports a refresh request sent from\nthe server to the client.\n\nNote that this event is global and will force the client to refresh all\npulled diagnostics currently shown. It should be used with absolute care and\nis useful for situation where a server for example detects a project wide\nchange that requires such a calculation." + } + ], + "documentation": "Workspace client capabilities specific to diagnostic pull requests.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "TextDocumentSyncClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether text document synchronization supports dynamic registration." + }, + { + "name": "willSave", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports sending will save notifications." + }, + { + "name": "willSaveWaitUntil", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports sending a will save request and\nwaits for a response providing text edits which will\nbe applied to the document before it is saved." + }, + { + "name": "didSave", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports did save notifications." + } + ] + }, + { + "name": "CompletionClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether completion supports dynamic registration." + }, + { + "name": "completionItem", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "snippetSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Client supports snippets as insert text.\n\nA snippet can define tab stops and placeholders with `$1`, `$2`\nand `${3:foo}`. `$0` defines the final tab stop, it defaults to\nthe end of the snippet. Placeholders with equal identifiers are linked,\nthat is typing in one will update others too." + }, + { + "name": "commitCharactersSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Client supports commit characters on a completion item." + }, + { + "name": "documentationFormat", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "MarkupKind" + } + }, + "optional": true, + "documentation": "Client supports the following content formats for the documentation\nproperty. The order describes the preferred format of the client." + }, + { + "name": "deprecatedSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Client supports the deprecated property on a completion item." + }, + { + "name": "preselectSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Client supports the preselect property on a completion item." + }, + { + "name": "tagSupport", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "valueSet", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "CompletionItemTag" + } + }, + "documentation": "The tags supported by the client." + } + ] + } + }, + "optional": true, + "documentation": "Client supports the tag property on a completion item. Clients supporting\ntags have to handle unknown tags gracefully. Clients especially need to\npreserve unknown tags when sending a completion item back to the server in\na resolve call.\n\n@since 3.15.0", + "since": "3.15.0" + }, + { + "name": "insertReplaceSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Client support insert replace edit to control different behavior if a\ncompletion item is inserted in the text or should replace text.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "resolveSupport", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "properties", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "documentation": "The properties that a client can resolve lazily." + } + ] + } + }, + "optional": true, + "documentation": "Indicates which properties a client can resolve lazily on a completion\nitem. Before version 3.16.0 only the predefined properties `documentation`\nand `details` could be resolved lazily.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "insertTextModeSupport", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "valueSet", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "InsertTextMode" + } + } + } + ] + } + }, + "optional": true, + "documentation": "The client supports the `insertTextMode` property on\na completion item to override the whitespace handling mode\nas defined by the client (see `insertTextMode`).\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "labelDetailsSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client has support for completion item label\ndetails (see also `CompletionItemLabelDetails`).\n\n@since 3.17.0", + "since": "3.17.0" + } + ] + } + }, + "optional": true, + "documentation": "The client supports the following `CompletionItem` specific\ncapabilities." + }, + { + "name": "completionItemKind", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "valueSet", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "CompletionItemKind" + } + }, + "optional": true, + "documentation": "The completion item kind values the client supports. When this\nproperty exists the client also guarantees that it will\nhandle values outside its set gracefully and falls back\nto a default value when unknown.\n\nIf this property is not present the client only supports\nthe completion items kinds from `Text` to `Reference` as defined in\nthe initial version of the protocol." + } + ] + } + }, + "optional": true + }, + { + "name": "insertTextMode", + "type": { + "kind": "reference", + "name": "InsertTextMode" + }, + "optional": true, + "documentation": "Defines how the client handles whitespace and indentation\nwhen accepting a completion item that uses multi line\ntext in either `insertText` or `textEdit`.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "contextSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports to send additional context information for a\n`textDocument/completion` request." + }, + { + "name": "completionList", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "itemDefaults", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "optional": true, + "documentation": "The client supports the following itemDefaults on\na completion list.\n\nThe value lists the supported property names of the\n`CompletionList.itemDefaults` object. If omitted\nno properties are supported.\n\n@since 3.17.0", + "since": "3.17.0" + } + ] + } + }, + "optional": true, + "documentation": "The client supports the following `CompletionList` specific\ncapabilities.\n\n@since 3.17.0", + "since": "3.17.0" + } + ], + "documentation": "Completion client capabilities" + }, + { + "name": "HoverClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether hover supports dynamic registration." + }, + { + "name": "contentFormat", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "MarkupKind" + } + }, + "optional": true, + "documentation": "Client supports the following content formats for the content\nproperty. The order describes the preferred format of the client." + } + ] + }, + { + "name": "SignatureHelpClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether signature help supports dynamic registration." + }, + { + "name": "signatureInformation", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "documentationFormat", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "MarkupKind" + } + }, + "optional": true, + "documentation": "Client supports the following content formats for the documentation\nproperty. The order describes the preferred format of the client." + }, + { + "name": "parameterInformation", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "labelOffsetSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports processing label offsets instead of a\nsimple label string.\n\n@since 3.14.0", + "since": "3.14.0" + } + ] + } + }, + "optional": true, + "documentation": "Client capabilities specific to parameter information." + }, + { + "name": "activeParameterSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports the `activeParameter` property on `SignatureInformation`\nliteral.\n\n@since 3.16.0", + "since": "3.16.0" + } + ] + } + }, + "optional": true, + "documentation": "The client supports the following `SignatureInformation`\nspecific properties." + }, + { + "name": "contextSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports to send additional context information for a\n`textDocument/signatureHelp` request. A client that opts into\ncontextSupport will also support the `retriggerCharacters` on\n`SignatureHelpOptions`.\n\n@since 3.15.0", + "since": "3.15.0" + } + ], + "documentation": "Client Capabilities for a [SignatureHelpRequest](#SignatureHelpRequest)." + }, + { + "name": "DeclarationClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether declaration supports dynamic registration. If this is set to `true`\nthe client supports the new `DeclarationRegistrationOptions` return value\nfor the corresponding server capability as well." + }, + { + "name": "linkSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports additional metadata in the form of declaration links." + } + ], + "documentation": "@since 3.14.0", + "since": "3.14.0" + }, + { + "name": "DefinitionClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether definition supports dynamic registration." + }, + { + "name": "linkSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports additional metadata in the form of definition links.\n\n@since 3.14.0", + "since": "3.14.0" + } + ], + "documentation": "Client Capabilities for a [DefinitionRequest](#DefinitionRequest)." + }, + { + "name": "TypeDefinitionClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `TypeDefinitionRegistrationOptions` return value\nfor the corresponding server capability as well." + }, + { + "name": "linkSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports additional metadata in the form of definition links.\n\nSince 3.14.0" + } + ], + "documentation": "Since 3.6.0" + }, + { + "name": "ImplementationClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `ImplementationRegistrationOptions` return value\nfor the corresponding server capability as well." + }, + { + "name": "linkSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports additional metadata in the form of definition links.\n\n@since 3.14.0", + "since": "3.14.0" + } + ], + "documentation": "@since 3.6.0", + "since": "3.6.0" + }, + { + "name": "ReferenceClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether references supports dynamic registration." + } + ], + "documentation": "Client Capabilities for a [ReferencesRequest](#ReferencesRequest)." + }, + { + "name": "DocumentHighlightClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether document highlight supports dynamic registration." + } + ], + "documentation": "Client Capabilities for a [DocumentHighlightRequest](#DocumentHighlightRequest)." + }, + { + "name": "DocumentSymbolClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether document symbol supports dynamic registration." + }, + { + "name": "symbolKind", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "valueSet", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "SymbolKind" + } + }, + "optional": true, + "documentation": "The symbol kind values the client supports. When this\nproperty exists the client also guarantees that it will\nhandle values outside its set gracefully and falls back\nto a default value when unknown.\n\nIf this property is not present the client only supports\nthe symbol kinds from `File` to `Array` as defined in\nthe initial version of the protocol." + } + ] + } + }, + "optional": true, + "documentation": "Specific capabilities for the `SymbolKind` in the\n`textDocument/documentSymbol` request." + }, + { + "name": "hierarchicalDocumentSymbolSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports hierarchical document symbols." + }, + { + "name": "tagSupport", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "valueSet", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "SymbolTag" + } + }, + "documentation": "The tags supported by the client." + } + ] + } + }, + "optional": true, + "documentation": "The client supports tags on `SymbolInformation`. Tags are supported on\n`DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set to true.\nClients supporting tags have to handle unknown tags gracefully.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "labelSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports an additional label presented in the UI when\nregistering a document symbol provider.\n\n@since 3.16.0", + "since": "3.16.0" + } + ], + "documentation": "Client Capabilities for a [DocumentSymbolRequest](#DocumentSymbolRequest)." + }, + { + "name": "CodeActionClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether code action supports dynamic registration." + }, + { + "name": "codeActionLiteralSupport", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "codeActionKind", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "valueSet", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "CodeActionKind" + } + }, + "documentation": "The code action kind values the client supports. When this\nproperty exists the client also guarantees that it will\nhandle values outside its set gracefully and falls back\nto a default value when unknown." + } + ] + } + }, + "documentation": "The code action kind is support with the following value\nset." + } + ] + } + }, + "optional": true, + "documentation": "The client support code action literals of type `CodeAction` as a valid\nresponse of the `textDocument/codeAction` request. If the property is not\nset the request can only return `Command` literals.\n\n@since 3.8.0", + "since": "3.8.0" + }, + { + "name": "isPreferredSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether code action supports the `isPreferred` property.\n\n@since 3.15.0", + "since": "3.15.0" + }, + { + "name": "disabledSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether code action supports the `disabled` property.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "dataSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether code action supports the `data` property which is\npreserved between a `textDocument/codeAction` and a\n`codeAction/resolve` request.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "resolveSupport", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "properties", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "documentation": "The properties that a client can resolve lazily." + } + ] + } + }, + "optional": true, + "documentation": "Whether the client supports resolving additional code action\nproperties via a separate `codeAction/resolve` request.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "honorsChangeAnnotations", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client honors the change annotations in\ntext edits and resource operations returned via the\n`CodeAction#edit` property by for example presenting\nthe workspace edit in the user interface and asking\nfor confirmation.\n\n@since 3.16.0", + "since": "3.16.0" + } + ], + "documentation": "The Client Capabilities of a [CodeActionRequest](#CodeActionRequest)." + }, + { + "name": "CodeLensClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether code lens supports dynamic registration." + } + ], + "documentation": "The client capabilities of a [CodeLensRequest](#CodeLensRequest)." + }, + { + "name": "DocumentLinkClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether document link supports dynamic registration." + }, + { + "name": "tooltipSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client supports the `tooltip` property on `DocumentLink`.\n\n@since 3.15.0", + "since": "3.15.0" + } + ], + "documentation": "The client capabilities of a [DocumentLinkRequest](#DocumentLinkRequest)." + }, + { + "name": "DocumentColorClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `DocumentColorRegistrationOptions` return value\nfor the corresponding server capability as well." + } + ] + }, + { + "name": "DocumentFormattingClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether formatting supports dynamic registration." + } + ], + "documentation": "Client capabilities of a [DocumentFormattingRequest](#DocumentFormattingRequest)." + }, + { + "name": "DocumentRangeFormattingClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether range formatting supports dynamic registration." + } + ], + "documentation": "Client capabilities of a [DocumentRangeFormattingRequest](#DocumentRangeFormattingRequest)." + }, + { + "name": "DocumentOnTypeFormattingClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether on type formatting supports dynamic registration." + } + ], + "documentation": "Client capabilities of a [DocumentOnTypeFormattingRequest](#DocumentOnTypeFormattingRequest)." + }, + { + "name": "RenameClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether rename supports dynamic registration." + }, + { + "name": "prepareSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Client supports testing for validity of rename operations\nbefore execution.\n\n@since 3.12.0", + "since": "3.12.0" + }, + { + "name": "prepareSupportDefaultBehavior", + "type": { + "kind": "reference", + "name": "PrepareSupportDefaultBehavior" + }, + "optional": true, + "documentation": "Client supports the default behavior result.\n\nThe value indicates the default behavior used by the\nclient.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "honorsChangeAnnotations", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client honors the change annotations in\ntext edits and resource operations returned via the\nrename request's workspace edit by for example presenting\nthe workspace edit in the user interface and asking\nfor confirmation.\n\n@since 3.16.0", + "since": "3.16.0" + } + ] + }, + { + "name": "FoldingRangeClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether implementation supports dynamic registration for folding range\nproviders. If this is set to `true` the client supports the new\n`FoldingRangeRegistrationOptions` return value for the corresponding\nserver capability as well." + }, + { + "name": "rangeLimit", + "type": { + "kind": "base", + "name": "uinteger" + }, + "optional": true, + "documentation": "The maximum number of folding ranges that the client prefers to receive\nper document. The value serves as a hint, servers are free to follow the\nlimit." + }, + { + "name": "lineFoldingOnly", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "If set, the client signals that it only supports folding complete lines.\nIf set, client will ignore specified `startCharacter` and `endCharacter`\nproperties in a FoldingRange." + }, + { + "name": "foldingRangeKind", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "valueSet", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "FoldingRangeKind" + } + }, + "optional": true, + "documentation": "The folding range kind values the client supports. When this\nproperty exists the client also guarantees that it will\nhandle values outside its set gracefully and falls back\nto a default value when unknown." + } + ] + } + }, + "optional": true, + "documentation": "Specific options for the folding range kind.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "foldingRange", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "collapsedText", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "If set, the client signals that it supports setting collapsedText on\nfolding ranges to display custom labels instead of the default text.\n\n@since 3.17.0", + "since": "3.17.0" + } + ] + } + }, + "optional": true, + "documentation": "Specific options for the folding range.\n\n@since 3.17.0", + "since": "3.17.0" + } + ] + }, + { + "name": "SelectionRangeClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether implementation supports dynamic registration for selection range providers. If this is set to `true`\nthe client supports the new `SelectionRangeRegistrationOptions` return value for the corresponding server\ncapability as well." + } + ] + }, + { + "name": "PublishDiagnosticsClientCapabilities", + "properties": [ + { + "name": "relatedInformation", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the clients accepts diagnostics with related information." + }, + { + "name": "tagSupport", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "valueSet", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "DiagnosticTag" + } + }, + "documentation": "The tags supported by the client." + } + ] + } + }, + "optional": true, + "documentation": "Client supports the tag property to provide meta data about a diagnostic.\nClients supporting tags have to handle unknown tags gracefully.\n\n@since 3.15.0", + "since": "3.15.0" + }, + { + "name": "versionSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client interprets the version property of the\n`textDocument/publishDiagnostics` notification's parameter.\n\n@since 3.15.0", + "since": "3.15.0" + }, + { + "name": "codeDescriptionSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Client supports a codeDescription property\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "dataSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether code action supports the `data` property which is\npreserved between a `textDocument/publishDiagnostics` and\n`textDocument/codeAction` request.\n\n@since 3.16.0", + "since": "3.16.0" + } + ], + "documentation": "The publish diagnostic client capabilities." + }, + { + "name": "CallHierarchyClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`\nreturn value for the corresponding server capability as well." + } + ], + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "SemanticTokensClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`\nreturn value for the corresponding server capability as well." + }, + { + "name": "requests", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "range", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "literal", + "value": { + "properties": [] + } + } + ] + }, + "optional": true, + "documentation": "The client will send the `textDocument/semanticTokens/range` request if\nthe server provides a corresponding handler." + }, + { + "name": "full", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "literal", + "value": { + "properties": [ + { + "name": "delta", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client will send the `textDocument/semanticTokens/full/delta` request if\nthe server provides a corresponding handler." + } + ] + } + } + ] + }, + "optional": true, + "documentation": "The client will send the `textDocument/semanticTokens/full` request if\nthe server provides a corresponding handler." + } + ] + } + }, + "documentation": "Which requests the client supports and might send to the server\ndepending on the server's capability. Please note that clients might not\nshow semantic tokens or degrade some of the user experience if a range\nor full request is advertised by the client but not provided by the\nserver. If for example the client capability `requests.full` and\n`request.range` are both set to true but the server only provides a\nrange provider the client might not render a minimap correctly or might\neven decide to not show any semantic tokens at all." + }, + { + "name": "tokenTypes", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "documentation": "The token types that the client supports." + }, + { + "name": "tokenModifiers", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "documentation": "The token modifiers that the client supports." + }, + { + "name": "formats", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "TokenFormat" + } + }, + "documentation": "The token formats the clients supports." + }, + { + "name": "overlappingTokenSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client supports tokens that can overlap each other." + }, + { + "name": "multilineTokenSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client supports tokens that can span multiple lines." + }, + { + "name": "serverCancelSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client allows the server to actively cancel a\nsemantic token request, e.g. supports returning\nLSPErrorCodes.ServerCancelled. If a server does the client\nneeds to retrigger the request.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "augmentsSyntaxTokens", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client uses semantic tokens to augment existing\nsyntax tokens. If set to `true` client side created syntax\ntokens and semantic tokens are both used for colorization. If\nset to `false` the client only uses the returned semantic tokens\nfor colorization.\n\nIf the value is `undefined` then the client behavior is not\nspecified.\n\n@since 3.17.0", + "since": "3.17.0" + } + ], + "documentation": "@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "LinkedEditingRangeClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`\nreturn value for the corresponding server capability as well." + } + ], + "documentation": "Client capabilities for the linked editing range request.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "MonikerClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether moniker supports dynamic registration. If this is set to `true`\nthe client supports the new `MonikerRegistrationOptions` return value\nfor the corresponding server capability as well." + } + ], + "documentation": "Client capabilities specific to the moniker request.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "TypeHierarchyClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`\nreturn value for the corresponding server capability as well." + } + ], + "documentation": "@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "InlineValueClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether implementation supports dynamic registration for inline value providers." + } + ], + "documentation": "Client capabilities specific to inline values.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "InlayHintClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether inlay hints support dynamic registration." + }, + { + "name": "resolveSupport", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "properties", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "documentation": "The properties that a client can resolve lazily." + } + ] + } + }, + "optional": true, + "documentation": "Indicates which properties a client can resolve lazily on an inlay\nhint." + } + ], + "documentation": "Inlay hint client capabilities.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "DiagnosticClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`\nreturn value for the corresponding server capability as well." + }, + { + "name": "relatedDocumentSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the clients supports related documents for document diagnostic pulls." + } + ], + "documentation": "Client capabilities specific to diagnostic pull requests.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "NotebookDocumentSyncClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether implementation supports dynamic registration. If this is\nset to `true` the client supports the new\n`(TextDocumentRegistrationOptions & StaticRegistrationOptions)`\nreturn value for the corresponding server capability as well." + }, + { + "name": "executionSummarySupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports sending execution summary data per cell." + } + ], + "documentation": "Notebook specific client capabilities.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "ShowMessageRequestClientCapabilities", + "properties": [ + { + "name": "messageActionItem", + "type": { + "kind": "literal", + "value": { + "properties": [ + { + "name": "additionalPropertiesSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client supports additional attributes which\nare preserved and send back to the server in the\nrequest's response." + } + ] + } + }, + "optional": true, + "documentation": "Capabilities specific to the `MessageActionItem` type." + } + ], + "documentation": "Show message request client capabilities" + }, + { + "name": "ShowDocumentClientCapabilities", + "properties": [ + { + "name": "support", + "type": { + "kind": "base", + "name": "boolean" + }, + "documentation": "The client has support for the showDocument\nrequest." + } + ], + "documentation": "Client capabilities for the showDocument request.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "RegularExpressionsClientCapabilities", + "properties": [ + { + "name": "engine", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The engine's name." + }, + { + "name": "version", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The engine's version." + } + ], + "documentation": "Client capabilities specific to regular expressions.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "MarkdownClientCapabilities", + "properties": [ + { + "name": "parser", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The name of the parser." + }, + { + "name": "version", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The version of the parser." + }, + { + "name": "allowedTags", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "optional": true, + "documentation": "A list of HTML tags that the client allows / supports in\nMarkdown.\n\n@since 3.17.0", + "since": "3.17.0" + } + ], + "documentation": "Client capabilities specific to the used markdown parser.\n\n@since 3.16.0", + "since": "3.16.0" + } + ], + "enumerations": [ + { + "name": "SemanticTokenTypes", + "type": { + "kind": "base", + "name": "string" + }, + "values": [ + { + "name": "namespace", + "value": "namespace" + }, + { + "name": "type", + "value": "type", + "documentation": "Represents a generic type. Acts as a fallback for types which can't be mapped to\na specific type like class or enum." + }, + { + "name": "class", + "value": "class" + }, + { + "name": "enum", + "value": "enum" + }, + { + "name": "interface", + "value": "interface" + }, + { + "name": "struct", + "value": "struct" + }, + { + "name": "typeParameter", + "value": "typeParameter" + }, + { + "name": "parameter", + "value": "parameter" + }, + { + "name": "variable", + "value": "variable" + }, + { + "name": "property", + "value": "property" + }, + { + "name": "enumMember", + "value": "enumMember" + }, + { + "name": "event", + "value": "event" + }, + { + "name": "function", + "value": "function" + }, + { + "name": "method", + "value": "method" + }, + { + "name": "macro", + "value": "macro" + }, + { + "name": "keyword", + "value": "keyword" + }, + { + "name": "modifier", + "value": "modifier" + }, + { + "name": "comment", + "value": "comment" + }, + { + "name": "string", + "value": "string" + }, + { + "name": "number", + "value": "number" + }, + { + "name": "regexp", + "value": "regexp" + }, + { + "name": "operator", + "value": "operator" + }, + { + "name": "decorator", + "value": "decorator", + "documentation": "@since 3.17.0", + "since": "3.17.0" + } + ], + "documentation": "A set of predefined token types. This set is not fixed\nan clients can specify additional token types via the\ncorresponding client capabilities.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "SemanticTokenModifiers", + "type": { + "kind": "base", + "name": "string" + }, + "values": [ + { + "name": "declaration", + "value": "declaration" + }, + { + "name": "definition", + "value": "definition" + }, + { + "name": "readonly", + "value": "readonly" + }, + { + "name": "static", + "value": "static" + }, + { + "name": "deprecated", + "value": "deprecated" + }, + { + "name": "abstract", + "value": "abstract" + }, + { + "name": "async", + "value": "async" + }, + { + "name": "modification", + "value": "modification" + }, + { + "name": "documentation", + "value": "documentation" + }, + { + "name": "defaultLibrary", + "value": "defaultLibrary" + } + ], + "documentation": "A set of predefined token modifiers. This set is not fixed\nan clients can specify additional token types via the\ncorresponding client capabilities.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "ErrorCodes", + "type": { + "kind": "base", + "name": "integer" + }, + "values": [ + { + "name": "ParseError", + "value": -32700 + }, + { + "name": "InvalidRequest", + "value": -32600 + }, + { + "name": "MethodNotFound", + "value": -32601 + }, + { + "name": "InvalidParams", + "value": -32602 + }, + { + "name": "InternalError", + "value": -32603 + }, + { + "name": "jsonrpcReservedErrorRangeStart", + "value": -32099, + "documentation": "This is the start range of JSON RPC reserved error codes.\nIt doesn't denote a real error code. No application error codes should\nbe defined between the start and end range. For backwards\ncompatibility the `ServerNotInitialized` and the `UnknownErrorCode`\nare left in the range.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "serverErrorStart", + "value": -32099, + "documentation": "@deprecated use jsonrpcReservedErrorRangeStart */" + }, + { + "name": "ServerNotInitialized", + "value": -32002, + "documentation": "Error code indicating that a server received a notification or\nrequest before the server has received the `initialize` request." + }, + { + "name": "UnknownErrorCode", + "value": -32001 + }, + { + "name": "jsonrpcReservedErrorRangeEnd", + "value": -32000, + "documentation": "This is the end range of JSON RPC reserved error codes.\nIt doesn't denote a real error code.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "serverErrorEnd", + "value": -32000, + "documentation": "@deprecated use jsonrpcReservedErrorRangeEnd */" + } + ], + "supportsCustomValues": true, + "documentation": "Predefined error codes." + }, + { + "name": "LSPErrorCodes", + "type": { + "kind": "base", + "name": "integer" + }, + "values": [ + { + "name": "lspReservedErrorRangeStart", + "value": -32899, + "documentation": "This is the start range of LSP reserved error codes.\nIt doesn't denote a real error code.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "RequestFailed", + "value": -32803, + "documentation": "A request failed but it was syntactically correct, e.g the\nmethod name was known and the parameters were valid. The error\nmessage should contain human readable information about why\nthe request failed.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "ServerCancelled", + "value": -32802, + "documentation": "The server cancelled the request. This error code should\nonly be used for requests that explicitly support being\nserver cancellable.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "ContentModified", + "value": -32801, + "documentation": "The server detected that the content of a document got\nmodified outside normal conditions. A server should\nNOT send this error code if it detects a content change\nin it unprocessed messages. The result even computed\non an older state might still be useful for the client.\n\nIf a client decides that a result is not of any use anymore\nthe client should cancel the request." + }, + { + "name": "RequestCancelled", + "value": -32800, + "documentation": "The client has canceled a request and a server as detected\nthe cancel." + }, + { + "name": "lspReservedErrorRangeEnd", + "value": -32800, + "documentation": "This is the end range of LSP reserved error codes.\nIt doesn't denote a real error code.\n\n@since 3.16.0", + "since": "3.16.0" + } + ], + "supportsCustomValues": true + }, + { + "name": "FoldingRangeKind", + "type": { + "kind": "base", + "name": "string" + }, + "values": [ + { + "name": "Comment", + "value": "comment", + "documentation": "Folding range for a comment" + }, + { + "name": "Imports", + "value": "imports", + "documentation": "Folding range for an import or include" + }, + { + "name": "Region", + "value": "region", + "documentation": "Folding range for a region (e.g. `#region`)" + } + ], + "supportsCustomValues": true, + "documentation": "A set of predefined range kinds." + }, + { + "name": "SymbolKind", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "File", + "value": 1 + }, + { + "name": "Module", + "value": 2 + }, + { + "name": "Namespace", + "value": 3 + }, + { + "name": "Package", + "value": 4 + }, + { + "name": "Class", + "value": 5 + }, + { + "name": "Method", + "value": 6 + }, + { + "name": "Property", + "value": 7 + }, + { + "name": "Field", + "value": 8 + }, + { + "name": "Constructor", + "value": 9 + }, + { + "name": "Enum", + "value": 10 + }, + { + "name": "Interface", + "value": 11 + }, + { + "name": "Function", + "value": 12 + }, + { + "name": "Variable", + "value": 13 + }, + { + "name": "Constant", + "value": 14 + }, + { + "name": "String", + "value": 15 + }, + { + "name": "Number", + "value": 16 + }, + { + "name": "Boolean", + "value": 17 + }, + { + "name": "Array", + "value": 18 + }, + { + "name": "Object", + "value": 19 + }, + { + "name": "Key", + "value": 20 + }, + { + "name": "Null", + "value": 21 + }, + { + "name": "EnumMember", + "value": 22 + }, + { + "name": "Struct", + "value": 23 + }, + { + "name": "Event", + "value": 24 + }, + { + "name": "Operator", + "value": 25 + }, + { + "name": "TypeParameter", + "value": 26 + } + ], + "documentation": "A symbol kind." + }, + { + "name": "SymbolTag", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "Deprecated", + "value": 1, + "documentation": "Render a symbol as obsolete, usually using a strike-out." + } + ], + "documentation": "Symbol tags are extra annotations that tweak the rendering of a symbol.\n\n@since 3.16", + "since": "3.16" + }, + { + "name": "UniquenessLevel", + "type": { + "kind": "base", + "name": "string" + }, + "values": [ + { + "name": "document", + "value": "document", + "documentation": "The moniker is only unique inside a document" + }, + { + "name": "project", + "value": "project", + "documentation": "The moniker is unique inside a project for which a dump got created" + }, + { + "name": "group", + "value": "group", + "documentation": "The moniker is unique inside the group to which a project belongs" + }, + { + "name": "scheme", + "value": "scheme", + "documentation": "The moniker is unique inside the moniker scheme." + }, + { + "name": "global", + "value": "global", + "documentation": "The moniker is globally unique" + } + ], + "documentation": "Moniker uniqueness level to define scope of the moniker.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "MonikerKind", + "type": { + "kind": "base", + "name": "string" + }, + "values": [ + { + "name": "import", + "value": "import", + "documentation": "The moniker represent a symbol that is imported into a project" + }, + { + "name": "export", + "value": "export", + "documentation": "The moniker represents a symbol that is exported from a project" + }, + { + "name": "local", + "value": "local", + "documentation": "The moniker represents a symbol that is local to a project (e.g. a local\nvariable of a function, a class not visible outside the project, ...)" + } + ], + "documentation": "The moniker kind.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "InlayHintKind", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "Type", + "value": 1, + "documentation": "An inlay hint that for a type annotation." + }, + { + "name": "Parameter", + "value": 2, + "documentation": "An inlay hint that is for a parameter." + } + ], + "documentation": "Inlay hint kinds.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "MessageType", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "Error", + "value": 1, + "documentation": "An error message." + }, + { + "name": "Warning", + "value": 2, + "documentation": "A warning message." + }, + { + "name": "Info", + "value": 3, + "documentation": "An information message." + }, + { + "name": "Log", + "value": 4, + "documentation": "A log message." + } + ], + "documentation": "The message type" + }, + { + "name": "TextDocumentSyncKind", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "None", + "value": 0, + "documentation": "Documents should not be synced at all." + }, + { + "name": "Full", + "value": 1, + "documentation": "Documents are synced by always sending the full content\nof the document." + }, + { + "name": "Incremental", + "value": 2, + "documentation": "Documents are synced by sending the full content on open.\nAfter that only incremental updates to the document are\nsend." + } + ], + "documentation": "Defines how the host (editor) should sync\ndocument changes to the language server." + }, + { + "name": "TextDocumentSaveReason", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "Manual", + "value": 1, + "documentation": "Manually triggered, e.g. by the user pressing save, by starting debugging,\nor by an API call." + }, + { + "name": "AfterDelay", + "value": 2, + "documentation": "Automatic after a delay." + }, + { + "name": "FocusOut", + "value": 3, + "documentation": "When the editor lost focus." + } + ], + "documentation": "Represents reasons why a text document is saved." + }, + { + "name": "CompletionItemKind", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "Text", + "value": 1 + }, + { + "name": "Method", + "value": 2 + }, + { + "name": "Function", + "value": 3 + }, + { + "name": "Constructor", + "value": 4 + }, + { + "name": "Field", + "value": 5 + }, + { + "name": "Variable", + "value": 6 + }, + { + "name": "Class", + "value": 7 + }, + { + "name": "Interface", + "value": 8 + }, + { + "name": "Module", + "value": 9 + }, + { + "name": "Property", + "value": 10 + }, + { + "name": "Unit", + "value": 11 + }, + { + "name": "Value", + "value": 12 + }, + { + "name": "Enum", + "value": 13 + }, + { + "name": "Keyword", + "value": 14 + }, + { + "name": "Snippet", + "value": 15 + }, + { + "name": "Color", + "value": 16 + }, + { + "name": "File", + "value": 17 + }, + { + "name": "Reference", + "value": 18 + }, + { + "name": "Folder", + "value": 19 + }, + { + "name": "EnumMember", + "value": 20 + }, + { + "name": "Constant", + "value": 21 + }, + { + "name": "Struct", + "value": 22 + }, + { + "name": "Event", + "value": 23 + }, + { + "name": "Operator", + "value": 24 + }, + { + "name": "TypeParameter", + "value": 25 + } + ], + "documentation": "The kind of a completion entry." + }, + { + "name": "CompletionItemTag", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "Deprecated", + "value": 1, + "documentation": "Render a completion as obsolete, usually using a strike-out." + } + ], + "documentation": "Completion item tags are extra annotations that tweak the rendering of a completion\nitem.\n\n@since 3.15.0", + "since": "3.15.0" + }, + { + "name": "InsertTextFormat", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "PlainText", + "value": 1, + "documentation": "The primary text to be inserted is treated as a plain string." + }, + { + "name": "Snippet", + "value": 2, + "documentation": "The primary text to be inserted is treated as a snippet.\n\nA snippet can define tab stops and placeholders with `$1`, `$2`\nand `${3:foo}`. `$0` defines the final tab stop, it defaults to\nthe end of the snippet. Placeholders with equal identifiers are linked,\nthat is typing in one will update others too.\n\nSee also: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#snippet_syntax" + } + ], + "documentation": "Defines whether the insert text in a completion item should be interpreted as\nplain text or a snippet." + }, + { + "name": "InsertTextMode", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "asIs", + "value": 1, + "documentation": "The insertion or replace strings is taken as it is. If the\nvalue is multi line the lines below the cursor will be\ninserted using the indentation defined in the string value.\nThe client will not apply any kind of adjustments to the\nstring." + }, + { + "name": "adjustIndentation", + "value": 2, + "documentation": "The editor adjusts leading whitespace of new lines so that\nthey match the indentation up to the cursor of the line for\nwhich the item is accepted.\n\nConsider a line like this: <2tabs><3tabs>foo. Accepting a\nmulti line completion item is indented using 2 tabs and all\nfollowing lines inserted will be indented using 2 tabs as well." + } + ], + "documentation": "How whitespace and indentation is handled during completion\nitem insertion.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "DocumentHighlightKind", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "Text", + "value": 1, + "documentation": "A textual occurrence." + }, + { + "name": "Read", + "value": 2, + "documentation": "Read-access of a symbol, like reading a variable." + }, + { + "name": "Write", + "value": 3, + "documentation": "Write-access of a symbol, like writing to a variable." + } + ], + "documentation": "A document highlight kind." + }, + { + "name": "CodeActionKind", + "type": { + "kind": "base", + "name": "string" + }, + "values": [ + { + "name": "Empty", + "value": "", + "documentation": "Empty kind." + }, + { + "name": "QuickFix", + "value": "quickfix", + "documentation": "Base kind for quickfix actions: 'quickfix'" + }, + { + "name": "Refactor", + "value": "refactor", + "documentation": "Base kind for refactoring actions: 'refactor'" + }, + { + "name": "RefactorExtract", + "value": "refactor.extract", + "documentation": "Base kind for refactoring extraction actions: 'refactor.extract'\n\nExample extract actions:\n\n- Extract method\n- Extract function\n- Extract variable\n- Extract interface from class\n- ..." + }, + { + "name": "RefactorInline", + "value": "refactor.inline", + "documentation": "Base kind for refactoring inline actions: 'refactor.inline'\n\nExample inline actions:\n\n- Inline function\n- Inline variable\n- Inline constant\n- ..." + }, + { + "name": "RefactorRewrite", + "value": "refactor.rewrite", + "documentation": "Base kind for refactoring rewrite actions: 'refactor.rewrite'\n\nExample rewrite actions:\n\n- Convert JavaScript function to class\n- Add or remove parameter\n- Encapsulate field\n- Make method static\n- Move method to base class\n- ..." + }, + { + "name": "Source", + "value": "source", + "documentation": "Base kind for source actions: `source`\n\nSource code actions apply to the entire file." + }, + { + "name": "SourceOrganizeImports", + "value": "source.organizeImports", + "documentation": "Base kind for an organize imports source action: `source.organizeImports`" + }, + { + "name": "SourceFixAll", + "value": "source.fixAll", + "documentation": "Base kind for auto-fix source actions: `source.fixAll`.\n\nFix all actions automatically fix errors that have a clear fix that do not require user input.\nThey should not suppress errors or perform unsafe fixes such as generating new types or classes.\n\n@since 3.15.0", + "since": "3.15.0" + } + ], + "supportsCustomValues": true, + "documentation": "A set of predefined code action kinds" + }, + { + "name": "TraceValues", + "type": { + "kind": "base", + "name": "string" + }, + "values": [ + { + "name": "Off", + "value": "off", + "documentation": "Turn tracing off." + }, + { + "name": "Messages", + "value": "messages", + "documentation": "Trace messages only." + }, + { + "name": "Verbose", + "value": "verbose", + "documentation": "Verbose message tracing." + } + ] + }, + { + "name": "MarkupKind", + "type": { + "kind": "base", + "name": "string" + }, + "values": [ + { + "name": "PlainText", + "value": "plaintext", + "documentation": "Plain text is supported as a content format" + }, + { + "name": "Markdown", + "value": "markdown", + "documentation": "Markdown is supported as a content format" + } + ], + "documentation": "Describes the content type that a client supports in various\nresult literals like `Hover`, `ParameterInfo` or `CompletionItem`.\n\nPlease note that `MarkupKinds` must not start with a `$`. This kinds\nare reserved for internal usage." + }, + { + "name": "PositionEncodingKind", + "type": { + "kind": "base", + "name": "string" + }, + "values": [ + { + "name": "UTF8", + "value": "utf-8", + "documentation": "Character offsets count UTF-8 code units." + }, + { + "name": "UTF16", + "value": "utf-16", + "documentation": "Character offsets count UTF-16 code units.\n\nThis is the default and must always be supported\nby servers" + }, + { + "name": "UTF32", + "value": "utf-32", + "documentation": "Character offsets count UTF-32 code units.\n\nImplementation note: these are the same as Unicode code points,\nso this `PositionEncodingKind` may also be used for an\nencoding-agnostic representation of character offsets." + } + ], + "supportsCustomValues": true, + "documentation": "A set of predefined position encoding kinds.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "FileChangeType", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "Created", + "value": 1, + "documentation": "The file got created." + }, + { + "name": "Changed", + "value": 2, + "documentation": "The file got changed." + }, + { + "name": "Deleted", + "value": 3, + "documentation": "The file got deleted." + } + ], + "documentation": "The file event type" + }, + { + "name": "WatchKind", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "Create", + "value": 1, + "documentation": "Interested in create events." + }, + { + "name": "Change", + "value": 2, + "documentation": "Interested in change events" + }, + { + "name": "Delete", + "value": 4, + "documentation": "Interested in delete events" + } + ], + "supportsCustomValues": true + }, + { + "name": "DiagnosticSeverity", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "Error", + "value": 1, + "documentation": "Reports an error." + }, + { + "name": "Warning", + "value": 2, + "documentation": "Reports a warning." + }, + { + "name": "Information", + "value": 3, + "documentation": "Reports an information." + }, + { + "name": "Hint", + "value": 4, + "documentation": "Reports a hint." + } + ], + "documentation": "The diagnostic's severity." + }, + { + "name": "DiagnosticTag", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "Unnecessary", + "value": 1, + "documentation": "Unused or unnecessary code.\n\nClients are allowed to render diagnostics with this tag faded out instead of having\nan error squiggle." + }, + { + "name": "Deprecated", + "value": 2, + "documentation": "Deprecated or obsolete code.\n\nClients are allowed to rendered diagnostics with this tag strike through." + } + ], + "documentation": "The diagnostic tags.\n\n@since 3.15.0", + "since": "3.15.0" + }, + { + "name": "CompletionTriggerKind", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "Invoked", + "value": 1, + "documentation": "Completion was triggered by typing an identifier (24x7 code\ncomplete), manual invocation (e.g Ctrl+Space) or via API." + }, + { + "name": "TriggerCharacter", + "value": 2, + "documentation": "Completion was triggered by a trigger character specified by\nthe `triggerCharacters` properties of the `CompletionRegistrationOptions`." + }, + { + "name": "TriggerForIncompleteCompletions", + "value": 3, + "documentation": "Completion was re-triggered as current completion list is incomplete" + } + ], + "documentation": "How a completion was triggered" + }, + { + "name": "SignatureHelpTriggerKind", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "Invoked", + "value": 1, + "documentation": "Signature help was invoked manually by the user or by a command." + }, + { + "name": "TriggerCharacter", + "value": 2, + "documentation": "Signature help was triggered by a trigger character." + }, + { + "name": "ContentChange", + "value": 3, + "documentation": "Signature help was triggered by the cursor moving or by the document content changing." + } + ], + "documentation": "How a signature help was triggered.\n\n@since 3.15.0", + "since": "3.15.0" + }, + { + "name": "CodeActionTriggerKind", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "Invoked", + "value": 1, + "documentation": "Code actions were explicitly requested by the user or by an extension." + }, + { + "name": "Automatic", + "value": 2, + "documentation": "Code actions were requested automatically.\n\nThis typically happens when current selection in a file changes, but can\nalso be triggered when file content changes." + } + ], + "documentation": "The reason why code actions were requested.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "FileOperationPatternKind", + "type": { + "kind": "base", + "name": "string" + }, + "values": [ + { + "name": "file", + "value": "file", + "documentation": "The pattern matches a file only." + }, + { + "name": "folder", + "value": "folder", + "documentation": "The pattern matches a folder only." + } + ], + "documentation": "A pattern kind describing if a glob pattern matches a file a folder or\nboth.\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "NotebookCellKind", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "Markup", + "value": 1, + "documentation": "A markup-cell is formatted source that is used for display." + }, + { + "name": "Code", + "value": 2, + "documentation": "A code-cell is source code." + } + ], + "documentation": "A notebook cell kind.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "ResourceOperationKind", + "type": { + "kind": "base", + "name": "string" + }, + "values": [ + { + "name": "Create", + "value": "create", + "documentation": "Supports creating new files and folders." + }, + { + "name": "Rename", + "value": "rename", + "documentation": "Supports renaming existing files and folders." + }, + { + "name": "Delete", + "value": "delete", + "documentation": "Supports deleting existing files and folders." + } + ] + }, + { + "name": "FailureHandlingKind", + "type": { + "kind": "base", + "name": "string" + }, + "values": [ + { + "name": "Abort", + "value": "abort", + "documentation": "Applying the workspace change is simply aborted if one of the changes provided\nfails. All operations executed before the failing operation stay executed." + }, + { + "name": "Transactional", + "value": "transactional", + "documentation": "All operations are executed transactional. That means they either all\nsucceed or no changes at all are applied to the workspace." + }, + { + "name": "TextOnlyTransactional", + "value": "textOnlyTransactional", + "documentation": "If the workspace edit contains only textual file changes they are executed transactional.\nIf resource changes (create, rename or delete file) are part of the change the failure\nhandling strategy is abort." + }, + { + "name": "Undo", + "value": "undo", + "documentation": "The client tries to undo the operations already executed. But there is no\nguarantee that this is succeeding." + } + ] + }, + { + "name": "PrepareSupportDefaultBehavior", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "Identifier", + "value": 1, + "documentation": "The client's default behavior is to select the identifier\naccording the to language's syntax rule." + } + ] + }, + { + "name": "TokenFormat", + "type": { + "kind": "base", + "name": "string" + }, + "values": [ + { + "name": "Relative", + "value": "relative" + } + ] + } + ], + "typeAliases": [ + { + "name": "Definition", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "Location" + }, + { + "kind": "array", + "element": { + "kind": "reference", + "name": "Location" + } + } + ] + }, + "documentation": "The definition of a symbol represented as one or many [locations](#Location).\nFor most programming languages there is only one location at which a symbol is\ndefined.\n\nServers should prefer returning `DefinitionLink` over `Definition` if supported\nby the client." + }, + { + "name": "DefinitionLink", + "type": { + "kind": "reference", + "name": "LocationLink" + }, + "documentation": "Information about where a symbol is defined.\n\nProvides additional metadata over normal [location](#Location) definitions, including the range of\nthe defining symbol" + }, + { + "name": "LSPArray", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "LSPAny" + } + }, + "documentation": "LSP arrays.\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "LSPAny", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "LSPObject" + }, + { + "kind": "reference", + "name": "LSPArray" + }, + { + "kind": "base", + "name": "string" + }, + { + "kind": "base", + "name": "integer" + }, + { + "kind": "base", + "name": "uinteger" + }, + { + "kind": "base", + "name": "decimal" + }, + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "documentation": "The LSP any type.\nPlease note that strictly speaking a property with the value `undefined`\ncan't be converted into JSON preserving the property name. However for\nconvenience it is allowed and assumed that all these properties are\noptional as well.\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "Declaration", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "Location" + }, + { + "kind": "array", + "element": { + "kind": "reference", + "name": "Location" + } + } + ] + }, + "documentation": "The declaration of a symbol representation as one or many [locations](#Location)." + }, + { + "name": "DeclarationLink", + "type": { + "kind": "reference", + "name": "LocationLink" + }, + "documentation": "Information about where a symbol is declared.\n\nProvides additional metadata over normal [location](#Location) declarations, including the range of\nthe declaring symbol.\n\nServers should prefer returning `DeclarationLink` over `Declaration` if supported\nby the client." + }, + { + "name": "InlineValue", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "InlineValueText" + }, + { + "kind": "reference", + "name": "InlineValueVariableLookup" + }, + { + "kind": "reference", + "name": "InlineValueEvaluatableExpression" + } + ] + }, + "documentation": "Inline value information can be provided by different means:\n- directly as a text value (class InlineValueText).\n- as a name to use for a variable lookup (class InlineValueVariableLookup)\n- as an evaluatable expression (class InlineValueEvaluatableExpression)\nThe InlineValue types combines all inline value types into one type.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "DocumentDiagnosticReport", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "RelatedFullDocumentDiagnosticReport" + }, + { + "kind": "reference", + "name": "RelatedUnchangedDocumentDiagnosticReport" + } + ] + }, + "documentation": "The result of a document diagnostic pull request. A report can\neither be a full report containing all diagnostics for the\nrequested document or an unchanged report indicating that nothing\nhas changed in terms of diagnostics in comparison to the last\npull request.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "PrepareRenameResult", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "Range" + }, + { + "kind": "literal", + "value": { + "properties": [ + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + } + }, + { + "name": "placeholder", + "type": { + "kind": "base", + "name": "string" + } + } + ] + } + }, + { + "kind": "literal", + "value": { + "properties": [ + { + "name": "defaultBehavior", + "type": { + "kind": "base", + "name": "boolean" + } + } + ] + } + } + ] + } + }, + { + "name": "URI", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A tagging type for string properties that are actually URIs\n\n@since 3.16.0", + "since": "3.16.0" + }, + { + "name": "ProgressToken", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "integer" + }, + { + "kind": "base", + "name": "string" + } + ] + } + }, + { + "name": "DocumentSelector", + "type": { + "kind": "array", + "element": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "string" + }, + { + "kind": "reference", + "name": "DocumentFilter" + } + ] + } + }, + "documentation": "A document selector is the combination of one or many document filters.\n\n@sample `let sel:DocumentSelector = [{ language: 'typescript' }, { language: 'json', pattern: '**∕tsconfig.json' }]`;\n\nThe use of a string as a document filter is deprecated @since 3.16.0.", + "since": "3.16.0." + }, + { + "name": "ChangeAnnotationIdentifier", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "An identifier to refer to a change annotation stored with a workspace edit." + }, + { + "name": "WorkspaceDocumentDiagnosticReport", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "WorkspaceFullDocumentDiagnosticReport" + }, + { + "kind": "reference", + "name": "WorkspaceUnchangedDocumentDiagnosticReport" + } + ] + }, + "documentation": "A workspace diagnostic document report.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "TextDocumentContentChangeEvent", + "type": { + "kind": "or", + "items": [ + { + "kind": "literal", + "value": { + "properties": [ + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range of the document that changed." + }, + { + "name": "rangeLength", + "type": { + "kind": "base", + "name": "uinteger" + }, + "optional": true, + "documentation": "The optional length of the range that got replaced.\n\n@deprecated use range instead." + }, + { + "name": "text", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The new text for the provided range." + } + ] + } + }, + { + "kind": "literal", + "value": { + "properties": [ + { + "name": "text", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The new text of the whole document." + } + ] + } + } + ] + }, + "documentation": "An event describing a change to a text document. If only a text is provided\nit is considered to be the full content of the document." + }, + { + "name": "MarkedString", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "string" + }, + { + "kind": "literal", + "value": { + "properties": [ + { + "name": "language", + "type": { + "kind": "base", + "name": "string" + } + }, + { + "name": "value", + "type": { + "kind": "base", + "name": "string" + } + } + ] + } + } + ] + }, + "documentation": "MarkedString can be used to render human readable text. It is either a markdown string\nor a code-block that provides a language and a code snippet. The language identifier\nis semantically equal to the optional language identifier in fenced code blocks in GitHub\nissues. See https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting\n\nThe pair of a language and a value is an equivalent to markdown:\n```${language}\n${value}\n```\n\nNote that markdown strings will be sanitized - that means html will be escaped.\n@deprecated use MarkupContent instead." + }, + { + "name": "DocumentFilter", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "TextDocumentFilter" + }, + { + "kind": "reference", + "name": "NotebookCellTextDocumentFilter" + } + ] + }, + "documentation": "A document filter describes a top level text document or\na notebook cell document.\n\n@since 3.17.0 - proposed support for NotebookCellTextDocumentFilter.", + "since": "3.17.0 - proposed support for NotebookCellTextDocumentFilter." + }, + { + "name": "GlobPattern", + "type": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "Pattern" + }, + { + "kind": "reference", + "name": "RelativePattern" + } + ] + }, + "documentation": "The glob pattern. Either a string pattern or a relative pattern.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "TextDocumentFilter", + "type": { + "kind": "or", + "items": [ + { + "kind": "literal", + "value": { + "properties": [ + { + "name": "language", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A language id, like `typescript`. */" + }, + { + "name": "scheme", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A Uri [scheme](#Uri.scheme), like `file` or `untitled`. */" + }, + { + "name": "pattern", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A glob pattern, like `*.{ts,js}`. */" + } + ] + } + }, + { + "kind": "literal", + "value": { + "properties": [ + { + "name": "language", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A language id, like `typescript`. */" + }, + { + "name": "scheme", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A Uri [scheme](#Uri.scheme), like `file` or `untitled`. */" + }, + { + "name": "pattern", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A glob pattern, like `*.{ts,js}`. */" + } + ] + } + }, + { + "kind": "literal", + "value": { + "properties": [ + { + "name": "language", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A language id, like `typescript`. */" + }, + { + "name": "scheme", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A Uri [scheme](#Uri.scheme), like `file` or `untitled`. */" + }, + { + "name": "pattern", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A glob pattern, like `*.{ts,js}`. */" + } + ] + } + } + ] + }, + "documentation": "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 sub patterns into an OR expression. (e.g. `**​/*.{ts,js}` matches all TypeScript and JavaScript files)\n- `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)\n- `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)\n\n@sample A language filter that applies to typescript files on disk: `{ language: 'typescript', scheme: 'file' }`\n@sample A language filter that applies to all package.json paths: `{ language: 'json', pattern: '**package.json' }`\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "NotebookDocumentFilter", + "type": { + "kind": "or", + "items": [ + { + "kind": "literal", + "value": { + "properties": [ + { + "name": "notebookType", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The type of the enclosing notebook. */" + }, + { + "name": "scheme", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A Uri [scheme](#Uri.scheme), like `file` or `untitled`. */" + }, + { + "name": "pattern", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A glob pattern. */" + } + ] + } + }, + { + "kind": "literal", + "value": { + "properties": [ + { + "name": "notebookType", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The type of the enclosing notebook. */" + }, + { + "name": "scheme", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A Uri [scheme](#Uri.scheme), like `file` or `untitled`.*/" + }, + { + "name": "pattern", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A glob pattern. */" + } + ] + } + }, + { + "kind": "literal", + "value": { + "properties": [ + { + "name": "notebookType", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The type of the enclosing notebook. */" + }, + { + "name": "scheme", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A Uri [scheme](#Uri.scheme), like `file` or `untitled`. */" + }, + { + "name": "pattern", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A glob pattern. */" + } + ] + } + } + ] + }, + "documentation": "A notebook document filter denotes a notebook document by\ndifferent properties. The properties will be match\nagainst the notebook's URI (same as with documents)\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "Pattern", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The glob pattern to watch relative to the base path. Glob patterns can have the following syntax:\n- `*` to match one or more characters in a path segment\n- `?` to match on one character in a path segment\n- `**` to match any number of path segments, including none\n- `{}` to group conditions (e.g. `**​/*.{ts,js}` matches all TypeScript and JavaScript files)\n- `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)\n- `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)\n\n@since 3.17.0", + "since": "3.17.0" + } + ] +} diff --git a/pkg/analysis_server/tool/lsp_spec/lsp_meta_model.license.txt b/pkg/analysis_server/tool/lsp_spec/lsp_meta_model.license.txt new file mode 100644 index 00000000000..3ef1f41d6ab --- /dev/null +++ b/pkg/analysis_server/tool/lsp_spec/lsp_meta_model.license.txt @@ -0,0 +1,15 @@ +This license is for the lsp_meta_model.json file. + +lsp_meta_model.license.txt downloaded from: https://microsoft.github.io/language-server-protocol/License.txt +lsp_meta_model.json downloaded from: https://raw.githubusercontent.com/microsoft/vscode-languageserver-node/main/protocol/metaModel.json + +-- + +Copyright (c) Microsoft Corporation. + +All rights reserved. + +Distributed under the following terms: + +1. Documentation is licensed under the Creative Commons Attribution 3.0 United States License. Code is licensed under the MIT License. +2. This license does not grant you rights to use any trademarks or logos of Microsoft. For Microsoft’s general trademark guidelines, go to http://go.microsoft.com/fwlink/?LinkID=254653 \ No newline at end of file diff --git a/pkg/analysis_server/tool/lsp_spec/meta_model_cleaner.dart b/pkg/analysis_server/tool/lsp_spec/meta_model_cleaner.dart new file mode 100644 index 00000000000..870c84fa0e5 --- /dev/null +++ b/pkg/analysis_server/tool/lsp_spec/meta_model_cleaner.dart @@ -0,0 +1,352 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'typescript_parser.dart'; + +/// Helper methods to clean the meta model to produce better Dart classes. +/// +/// Cleaning includes: +/// +/// - Unwrapping comments that have been wrapped in the source model +/// - Removing relative hyperlinks from comments that assume rendering in an +/// HTML page with anchors +/// - Merging types that are distinct in the meta model but we want as one +/// - Removing types in the spec that we will never use +/// - Renaming types that may have long or sub-optimal generated names +/// - Simplifying union types that contain duplicates/overlaps +class LspMetaModelCleaner { + /// A pattern to match newlines in source comments that are likely for + /// wrapping and not formatting. This allows us to rewrap based on our indent + /// level/line length without potentially introducing very short lines. + final _sourceCommentWrappingNewlinesPattern = + RegExp(r'[\w`\]\).]\n[\w`\[\(]'); + final _sourceCommentDocumentLinksPattern = + RegExp(r'\[([`\w \-.]+)\] ?\((#[^)]+)\)'); + + /// Cleans an entire [LspMetaModel]. + LspMetaModel cleanModel(LspMetaModel model) { + final types = cleanTypes(model.types); + return LspMetaModel(types); + } + + /// Cleans a List of types. + List cleanTypes(List types) { + types = _mergeTypes(types); + types = types + .where((type) => _includeTypeInOutput(type.name)) + .map(_clean) + .toList(); + types = _renameTypes(types).toList(); + return types; + } + + /// Whether a type should be retained type signatures in generated code. + bool _allowTypeInUnions(TypeBase type) { + // Don't allow arrays of MarkedStrings, but do allow simple MarkedStrings. + // The only place that uses these are Hovers and we only send one value + // (to match the MarkupString equiv) so the array just makes the types + // unnecessarily complicated. + if (type is ArrayType) { + // TODO(dantup): Consider removing this, it's not adding much. + final elementType = type.elementType; + if (elementType is Type && elementType.name == 'MarkedString') { + return false; + } + } + return true; + } + + /// Cleans a single [AstNode]. + AstNode _clean(AstNode type) { + if (type is Interface) { + return _cleanInterface(type); + } else if (type is Namespace) { + return _cleanNamespace(type); + } else if (type is TypeAlias) { + return _cleanTypeAlias(type); + } else { + throw 'Cleaning $type is not implemented.'; + } + } + + Comment? _cleanComment(Comment? comment) { + if (comment == null) { + return comment; + } + + var text = comment.text; + + // Unwrap any wrapping in the source by replacing any matching newlines with + // spaces. + text = text.replaceAllMapped( + _sourceCommentWrappingNewlinesPattern, + (match) => match.group(0)!.replaceAll('\n', ' '), + ); + + // Strip any relative links that are intended for displaying online in the + // HTML spec. + text = text.replaceAllMapped( + _sourceCommentDocumentLinksPattern, + (match) => match.group(1)!, + ); + + return Comment(Token(TokenType.COMMENT, text)); + } + + Const _cleanConst(Const const_) { + return Const( + _cleanComment(const_.commentNode), + const_.nameToken, + _cleanType(const_.type), + const_.valueToken, + ); + } + + Field _cleanField(Field field) { + return Field( + _cleanComment(field.commentNode), + field.nameToken, + _cleanType(field.type), + allowsNull: field.allowsNull, + allowsUndefined: field.allowsUndefined, + ); + } + + Interface _cleanInterface(Interface interface) { + return Interface( + _cleanComment(interface.commentNode), + interface.nameToken, + interface.typeArgs, + interface.baseTypes + .where((type) => _includeTypeInOutput(type.name)) + .toList(), + interface.members.map(_cleanMember).toList(), + ); + } + + Member _cleanMember(Member member) { + if (member is Field) { + return _cleanField(member); + } else if (member is Const) { + return _cleanConst(member); + } else { + throw 'Cleaning $member is not implemented.'; + } + } + + Namespace _cleanNamespace(Namespace namespace) { + return Namespace( + _cleanComment(namespace.commentNode), + namespace.nameToken, + namespace.typeOfValues, + namespace.members.map(_cleanMember).toList(), + ); + } + + TypeBase _cleanType(TypeBase type) { + if (type is UnionType) { + return _cleanUnionType(type); + } else if (type is ArrayType) { + return ArrayType(_cleanType(type.elementType)); + } else { + return type; + } + } + + TypeAlias _cleanTypeAlias(TypeAlias typeAlias) { + return TypeAlias( + _cleanComment(typeAlias.commentNode), + typeAlias.nameToken, + typeAlias.baseType, + ); + } + + /// Removes any duplicate types in a union. + /// + /// For example, if we map multiple types into `Object?` we don't want to end + /// up with `Either2`. + /// + /// Key on `dartType` to ensure we combine different types that will map down + /// to the same type. + TypeBase _cleanUnionType(UnionType type) { + var uniqueTypes = Map.fromEntries( + type.types + .where(_allowTypeInUnions) + .map((t) => MapEntry(t.uniqueTypeIdentifier, t)), + ).values.toList(); + + // If our list includes something that maps to Object? as well as other + // types, we should just treat the whole thing as Object? as we get no value + // typing Either4 but it becomes much more + // difficult to use. + if (uniqueTypes.any(isAnyType)) { + return uniqueTypes.firstWhere(isAnyType); + } + + // Finally, sort the types by name so that we always generate the same type + // for the same combination to improve reuse of helper methods used in + // multiple handlers. + uniqueTypes.sort( + (t1, t2) => t1.dartTypeWithTypeArgs.compareTo(t2.dartTypeWithTypeArgs)); + + // Recursively clean the inner types. + uniqueTypes = uniqueTypes.map(_cleanType).toList(); + + return uniqueTypes.length == 1 + ? uniqueTypes.single + : uniqueTypes.every(isLiteralType) + ? LiteralUnionType(uniqueTypes.cast()) + : UnionType(uniqueTypes); + } + + /// Some types are merged together. This method returns the type that [name]s + /// members should be merged into. + String? _getMergeTarget(String name) { + switch (name) { + // The meta model defines both `LSPErrorCodes` and `ErrorCodes`. The + // intention was that one is JSONRPC and one is LSP codes, but some codes + // were defined in the wrong enum with the wrong values, but kept for + // backwards compatibility. For simplicity, we merge them all into `ErrorCodes`. + case 'LSPErrorCodes': + return 'ErrorCodes'; + // In the model, `InitializeParams` is defined as by two classes, + // `_InitializeParams` and `WorkspaceFoldersInitializeParams`. This + // split doesn't add anything but makes the types less clear so we + // merge them into `InitializeParams`. + case '_InitializeParams': + return 'InitializeParams'; + case 'WorkspaceFoldersInitializeParams': + return 'InitializeParams'; + default: + return null; + } + } + + /// Removes types that are in the spec that we don't want to emit. + bool _includeTypeInOutput(String name) { + const ignoredTypes = { + // InitializeError is not used for v3.0 (Feb 2017) and by dropping it we don't + // have to handle any cases where both a namespace and interfaces are declared + // with the same name. + 'InitializeError', + // We don't use `InitializeErrorCodes` as it contains only one error code + // that has been deprecated and we've never used. + 'InitializeErrorCodes', + // Handled in custom classes now in preperation for JSON meta model which + // does not specify them. + 'Message', + 'RequestMessage', + 'NotificationMessage', + 'ResponseMessage', + 'ResponseError', + // Merged into InitializeParams. + '_InitializeParams', + 'WorkspaceFoldersInitializeParams', + // We don't use these clases and they weren't in the TS version of the + // spec so continue to not generate them until required. + 'DidChangeConfigurationRegistrationOptions', + // LSPAny/LSPObject are used by the LSP spec for unions of basic types. + // We map these onto Object? and don't use this type (and don't support + // unions with so many types). + 'LSPAny', + 'LSPObject', + // The meta model currently includes an unwanted type named 'T' that we + // don't want to create a class for. + // TODO(dantup): Remove this once it's gone from the JSON model. + 'T', + }; + const ignoredPrefixes = { + // We don't emit MarkedString because it gets mapped to a simple String + // when getting the .dartType for it. + 'MarkedString' + }; + final shouldIgnore = ignoredTypes.contains(name) || + ignoredPrefixes.any((ignore) => name.startsWith(ignore)); + return !shouldIgnore; + } + + AstNode _merge(AstNode source, AstNode dest) { + if (source.runtimeType != dest.runtimeType) { + throw 'Cannot merge ${source.runtimeType} into ${dest.runtimeType}'; + } + if (source is Namespace && dest is Namespace) { + return Namespace( + dest.commentNode ?? source.commentNode, + dest.nameToken, + dest.typeOfValues, + [...dest.members, ...source.members], + ); + } else if (source is Interface && dest is Interface) { + return Interface( + dest.commentNode ?? source.commentNode, + dest.nameToken, + dest.typeArgs, + [...dest.baseTypes, ...source.baseTypes], + [...dest.members, ...source.members], + ); + } + throw 'Merging ${source.runtimeType}s is not yet supported'; + } + + List _mergeTypes(List types) { + final typesByName = { + for (final type in types) type.name: type, + }; + assert(types.length == typesByName.length); + final typeNames = typesByName.keys.toList(); + for (final typeName in typeNames) { + final targetName = _getMergeTarget(typeName); + if (targetName != null) { + final type = typesByName[typeName]!; + final target = typesByName[targetName]!; + typesByName[targetName] = _merge(type, target); + typesByName.remove(typeName); + } + } + return typesByName.values.toList(); + } + + /// Renames types that may have been generated with bad (or long) names. + Iterable _renameTypes(List types) sync* { + const renames = { + 'CodeActionClientCapabilitiesCodeActionLiteralSupportCodeActionKind': + 'CodeActionLiteralSupportCodeActionKind', + 'CompletionClientCapabilitiesCompletionItemInsertTextModeSupport': + 'CompletionItemInsertTextModeSupport', + 'CompletionClientCapabilitiesCompletionItemTagSupport': + 'CompletionItemTagSupport', + 'CompletionClientCapabilitiesCompletionItemResolveSupport': + 'CompletionItemResolveSupport', + 'CompletionListItemDefaultsEditRange': 'CompletionItemEditRange', + 'SignatureHelpClientCapabilitiesSignatureInformationParameterInformation': + 'SignatureInformationParameterInformation', + 'TextDocumentFilter2': 'TextDocumentFilterWithScheme', + 'PrepareRenameResult1': 'PlaceholderAndRange', + }; + + for (final type in types) { + if (type is Interface) { + final newName = renames[type.name]; + if (newName != null) { + // Replace with renamed interface. + yield Interface( + type.commentNode, + Token.identifier(newName), + type.typeArgs, + type.baseTypes, + type.members, + ); + // Plus a TypeAlias for the old name. + yield TypeAlias( + type.commentNode, + Token.identifier(type.name), + Type.identifier(newName), + ); + continue; + } + } + yield type; + } + } +} diff --git a/pkg/analysis_server/tool/lsp_spec/meta_model_reader.dart b/pkg/analysis_server/tool/lsp_spec/meta_model_reader.dart new file mode 100644 index 00000000000..0febf6cd77a --- /dev/null +++ b/pkg/analysis_server/tool/lsp_spec/meta_model_reader.dart @@ -0,0 +1,302 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:convert'; +import 'dart:io'; + +import 'package:analysis_server/src/utilities/strings.dart'; +import 'package:collection/collection.dart'; + +import 'typescript.dart'; +import 'typescript_parser.dart'; + +/// Reads the LSP 'meta_model.json' file and returns its types. +class LspMetaModelReader { + final _types = []; + + /// A set of names already used (or reserved) by types that have been read. + final Set _typeNames = {}; + + /// Characters to strip from member names. + final _memberNameInvalidCharPattern = RegExp(r'\$_?'); + + /// Patterns to replace with '_' in member names. + final _memberNameSeparatorPattern = RegExp(r'/'); + + /// Gets all types that have been read from the model JSON. + List get types => _types.toList(); + + /// Creates a [Comment] from [text] if it is a valid string. + Comment? comment(dynamic text) => + text is String ? Comment(Token(TokenType.COMMENT, text)) : null; + + /// Reads all spec types from [file]. + LspMetaModel readFile(File file) { + final modelJson = file.readAsStringSync(); + final model = jsonDecode(modelJson) as Map; + return readMap(model); + } + + /// Reads all spec types from [model]. + LspMetaModel readMap(Map model) { + final requests = model['requests'] as List?; + final notifications = model['notifications'] as List?; + final structures = model['structures'] as List?; + final enums = model['enumerations'] as List?; + final typeAliases = model['typeAliases'] as List?; + [ + ...?structures?.map(_readStructure), + ...?enums?.map((e) => _readEnum(e)), + ...?typeAliases?.map(_readTypeAlias), + ].forEach(_addType); + final methodNames = + _createMethodNamesEnum([...?requests, ...?notifications]); + if (methodNames != null) { + _addType(methodNames); + } + + return LspMetaModel(types); + } + + /// Adds [type] to the current list and prevents its name from being used + /// by generated interfaces. + void _addType(AstNode type) { + _typeNames.add(type.name); + _types.add(type); + } + + String _camelCase(String str) => + str.substring(0, 1).toLowerCase() + str.substring(1); + + /// Creates an enum for all LSP method names. + Namespace? _createMethodNamesEnum(List items) { + Const toConstant(String value) { + final comment = Comment( + Token(TokenType.COMMENT, '''Constant for the '$value' method.''')); + return Const( + comment, + Token.identifier(_generateMemberName(value, camelCase: true)), + Type.identifier('string'), + Token(TokenType.STRING, value), + ); + } + + final methodConstants = + items.map((item) => item['method'] as String).map(toConstant).toList(); + + if (methodConstants.isEmpty) { + return null; + } + + final doc = comment('All standard LSP Methods read from the JSON spec.'); + return Namespace( + doc, + Token.identifier('Method'), + Type.identifier('string'), + methodConstants, + ); + } + + Const _extractEnumValue(TypeBase parent, dynamic model) { + final name = model['name'] as String; + return Const( + comment(model['documentation']), + Token.identifier(_generateMemberName(name)), + parent, + Token( + model['value'] is int + ? TokenType.NUMBER + : model['value'] is String + ? TokenType.STRING + : throw 'Unknown enum value type $model', + model['value'].toString(), + ), + ); + } + + Member _extractMember(String parentName, dynamic model) { + final name = model['name'] as String; + var type = _extractType(parentName, name, model['type']); + + // Unions may contain `null` types which we promote up to the field. + var allowsNull = false; + if (type is UnionType) { + final types = type.types; + + // Extract and strip `null`s from the union. + if (types.any(isNullType)) { + allowsNull = true; + type = UnionType(types.whereNot(isNullType).toList()); + } + } + + return Field( + comment(model['documentation']), + Token.identifier(_generateMemberName(name)), + type, + allowsNull: allowsNull, + allowsUndefined: model['optional'] == true, + ); + } + + /// Reads the type of [model]. + TypeBase _extractType(String parentName, String? fieldName, dynamic model) { + final improvedType = getImprovedType(parentName, fieldName); + if (improvedType != null) { + return improvedType; + } + + if (model['kind'] == 'reference' || model['kind'] == 'base') { + // Reference kinds are other named interfaces defined in the spec, base are + // other named types defined elsewhere. + return Type.identifier(model['name'] as String); + } else if (model['kind'] == 'array') { + return ArrayType( + _extractType(parentName, fieldName, model['element']!), + ); + } else if (model['kind'] == 'map') { + final name = fieldName ?? ''; + return MapType( + _extractType(parentName, '${name}Key', model['key']!), + _extractType(parentName, '${name}Value', model['value']!), + ); + } else if (model['kind'] == 'literal') { + // "Literal" here means an inline/anonymous type. + final inlineTypeName = _generateTypeName( + parentName, + fieldName ?? '', + ); + + // First record the definition of the anonymous type itself. + final members = (model['value']['properties'] as List) + .map((p) => _extractMember(inlineTypeName, p)) + .toList(); + _addType(Interface.inline(inlineTypeName, members)); + + // Then return its name. + return Type.identifier(inlineTypeName); + } else if (model['kind'] == 'stringLiteral') { + return LiteralType( + Type.identifier('string'), + model['value'] as String, + ); + } else if (model['kind'] == 'or') { + // Ensure the parent name is reserved so we don't try to reuse its name + // if we're parsing something without a field name. + _typeNames.add(parentName); + + final itemTypes = model['items'] as List; + final types = itemTypes.map((item) { + final generatedName = _generateAvailableTypeName(parentName, fieldName); + return _extractType(generatedName, null, item); + }).toList(); + return UnionType(types); + } else if (model['kind'] == 'tuple') { + // We currently just map tuples to an array of any of the types. The + // LSP 3.17 spec only has one tuple which is `[number, number]`. + final itemTypes = model['items'] as List; + final types = itemTypes.mapIndexed((index, item) { + final suffix = index + 1; + final name = fieldName ?? ''; + final thisName = '$name$suffix'; + return _extractType(parentName, thisName, item); + }).toList(); + return ArrayType(UnionType(types)); + } else { + throw 'Unable to extract type from $model'; + } + } + + /// Generates an available name for a node. + /// + /// If the computed name is already used, a number will be appended to the + /// end. + String _generateAvailableTypeName(String containerName, String? fieldName) { + final name = _generateTypeName(containerName, fieldName ?? ''); + final requiresSuffix = fieldName == null; + // If the name has already been taken, try appending a number and try + // again. + String generatedName; + var suffixIndex = 1; + do { + if (suffixIndex > 20) { + throw 'Failed to generate an available name for $name'; + } + generatedName = + requiresSuffix || suffixIndex > 1 ? '$name$suffixIndex' : name; + suffixIndex++; + } while (_typeNames.contains(generatedName)); + return generatedName; + } + + /// Generates a valid name for a member. + String _generateMemberName(String name, {bool camelCase = false}) { + // Replace any seperators like `/` with `_`. + name = name.replaceAll(_memberNameSeparatorPattern, '_'); + + // Replace out any characters we don't want in member names. + name = name.replaceAll(_memberNameInvalidCharPattern, ''); + + // TODO(dantup): Remove this condition and always do camelCase in a future + // CL to reduce the migration diff. + if (camelCase) { + name = _camelCase(name); + } + return name; + } + + /// Generates a valid name for a type. + String _generateTypeName(String parent, String child) { + // Some classes are private (`_InitializeParams`) but still exposed via + // other classes (`InitializeParams`) but the child types still need to be + // exposed, so remove any leading underscores. + if (parent.startsWith('_')) { + parent = parent.substring(1); + } + return '${capitalize(parent)}${capitalize(child)}'; + } + + Namespace _readEnum(dynamic model) { + final name = model['name'] as String; + final nameToken = Token.identifier(name); + final type = Type.identifier(name); + final baseType = _extractType(name, null, model['type']); + + return Namespace( + comment(model['documentation']), + nameToken, + baseType, + [ + ...?(model['values'] as List?)?.map((p) => _extractEnumValue(type, p)), + ], + ); + } + + AstNode _readStructure(dynamic model) { + final name = model['name'] as String; + return Interface( + comment(model['documentation']), + Token.identifier(name), + [], + [ + ...?(model['extends'] as List?) + ?.map((e) => Type.identifier(e['name'] as String)), + ...?(model['mixins'] as List?) + ?.map((e) => Type.identifier(e['name'] as String)), + ], + [ + ...?(model['properties'] as List?)?.map((p) => _extractMember(name, p)), + ], + ); + } + + TypeAlias _readTypeAlias(dynamic model) { + final name = model['name'] as String; + return TypeAlias( + comment(model['documentation']), + Token.identifier(name), + _extractType(name, null, model['type']), + ); + } +} diff --git a/pkg/analysis_server/tool/lsp_spec/typescript.dart b/pkg/analysis_server/tool/lsp_spec/typescript.dart index 0ca98c374e5..484fe747639 100644 --- a/pkg/analysis_server/tool/lsp_spec/typescript.dart +++ b/pkg/analysis_server/tool/lsp_spec/typescript.dart @@ -4,45 +4,6 @@ import 'typescript_parser.dart'; -/// Removes types that are in the spec that we don't want in other signatures. -bool allowTypeInSignatures(TypeBase type) { - // Don't allow arrays of MarkedStrings, but do allow simple MarkedStrings. - // The only place that uses these are Hovers and we only send one value - // (to match the MarkupString equiv) so the array just makes the types - // unnecessarily complicated. - if (type is ArrayType) { - final elementType = type.elementType; - if (elementType is Type && elementType.name == 'MarkedString') { - return false; - } - } - return true; -} - -String cleanComment(String comment) { - // Remove the start/end comment markers. - if (comment.startsWith('/**') && comment.endsWith('*/')) { - comment = comment.substring(3, comment.length - 2); - } else if (comment.startsWith('//')) { - comment = comment.substring(2); - } - - final commentLinePrefixes = RegExp(r'\n\s*\* ?'); - final nonConcurrentNewlines = RegExp(r'\n(?![\n\s\-*])'); - final newLinesThatRequireReinserting = RegExp(r'\n (\w)'); - // Remove any Windows newlines from the source. - comment = comment.replaceAll('\r', ''); - // Remove the * prefixes. - comment = comment.replaceAll(commentLinePrefixes, '\n'); - // Remove and newlines that look like wrapped text. - comment = comment.replaceAll(nonConcurrentNewlines, ' '); - // The above will remove one of the newlines when there are two, so we need - // to re-insert newlines for any block that starts immediately after a newline. - comment = comment.replaceAllMapped( - newLinesThatRequireReinserting, (m) => '\n\n${m.group(1)}'); - return comment.trim(); -} - /// Improves types in generated code, including: /// /// - Fixes up some enum types that are not as specific as they could be in the @@ -52,7 +13,7 @@ String cleanComment(String comment) { /// - Narrows unions to single types where they're only generated on the server /// and we know we always use a specific type. This avoids wrapping a lot /// of code in `EitherX.tX()` and simplifies the testing of them. -String? getImprovedType(String interfaceName, String? fieldName) { +TypeBase? getImprovedType(String interfaceName, String? fieldName) { const improvedTypeMappings = >{ 'Diagnostic': { 'severity': 'DiagnosticSeverity', @@ -100,33 +61,15 @@ String? getImprovedType(String interfaceName, String? fieldName) { final interface = improvedTypeMappings[interfaceName]; - return interface != null ? interface[fieldName] : null; -} + final improvedTypeName = interface != null ? interface[fieldName] : null; -/// Removes types that are in the spec that we don't want to emit. -bool includeTypeDefinitionInOutput(AstNode node) { - const ignoredTypes = { - // InitializeError is not used for v3.0 (Feb 2017) and by dropping it we don't - // have to handle any cases where both a namespace and interfaces are declared - // with the same name. - 'InitializeError', - // We don't use `InitializeErrorCodes` as it contains only one error code - // that has been deprecated and we've never used. - 'InitializeErrorCodes', - // Handled in custom classes now in preperation for JSON meta model which - // does not specify them. - 'Message', - 'RequestMessage', - 'NotificationMessage', - 'ResponseMessage', - 'ResponseError', - }; - const ignoredPrefixes = { - // We don't emit MarkedString because it gets mapped to a simple String - // when getting the .dartType for it. - 'MarkedString' - }; - final shouldIgnore = ignoredTypes.contains(node.name) || - ignoredPrefixes.any((ignore) => node.name.startsWith(ignore)); - return !shouldIgnore; + return improvedTypeName != null + ? improvedTypeName.endsWith('[]') + ? ArrayType(Type.identifier( + improvedTypeName.substring(0, improvedTypeName.length - 2))) + : improvedTypeName.endsWith('?') + ? UnionType.nullable(Type.identifier( + improvedTypeName.substring(0, improvedTypeName.length - 1))) + : Type.identifier(improvedTypeName) + : null; } diff --git a/pkg/analysis_server/tool/lsp_spec/typescript_parser.dart b/pkg/analysis_server/tool/lsp_spec/typescript_parser.dart index 3f790e38480..320ed6b4b3b 100644 --- a/pkg/analysis_server/tool/lsp_spec/typescript_parser.dart +++ b/pkg/analysis_server/tool/lsp_spec/typescript_parser.dart @@ -2,31 +2,18 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'dart:math'; - -import 'package:analysis_server/src/utilities/strings.dart' show capitalize; import 'package:collection/collection.dart'; import 'codegen_dart.dart'; -import 'typescript.dart'; + +export 'meta_model_cleaner.dart'; +export 'meta_model_reader.dart'; /// A fabricated field name for indexers in case they result in generation /// of type names for inline types. const fieldNameForIndexer = 'indexer'; -final _keywords = const { - 'class': TokenType.CLASS_KEYWORD, - 'const': TokenType.CONST_KEYWORD, - 'enum': TokenType.ENUM_KEYWORD, - 'export': TokenType.EXPORT_KEYWORD, - 'extends': TokenType.EXTENDS_KEYWORD, - 'interface': TokenType.INTERFACE_KEYWORD, - 'namespace': TokenType.NAMESPACE_KEYWORD, - 'readonly': TokenType.READONLY_KEYWORD, -}; - -final _validIdentifierCharacters = RegExp('[a-zA-Z0-9_]'); - +/// Whether this type allows any value (including null). bool isAnyType(TypeBase t) => t is Type && (t.name == 'any' || @@ -40,13 +27,6 @@ bool isNullType(TypeBase t) => t is Type && t.name == 'null'; bool isUndefinedType(TypeBase t) => t is Type && t.name == 'undefined'; -List parseString(String input) { - final scanner = Scanner(input); - final tokens = scanner.scan(); - final parser = Parser(tokens); - return parser.parse(); -} - TypeBase typeOfLiteral(Token token) { final tokenType = token.type; final typeName = tokenType == TokenType.STRING @@ -83,14 +63,14 @@ class Comment extends AstNode { final String text; Comment(this.token) - : text = cleanComment(token.lexeme), + : text = token.lexeme, super(null); @override String get name => throw UnsupportedError('Comments do not have a name.'); } -class Const extends Member { +class Const extends Member with LiteralValueMixin { Token nameToken; TypeBase type; Token valueToken; @@ -99,15 +79,7 @@ class Const extends Member { @override String get name => nameToken.lexeme; - String get valueAsLiteral { - var lexeme = valueToken.lexeme; - if (type.dartType == 'String' && lexeme.contains(r'$')) { - // lexeme already includes the quotes as read from the spec. - return 'r$lexeme'; - } else { - return lexeme; - } - } + String get valueAsLiteral => _asLiteral(valueToken.lexeme); } class Field extends Member { @@ -140,30 +112,10 @@ class FixedValueField extends Field { allowsNull: allowsNull, allowsUndefined: allowsUndefined); } -class Indexer extends Member { - final TypeBase indexType; - final TypeBase valueType; - Indexer( - super.comment, - this.indexType, - this.valueType, - ); - - @override - String get name => fieldNameForIndexer; -} - -class InlineInterface extends Interface { - InlineInterface( - String name, - List members, - ) : super(null, Token.identifier(name), [], [], members); -} - class Interface extends AstNode { final Token nameToken; final List typeArgs; - final List baseTypes; + final List baseTypes; final List members; Interface( @@ -177,6 +129,9 @@ class Interface extends AstNode { members.sortBy((member) => member.name.toLowerCase()); } + Interface.inline(String name, List members) + : this(null, Token.identifier(name), [], [], members); + @override String get name => nameToken.lexeme; String get nameWithTypeArgs => '$name$typeArgsString'; @@ -186,11 +141,11 @@ class Interface extends AstNode { : ''; } -class LiteralType extends TypeBase { +class LiteralType extends TypeBase with LiteralValueMixin { final TypeBase type; - final String literal; + final String _literal; - LiteralType(this.type, this.literal); + LiteralType(this.type, this._literal); @override String get dartType => type.dartType; @@ -199,7 +154,9 @@ class LiteralType extends TypeBase { String get typeArgsString => type.typeArgsString; @override - String get uniqueTypeIdentifier => '$literal:${super.uniqueTypeIdentifier}'; + String get uniqueTypeIdentifier => '$_literal:${super.uniqueTypeIdentifier}'; + + String get valueAsLiteral => _asLiteral(_literal); } /// A special class of Union types where the values are all literals of the same @@ -216,6 +173,24 @@ class LiteralUnionType extends UnionType { String get typeArgsString => types.first.typeArgsString; } +mixin LiteralValueMixin { + String _asLiteral(String value) { + if (num.tryParse(value) == null) { + // Add quotes around strings. + final prefix = value.contains(r'$') ? 'r' : ''; + return "$prefix'$value'"; + } else { + return value; + } + } +} + +class LspMetaModel { + final List types; + + LspMetaModel(this.types); +} + class MapType extends TypeBase { final TypeBase indexType; final TypeBase valueType; @@ -236,10 +211,12 @@ abstract class Member extends AstNode { class Namespace extends AstNode { final Token nameToken; + final TypeBase typeOfValues; final List members; Namespace( super.comment, this.nameToken, + this.typeOfValues, this.members, ) { members.sortBy((member) => member.name.toLowerCase()); @@ -249,677 +226,6 @@ class Namespace extends AstNode { String get name => nameToken.lexeme; } -class Parser { - final List _tokens; - int _current = 0; - final List _nodes = []; - - /// A set of names already used (or reserved) by nodes. - final Set _nodeNames = {}; - - Parser(this._tokens); - - bool get _isAtEnd => _peek().type == TokenType.EOF; - - List parse() { - if (_nodes.isEmpty) { - while (!_isAtEnd) { - _addNode(_topLevel()); - // Consume any trailing semicolons. - _match([TokenType.SEMI_COLON]); - } - } - return _nodes; - } - - /// Adds [node] to the current list and prevents its name from being used - /// by generated interfaces. - void _addNode(AstNode node) { - _nodeNames.add(node.name); - _nodes.add(node); - } - - /// Returns the current token and moves to the next. - Token _advance() => _tokenAt(_current++); - - /// Checks if the next token is [type] without advancing. - bool _check(TokenType type) => !_isAtEnd && _peek().type == type; - - Comment? _comment() { - if (_peek().type != TokenType.COMMENT) { - return null; - } - return Comment(_advance()); - } - - Const _const(String containerName, Comment? leadingComment) { - _eatUnwantedKeywords(); - final name = _consume(TokenType.IDENTIFIER, 'Expected identifier'); - TypeBase? type; - if (_match([TokenType.COLON])) { - type = _type(containerName, name.lexeme); - } - final value = _match([TokenType.EQUAL]) ? _advance() : null; - - if (type == null && value != null) { - type = typeOfLiteral(value); - } - - _consume(TokenType.SEMI_COLON, 'Expected ;'); - return Const(leadingComment, name, type!, value!); - } - - /// Ensures the next token is [type] and moves to the next, throwing [message] - /// if not. - Token _consume(TokenType type, String message) { - // Skip over any inline comments when looking for a specific token. - _match([TokenType.COMMENT]); - - if (_check(type)) { - return _advance(); - } - - // The scanner currently reads keywords with specific token types - // (eg. TokenType.NAMESPACE_KEYWORD) however v3.16 of the LSP spec also uses - // some of these words as identifiers. If the requested type is an identifier - // but we have a keyword token, then treat it as an identifier. - if (type == TokenType.IDENTIFIER) { - final next = !_isAtEnd ? _peek() : null; - if (next != null && _isKeyword(next.type)) { - _advance(); - return Token(TokenType.IDENTIFIER, next.lexeme); - } - } - - throw '$message\n\n${_peek()}'; - } - - void _eatUnwantedKeywords() { - _match([TokenType.EXPORT_KEYWORD]); - _match([TokenType.READONLY_KEYWORD]); - } - - Namespace _enum(Comment? leadingComment) { - final name = _consume(TokenType.IDENTIFIER, 'Expected identifier'); - _consume(TokenType.LEFT_BRACE, 'Expected {'); - final consts = []; - while (!_check(TokenType.RIGHT_BRACE)) { - consts.add(_enumValue(name.lexeme)); - // Commas might not be present (eg. for last one). - _match([TokenType.COMMA]); - } - _consume(TokenType.RIGHT_BRACE, 'Expected }'); - - return Namespace(leadingComment, name, consts); - } - - Const _enumValue(String enumName) { - final leadingComment = _comment(); - final name = _consume(TokenType.IDENTIFIER, 'Expected identifier'); - TypeBase? type; - if (_match([TokenType.COLON])) { - type = _type(enumName, name.lexeme); - } - final value = _match([TokenType.EQUAL]) ? _advance() : null; - - if (type == null && value != null) { - type = typeOfLiteral(value); - } - return Const(leadingComment, name, type!, value!); - } - - Field _field(String containerName, Comment? leadingComment) { - _eatUnwantedKeywords(); - final name = _consume(TokenType.IDENTIFIER, 'Expected identifier'); - var canBeUndefined = _match([TokenType.QUESTION]); - _consume(TokenType.COLON, 'Expected :'); - TypeBase type; - Token? value; - type = _type(containerName, name.lexeme, - includeUndefined: canBeUndefined, improveTypes: true); - - // Some fields have weird comments like this in the spec: - // {@link MessageType} - // These seem to be the correct type of the field, while the field is - // marked with number. - final commentText = leadingComment?.text; - if (commentText != null) { - final linkTypePattern = RegExp(r'See \{@link (\w+)\}\.?'); - final linkTypeMatch = linkTypePattern.firstMatch(commentText); - if (linkTypeMatch != null) { - type = Type.identifier(linkTypeMatch.group(1)!); - leadingComment = Comment(Token(TokenType.COMMENT, - '// ${commentText.replaceAll(linkTypePattern, '')}')); - } - } - - // Ideally this would be _consume(), but there are no semi-colons after the - // "inline types" since they're blocks. - _match([TokenType.SEMI_COLON]); - - // Special handling for fields that have fixed values. - if (value != null) { - return FixedValueField( - leadingComment, name, value, type, false, canBeUndefined); - } - - var canBeNull = false; - if (type is UnionType) { - // Since undefined and null can appear in the union type list but we want to - // handle it specially in the code generation, we promote them to fields on - // the Field. - canBeUndefined |= type.types.any(isUndefinedType); - canBeNull = type.types.any((t) => isNullType(t) || isAnyType(t)); - // Finally, we need to remove them from the union. - final remainingTypes = type.types - .where((t) => !isNullType(t) && !isUndefinedType(t)) - .toList(); - - // We also remove any types that are deprecated and/or we won't use to - // simplify the unions. - remainingTypes.removeWhere((t) => !allowTypeInSignatures(t)); - - type = _simplifyUnionTypes(remainingTypes); - } else if (isAnyType(type)) { - // There are values in the spec marked as `any` that allow nulls (for - // example, the result field on ResponseMessage can be null for a - // successful response that has no return value, eg. shutdown). - canBeNull = true; - } - return Field(leadingComment, name, type, - allowsNull: canBeNull, allowsUndefined: canBeUndefined); - } - - /// Gets an available name for a node. - /// - /// If the computed name is already used, a number will be appended to the - /// end. - String _getAvailableName(String containerName, String? fieldName) { - final name = _joinNames(containerName, fieldName ?? ''); - final requiresSuffix = fieldName == null; - // If the name has already been taken, try appending a number and try - // again. - String generatedName; - var suffixIndex = 1; - do { - if (suffixIndex > 20) { - throw 'Failed to generate an available name for $name'; - } - generatedName = - requiresSuffix || suffixIndex > 1 ? '$name$suffixIndex' : name; - suffixIndex++; - } while (_nodeNames.contains(generatedName)); - return generatedName; - } - - Indexer _indexer(String containerName, Comment? leadingComment) { - final indexer = _field(containerName, leadingComment); - _consume(TokenType.RIGHT_BRACKET, 'Expected ]'); - _consume(TokenType.COLON, 'Expected :'); - - TypeBase type; - type = _type(containerName, fieldNameForIndexer, improveTypes: true); - - //_consume(TokenType.RIGHT_BRACE, 'Expected }'); - _match([TokenType.SEMI_COLON]); - - return Indexer(leadingComment, indexer.type, type); - } - - Interface _interface(Comment? leadingComment) { - final name = _consume(TokenType.IDENTIFIER, 'Expected identifier'); - final typeArgs = []; - if (_match([TokenType.LESS])) { - while (true) { - typeArgs.add(_consume(TokenType.IDENTIFIER, 'Expected identifier')); - if (_check(TokenType.GREATER)) { - break; - } - _consume(TokenType.COMMA, 'Expected , or >'); - } - _consume(TokenType.GREATER, 'Expected >'); - } - final baseTypes = []; - if (_match([TokenType.EXTENDS_KEYWORD])) { - while (true) { - baseTypes.add(_type(name.lexeme, null)); - if (_check(TokenType.LEFT_BRACE)) { - break; - } - _consume(TokenType.COMMA, 'Expected , or {'); - } - } - _consume(TokenType.LEFT_BRACE, 'Expected {'); - final members = []; - while (!_check(TokenType.RIGHT_BRACE)) { - members.add(_member(name.lexeme)); - } - - _consume(TokenType.RIGHT_BRACE, 'Expected }'); - - return Interface(leadingComment, name, typeArgs, baseTypes, members); - } - - bool _isKeyword(TokenType type) => _keywords.values.contains(type); - - String _joinNames(String parent, String child) { - return '$parent${capitalize(child)}'; - } - - /// Returns [true] an advances if the next token is one of [types], otherwise - /// returns [false]. - bool _match(List types) { - for (final type in types) { - if (_check(type)) { - _advance(); - return true; - } - } - - return false; - } - - Member _member(String containerName) { - final leadingComment = _comment(); - _eatUnwantedKeywords(); - - if (_match([TokenType.CONST_KEYWORD])) { - return _const(containerName, leadingComment); - } else if (_match([TokenType.LEFT_BRACKET])) { - return _indexer(containerName, leadingComment); - } else { - return _field(containerName, leadingComment); - } - } - - Namespace _namespace(Comment? leadingComment) { - final name = _consume(TokenType.IDENTIFIER, 'Expected identifier'); - _consume(TokenType.LEFT_BRACE, 'Expected {'); - final members = []; - while (!_check(TokenType.RIGHT_BRACE)) { - members.add(_member(name.lexeme)); - } - _consume(TokenType.RIGHT_BRACE, 'Expected }'); - - return Namespace(leadingComment, name, members); - } - - /// Returns the next token without advancing. - Token _peek() => _tokenAt(_current); - - /// Remove any duplicate types (for ex. if we map multiple types into Object?) - /// we don't want to end up with `Object? | Object?`. Key on dartType to - /// ensure we different types that will map down to the same type. - TypeBase _simplifyUnionTypes(List types) { - final uniqueTypes = Map.fromEntries( - types.map((t) => MapEntry(t.uniqueTypeIdentifier, t)), - ).values.toList(); - - // If our list includes something that maps to Object? as well as other - // types, we should just treat the whole thing as Object? as we get no value - // typing Either4 but it becomes much more - // difficult to use. - if (uniqueTypes.any(isAnyType)) { - return uniqueTypes.firstWhere(isAnyType); - } - - // Special case to simplify a complex type in the TypeScript spec that is - // hard to detect generically and is already simplified in the JSON model. - // The first type in the union is fully representable in the second and can - // be dropped. - // TODO(dantup): Remove this when switching to the JSON model. - if (uniqueTypes.length == 2 && - uniqueTypes[0].dartTypeWithTypeArgs == 'List' && - uniqueTypes[1].dartTypeWithTypeArgs == - 'List>') { - return uniqueTypes[1]; - } - - return uniqueTypes.length == 1 - ? uniqueTypes.single - : uniqueTypes.every(isLiteralType) - ? LiteralUnionType(uniqueTypes.cast()) - : UnionType(uniqueTypes); - } - - Token _tokenAt(int index) => - index < _tokens.length ? _tokens[index] : Token.EOF; - - AstNode _topLevel() { - final leadingComment = _comment(); - _match([TokenType.EXPORT_KEYWORD]); - - final token = _peek(); - if (_match([TokenType.NAMESPACE_KEYWORD])) { - return _namespace(leadingComment); - } else if (_match([TokenType.INTERFACE_KEYWORD])) { - return _interface(leadingComment); - } else if (_match([TokenType.CLASS_KEYWORD])) { - // Classes are the same as interfaces in this spec. - return _interface(leadingComment); - } else if (_match([TokenType.ENUM_KEYWORD])) { - return _enum(leadingComment); - } else if (token.type == TokenType.IDENTIFIER && token.lexeme == 'type') { - // TODO(dantup): This is a hack... We don't have a TYPE_KEYWORD because - // the spec has `type` as an identifier. - _advance(); // Eat the 'type' keyword. - return _typeAlias(leadingComment); - } else { - throw 'Unexpected token ${_peek()}'; - } - } - - TypeBase _type( - String containerName, - String? fieldName, { - bool includeUndefined = false, - bool improveTypes = false, - }) { - var types = []; - if (includeUndefined) { - types.add(Type.Undefined); - } - while (true) { - TypeBase type; - if (_match([TokenType.LEFT_BRACE])) { - // Inline interfaces. - final generatedName = _getAvailableName(containerName, fieldName); - final members = []; - while (!_check(TokenType.RIGHT_BRACE)) { - members.add(_member(generatedName)); - } - - _consume(TokenType.RIGHT_BRACE, 'Expected }'); - // Some of the inline interfaces have trailing commas (and some do not!) - _match([TokenType.COMMA]); - - // If we have a single member that is an indexer type, we can use a Map. - if (members.length == 1 && members.single is Indexer) { - var indexer = members.single as Indexer; - type = MapType(indexer.indexType, indexer.valueType); - } else { - // Add a synthetic interface to the parsers list of nodes to represent this type. - _addNode(InlineInterface(generatedName, members)); - // Record the type as a simple type that references this interface. - type = Type.identifier(generatedName); - } - } else if (_match([TokenType.LEFT_PAREN])) { - // Some types are in (parens), so we just parse the contents as a nested type. - type = _type(containerName, fieldName); - _consume(TokenType.RIGHT_PAREN, 'Expected )'); - } else if (_check(TokenType.STRING) || _check(TokenType.NUMBER)) { - final token = _advance(); - // In TS and the spec, literal values can be types: - // export const PlainText: 'plaintext' = 'plaintext'; - // trace?: 'off' | 'messages' | 'verbose'; - // export const Invoked: 1 = 1; - type = LiteralType(typeOfLiteral(token), token.lexeme); - } else if (_match([TokenType.LEFT_BRACKET])) { - // Tuples will just be converted to List/Array. - final tupleElementTypes = []; - while (!_check(TokenType.RIGHT_BRACKET)) { - tupleElementTypes.add(_type(containerName, fieldName)); - // Remove commas in between. - _match([TokenType.COMMA]); - } - _consume(TokenType.RIGHT_BRACKET, 'Expected ]'); - - var tupleType = _simplifyUnionTypes(tupleElementTypes); - type = ArrayType(tupleType); - } else { - var typeName = _consume(TokenType.IDENTIFIER, 'Expected identifier'); - final typeArgs = []; - if (_match([TokenType.LESS])) { - while (true) { - typeArgs.add(_type(containerName, fieldName)); - if (_peek().type != TokenType.COMMA) { - _consume(TokenType.GREATER, 'Expected >'); - break; - } - } - } - - type = typeName.lexeme == 'Array' - ? ArrayType(typeArgs.single) - : Type(typeName, typeArgs); - } - if (_match([TokenType.LEFT_BRACKET])) { - _consume(TokenType.RIGHT_BRACKET, 'Expected ]'); - type = ArrayType(type); - } - // TODO(dantup): Handle types like This & That. - // For now, map to any. - if (_match([TokenType.AMPERSAND])) { - while (true) { - // Eat as many types/ampersands as we have. - _type(containerName, fieldName); - if (!_check(TokenType.AMPERSAND)) { - break; - } - } - type = Type.Any; - } - - types.add(type); - - if (!_match([TokenType.PIPE])) { - break; - } - } - - var type = _simplifyUnionTypes(types); - - // Handle improved type mappings for things that aren't very tight in the spec. - if (improveTypes) { - final improvedTypeName = getImprovedType(containerName, fieldName); - if (improvedTypeName != null) { - type = improvedTypeName.endsWith('[]') - ? ArrayType(Type.identifier( - improvedTypeName.substring(0, improvedTypeName.length - 2))) - : Type.identifier(improvedTypeName); - } - } - return type; - } - - TypeAlias _typeAlias(Comment? leadingComment) { - final name = _consume(TokenType.IDENTIFIER, 'Expected identifier'); - _consume(TokenType.EQUAL, 'Expected ='); - // Reserve the name for this alias before we start reading its type so that - // inline/literal types will not try to compute the same name if they do - // not have field names. - _nodeNames.add(name.lexeme); - final type = _type(name.lexeme, null); - if (!_isAtEnd) { - _consume(TokenType.SEMI_COLON, 'Expected ;'); - } - - return TypeAlias(leadingComment, name, type); - } -} - -class Scanner { - final String _source; - int _startOfToken = 0; - int _currentPos = 0; - final _tokens = []; - Scanner(this._source); - - bool get _isAtEnd => _currentPos >= _source.length; - bool get _isNextAtEnd => _currentPos + 1 >= _source.length; - - List scan() { - while (!_isAtEnd) { - _startOfToken = _currentPos; - _scanToken(); - } - return _tokens; - } - - void _addToken(TokenType type, {bool mergeSameTypes = false}) { - var text = _source.substring(_startOfToken, _currentPos); - - // Consecutive tokens of some types (for example Comments) are merged - // together. - if (mergeSameTypes && _tokens.isNotEmpty && type == _tokens.last.type) { - text = '${_tokens.last.lexeme}\n$text'; - _tokens.removeLast(); - } - - _tokens.add(Token(type, text)); - } - - String _advance() => _currentPos < _source.length - ? _source[_currentPos++] - : throw 'Cannot advance past end of source'; - - void _identifier() { - while (_isAlpha(_peek())) { - _advance(); - } - - final string = _source.substring(_startOfToken, _currentPos); - var keyword = _keywords[string]; - if (keyword != null) { - _addToken(keyword); - } else { - _addToken(TokenType.IDENTIFIER); - } - } - - bool _isAlpha(String? s) => - s != null && _validIdentifierCharacters.hasMatch(s); - - bool _isDigit(String? s) => s != null && (s.codeUnitAt(0) ^ 0x30) <= 9; - - bool _match(String expected) { - if (_isAtEnd || _source[_currentPos] != expected) { - return false; - } - _currentPos++; - return true; - } - - void _number() { - // Optionally process a negative. - _match('-'); - while (_isDigit(_peek())) { - _advance(); - } - - // Handle fractional parts. - if (_peek() == '.' && _isDigit(_peekNext())) { - // Consume the decimal point. - _advance(); - - while (_isDigit(_peek())) { - _advance(); - } - } - - _addToken(TokenType.NUMBER); - } - - String? _peek() => _isAtEnd ? null : _source[_currentPos]; - - String? _peekNext() => _isNextAtEnd ? null : _source[_currentPos + 1]; - - void _scanToken() { - const singleCharTokens = { - ',': TokenType.COMMA, - ';': TokenType.SEMI_COLON, - ':': TokenType.COLON, - '?': TokenType.QUESTION, - '.': TokenType.DOT, - '(': TokenType.LEFT_PAREN, - ')': TokenType.RIGHT_PAREN, - '[': TokenType.LEFT_BRACKET, - ']': TokenType.RIGHT_BRACKET, - '{': TokenType.LEFT_BRACE, - '}': TokenType.RIGHT_BRACE, - '*': TokenType.STAR, - '&': TokenType.AMPERSAND, - '=': TokenType.EQUAL, - '|': TokenType.PIPE, - }; - - final c = _advance(); - var token = singleCharTokens[c]; - if (token != null) { - _addToken(token); - return; - } - switch (c) { - case '/': - if (_match('*')) { - // Block comment. - while (!_isAtEnd && (_peek() != '*' || _peekNext() != '/')) { - _advance(); - } - // Eat the closing comment markers detected above. - if (!_isAtEnd) { - _advance(); - _advance(); - } - _addToken(TokenType.COMMENT, mergeSameTypes: true); - } else if (_match('/')) { - // Single line comment. - while (_peek() != '\n' && !_isAtEnd) { - _advance(); - } - _addToken(TokenType.COMMENT, mergeSameTypes: true); - } else { - _addToken(TokenType.SLASH); - } - break; - case '<': - _addToken(_match('=') ? TokenType.LESS_EQUAL : TokenType.LESS); - break; - case '>': - _addToken(_match('=') ? TokenType.GREATER_EQUAL : TokenType.GREATER); - break; - case ' ': - case '\r': - case '\n': - case '\t': - // Whitespace. - break; - case '"': - case "'": - _string(c); - break; - default: - if (_isDigit(c) || c == '-' && _isDigit(_peek())) { - _number(); - } else if (_isAlpha(c)) { - _identifier(); - } else { - final start = max(0, _currentPos - 20); - final end = min(_currentPos + 20, _source.length); - final snippet = _source.substring(start, end); - throw "Unexpected character '$c'.\n\n$snippet"; - } - break; - } - } - - void _string(String terminator) { - // TODO(dantup): Handle escape sequences, inc. quotes. - while (!_isAtEnd && _peek() != terminator) { - _advance(); - - if (_isAtEnd) { - throw 'Unterminated string.'; - } - } - - // Skip over the closing terminator. - _advance(); - - _addToken(TokenType.STRING); - } -} - class Token { static final Token EOF = Token(TokenType.EOF, ''); @@ -973,6 +279,7 @@ enum TokenType { class Type extends TypeBase { static final TypeBase Undefined = Type.identifier('undefined'); + static final TypeBase Null_ = Type.identifier('null'); static final TypeBase Any = Type.identifier('any'); final Token nameToken; final List typeArgs; @@ -998,9 +305,14 @@ class Type extends TypeBase { 'string': 'String', 'number': 'num', 'integer': 'int', + // Map decimal to num because clients may sent "1.0" or "1" and we want + // to consider both valid. + 'decimal': 'num', 'uinteger': 'int', 'any': 'Object?', + 'LSPAny': 'Object?', 'object': 'Object?', + 'LSPObject': 'Object?', // Simplify MarkedString from // string | { language: string; value: string } // to just String @@ -1059,6 +371,8 @@ class UnionType extends TypeBase { types.sortBy((type) => type.dartTypeWithTypeArgs.toLowerCase()); } + UnionType.nullable(TypeBase type) : this([type, Type.Null_]); + @override String get dartType { if (types.length > 4) {