[analysis_server] Update to v3.18 of the LSP spec To aid reviewing, I'm splitting this into two patch sets: Patch set 1 is the manual changes I made to update the version of the LSP spec we pull and fix up any analysis errors/test failures related to it. Patch set 2 is the generated code changes and the updated copy of the spec. There shouldn't be any functional changes here, the LSP spec just has both new types, and improved representations of existing types (or new names attributed to what were previously anonymous types that we generated names for). Fixes https://github.com/dart-lang/sdk/issues/63608 Change-Id: I71379078a407f8e4f2966b3656d1b13064c98cf9 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/514500 Reviewed-by: Keerti Parthasarathy <keertip@google.com> Commit-Queue: Samuel Rawlins <srawlins@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
diff --git a/pkg/analysis_server/integration_test/lsp_server/diagnostic_test.dart b/pkg/analysis_server/integration_test/lsp_server/diagnostic_test.dart index 0635fce..fb50ae0 100644 --- a/pkg/analysis_server/integration_test/lsp_server/diagnostic_test.dart +++ b/pkg/analysis_server/integration_test/lsp_server/diagnostic_test.dart
@@ -6,6 +6,7 @@ import 'package:test/test.dart'; import 'package:test_reflective_loader/test_reflective_loader.dart'; +import '../../test/utils/lsp_protocol_extensions.dart'; import '../../test/utils/test_code_extensions.dart'; import 'integration_tests.dart'; @@ -42,7 +43,7 @@ expect(diagnostics, hasLength(1)); var diagnostic = diagnostics.first; expect( - diagnostic.message, + diagnostic.message.asString, startsWith( "Local variable 'x' can't be referenced before it is declared", ),
diff --git a/pkg/analysis_server/lib/src/lsp/constants.dart b/pkg/analysis_server/lib/src/lsp/constants.dart index 91922e2..65aeae0 100644 --- a/pkg/analysis_server/lib/src/lsp/constants.dart +++ b/pkg/analysis_server/lib/src/lsp/constants.dart
@@ -55,7 +55,7 @@ final analysisOptionsFile = TextDocumentFilterScheme( language: 'yaml', scheme: 'file', - pattern: '**/analysis_options.yaml', + pattern: .t1('**/analysis_options.yaml'), ); /// A [ProgressToken] used for reporting progress while the server is analyzing. @@ -86,14 +86,14 @@ final fixDataFile = TextDocumentFilterScheme( language: 'yaml', scheme: 'file', - pattern: '**/lib/{fix_data.yaml,fix_data/**.yaml}', + pattern: .t1('**/lib/{fix_data.yaml,fix_data/**.yaml}'), ); /// A [TextDocumentFilterScheme] for Pubspec files. final pubspecFile = TextDocumentFilterScheme( language: 'yaml', scheme: 'file', - pattern: '**/pubspec.yaml', + pattern: .t1('**/pubspec.yaml'), ); /// IDs of client-provided commands that the server knows about.
diff --git a/pkg/analysis_server/lib/src/lsp/extensions/text_document_filters.dart b/pkg/analysis_server/lib/src/lsp/extensions/text_document_filters.dart new file mode 100644 index 0000000..c0d5276 --- /dev/null +++ b/pkg/analysis_server/lib/src/lsp/extensions/text_document_filters.dart
@@ -0,0 +1,16 @@ +// Copyright (c) 2026, 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 'package:language_server_protocol/protocol_generated.dart'; + +extension TextDocumentFilterSchemeExtension on TextDocumentFilterScheme { + /// The string pattern for this selector, regardless of whether it is a + /// [String] or a [RelativePattern]. + String? get patternString { + return pattern?.map( + (patternString) => patternString, + (relativePattern) => relativePattern.pattern, + ); + } +}
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_completion.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_completion.dart index e697a36..bac2b58 100644 --- a/pkg/analysis_server/lib/src/lsp/handlers/handler_completion.dart +++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_completion.dart
@@ -10,6 +10,7 @@ import 'package:analysis_server/src/lsp/completion_utils.dart'; import 'package:analysis_server/src/lsp/constants.dart'; import 'package:analysis_server/src/lsp/error_or.dart'; +import 'package:analysis_server/src/lsp/extensions/text_document_filters.dart'; import 'package:analysis_server/src/lsp/handlers/handlers.dart'; import 'package:analysis_server/src/lsp/mapping.dart'; import 'package:analysis_server/src/lsp/registration/feature_registration.dart'; @@ -897,7 +898,7 @@ /// characters but for other kinds of files we do not. List<TextDocumentFilterScheme> get nonDartCompletionTypes { var pluginTypesExcludingDart = pluginTypes.where( - (filter) => filter.pattern != '**/*.dart', + (filter) => filter.patternString != '**/*.dart', ); return {
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 d3f092d..e513f8b 100644 --- a/pkg/analysis_server/lib/src/lsp/handlers/handler_rename.dart +++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_rename.dart
@@ -80,7 +80,7 @@ } return success( - TextDocumentPrepareRenameResult.t1( + TextDocumentPrepareRenameResult.t2( PrepareRenamePlaceholder( range: toRange( result.lineInfo,
diff --git a/pkg/analysis_server/lib/src/lsp/mapping.dart b/pkg/analysis_server/lib/src/lsp/mapping.dart index 45643fe..4dd3664 100644 --- a/pkg/analysis_server/lib/src/lsp/mapping.dart +++ b/pkg/analysis_server/lib/src/lsp/mapping.dart
@@ -787,7 +787,7 @@ severity: pluginToDiagnosticSeverity(error.severity), code: error.code, source: languageSourceName, - message: message, + message: .t2(message), tags: getDiagnosticTags(supportedTags, error), relatedInformation: relatedInformation, // Only include codeDescription if the client explicitly supports it
diff --git a/pkg/analysis_server/lib/src/lsp/server_capabilities_computer.dart b/pkg/analysis_server/lib/src/lsp/server_capabilities_computer.dart index c8171ce..dc5deaf 100644 --- a/pkg/analysis_server/lib/src/lsp/server_capabilities_computer.dart +++ b/pkg/analysis_server/lib/src/lsp/server_capabilities_computer.dart
@@ -160,7 +160,8 @@ // interestingFiles. Prefix a `**/` so that the glob matches nested // folders as well. .map( - (glob) => TextDocumentFilterScheme(scheme: 'file', pattern: '**/$glob'), + (glob) => + TextDocumentFilterScheme(scheme: 'file', pattern: .t1('**/$glob')), ) .toList();
diff --git a/pkg/analysis_server/test/lsp/diagnostic_test.dart b/pkg/analysis_server/test/lsp/diagnostic_test.dart index 0894d8c..9024b686 100644 --- a/pkg/analysis_server/test/lsp/diagnostic_test.dart +++ b/pkg/analysis_server/test/lsp/diagnostic_test.dart
@@ -16,6 +16,7 @@ import 'package:test/test.dart'; import 'package:test_reflective_loader/test_reflective_loader.dart'; +import '../utils/lsp_protocol_extensions.dart'; import '../utils/test_code_extensions.dart'; import 'server_abstract.dart'; @@ -83,7 +84,7 @@ var err = diagnostics!.first; expect(err.severity, DiagnosticSeverity.Error); - expect(err.message, equals('Test error from plugin')); + expect(err.message.asString, equals('Test error from plugin')); expect(err.code, equals('ERR1')); expect(err.range.start.line, errorRange.range.start.line); expect(err.range.start.character, errorRange.range.start.character); @@ -190,7 +191,7 @@ var diagnostic = initialDiagnostics!.first; expect(diagnostic.severity, DiagnosticSeverity.Error); expect(diagnostic.code, 'parse_error'); - expect(diagnostic.message, "Expected ':'."); + expect(diagnostic.message.asString, "Expected ':'."); } Future<void> test_contextMessage() async { @@ -253,7 +254,7 @@ var diagnostics = await diagnosticsUpdate; expect(diagnostics, hasLength(1)); var diagnostic = diagnostics!.first; - expect(diagnostic.message, contains('\nTry')); + expect(diagnostic.message.asString, contains('\nTry')); } /// Verify that if a nonexistant file is imported, creating that file causes @@ -536,7 +537,10 @@ await initialize(); var initialDiagnostics = await initialDiagnosticsFuture; expect(initialDiagnostics, hasLength(1)); - expect(initialDiagnostics!.first.message, contains(serverErrorMessage)); + expect( + initialDiagnostics!.first.message.asString, + contains(serverErrorMessage), + ); var pluginTriggeredDiagnosticFuture = waitForDiagnostics(mainFileUri); var pluginError = plugin.AnalysisError( @@ -551,7 +555,7 @@ var pluginTriggeredDiagnostics = await pluginTriggeredDiagnosticFuture; expect( - pluginTriggeredDiagnostics!.map((error) => error.message), + pluginTriggeredDiagnostics!.map((error) => error.message.asString), containsAll([pluginErrorMessage, contains(serverErrorMessage)]), ); } @@ -574,7 +578,7 @@ // Expect only the server diagnostic. expect( - (await diagnosticsFuture)!.single.message, + (await diagnosticsFuture)!.single.message.asString, contains(serverErrorMessage), ); @@ -602,7 +606,10 @@ // Wait for the diagnostic updated and ensure it's still empty and no stale // error has come back. - expect((await diagnosticsFuture)!.single.message, pluginErrorMessage); + expect( + (await diagnosticsFuture)!.single.message.asString, + pluginErrorMessage, + ); } Future<void> test_fromPlugins_nonDartFile() async { @@ -678,7 +685,10 @@ var diagnostics = await diagnosticsUpdate; expect(diagnostics, hasLength(1)); var diagnostic = diagnostics!.first; - expect(diagnostic.message, contains("The function 'Bad' isn't defined")); + expect( + diagnostic.message.asString, + contains("The function 'Bad' isn't defined"), + ); } // Closing the file should remove the diagnostics.
diff --git a/pkg/analysis_server/test/lsp/initialization_test.dart b/pkg/analysis_server/test/lsp/initialization_test.dart index feeb505..887584d 100644 --- a/pkg/analysis_server/test/lsp/initialization_test.dart +++ b/pkg/analysis_server/test/lsp/initialization_test.dart
@@ -15,6 +15,7 @@ import 'package:test/test.dart'; import 'package:test_reflective_loader/test_reflective_loader.dart'; +import '../utils/lsp_protocol_extensions.dart'; import 'change_workspace_folders_test.dart'; import 'request_helpers_mixin.dart'; import 'server_abstract.dart'; @@ -36,7 +37,7 @@ var isAnalysisOptionsSelector = TypeMatcher<TextDocumentFilterScheme>() .having( - (selector) => selector.pattern, + (selector) => selector.pattern.asString, 'pattern', '**/analysis_options.yaml', ); @@ -48,7 +49,7 @@ ); var isPubspecSelector = TypeMatcher<TextDocumentFilterScheme>().having( - (selector) => selector.pattern, + (selector) => selector.pattern.asString, 'pattern', '**/pubspec.yaml', ); @@ -708,7 +709,7 @@ var documentFilterSql = TextDocumentFilterScheme( scheme: 'file', - pattern: '**/*.sql', + pattern: .t1('**/*.sql'), ); var documentFilterDart = TextDocumentFilterScheme( language: 'dart',
diff --git a/pkg/analysis_server/test/lsp/server_abstract.dart b/pkg/analysis_server/test/lsp/server_abstract.dart index 4baec15..7d7805f 100644 --- a/pkg/analysis_server/test/lsp/server_abstract.dart +++ b/pkg/analysis_server/test/lsp/server_abstract.dart
@@ -9,6 +9,7 @@ import 'package:analysis_server/src/legacy_analysis_server.dart'; import 'package:analysis_server/src/lsp/client_capabilities.dart'; import 'package:analysis_server/src/lsp/constants.dart'; +import 'package:analysis_server/src/lsp/extensions/text_document_filters.dart'; import 'package:analysis_server/src/lsp/lsp_analysis_server.dart'; import 'package:analysis_server/src/plugin/plugin_isolate.dart'; import 'package:analysis_server/src/server/crash_reporting_attachments.dart'; @@ -228,21 +229,8 @@ List<Registration> registrations, Method method, ) { - bool includesDart(Registration r) { - var options = TextDocumentRegistrationOptions.fromJson( - r.registerOptions as Map<String, Object?>, - ); - - return options.documentSelector?.any( - (selector) => - selector.language == dartLanguageId || - (selector.pattern?.contains('.dart') ?? false), - ) ?? - false; - } - return registrations - .where((r) => r.method == method.toJson() && includesDart(r)) + .where((r) => r.method == method.toJson() && r.includesDart) .toList(); } @@ -1274,7 +1262,7 @@ DidOpenTextDocumentParams( textDocument: TextDocumentItem( uri: uri, - languageId: dartLanguageId, + languageId: LanguageKind.Dart, version: version, text: content, ), @@ -1669,3 +1657,22 @@ await currentAnalysis; } } + +extension on Registration { + /// Whether this registration is for Dart files, either by language ID + /// or because the pattern covers `.dart` files. + bool get includesDart { + var options = TextDocumentRegistrationOptions.fromJson( + registerOptions as Map<String, Object?>, + ); + + return options.documentSelector?.any(selectorIncludesDart) ?? false; + } + + /// Helper to check if a selector covers Dart files, either by language ID + /// or because the pattern covers `.dart` files. + bool selectorIncludesDart(TextDocumentFilterScheme selector) { + return selector.language == dartLanguageId || + (selector.patternString?.contains('.dart') ?? false); + } +}
diff --git a/pkg/analysis_server/test/tool/lsp_spec/json_test.dart b/pkg/analysis_server/test/tool/lsp_spec/json_test.dart index 55a89ed1..3be4dd4 100644 --- a/pkg/analysis_server/test/tool/lsp_spec/json_test.dart +++ b/pkg/analysis_server/test/tool/lsp_spec/json_test.dart
@@ -417,7 +417,7 @@ severity: DiagnosticSeverity.Error, code: 'test_err', source: '/tmp/source.dart', - message: 'err!!', + message: .t2('err!!'), relatedInformation: [ DiagnosticRelatedInformation(location: location, message: 'message'), ], @@ -550,7 +550,7 @@ var params = Either2<String, TextDocumentItem>.t2( TextDocumentItem( uri: Uri.parse('http://example.org/'), - languageId: '!language', + languageId: LanguageKind.HTML, version: 1, text: '!text', ), @@ -559,7 +559,7 @@ expect( output, equals( - '{"languageId":"!language","text":"!text","uri":"http://example.org/","version":1}', + '{"languageId":"html","text":"!text","uri":"http://example.org/","version":1}', ), ); }
diff --git a/pkg/analysis_server/test/utils/lsp_protocol_extensions.dart b/pkg/analysis_server/test/utils/lsp_protocol_extensions.dart index 604d8c4..3e0e9f6 100644 --- a/pkg/analysis_server/test/utils/lsp_protocol_extensions.dart +++ b/pkg/analysis_server/test/utils/lsp_protocol_extensions.dart
@@ -38,6 +38,24 @@ } } +extension GlobPatternExtension on GlobPattern? { + String? get asString { + return this?.map( + (string) => string, + (relativePattern) => throw 'Expected String, got RelativePattern', + ); + } +} + +extension MarkupContentOrStringExtension on Either2<MarkupContent, String> { + String get asString { + return map( + (markup) => throw 'Expected String, got MarkupContent', + (string) => string, + ); + } +} + extension PositionExtension on Position { String toText() => '${line + 1}:${character + 1}'; }
diff --git a/pkg/analysis_server/tool/lsp_spec/README.md b/pkg/analysis_server/tool/lsp_spec/README.md index ca03b1a..d8fd839 100644 --- a/pkg/analysis_server/tool/lsp_spec/README.md +++ b/pkg/analysis_server/tool/lsp_spec/README.md
@@ -105,10 +105,12 @@ | textDocument/formatting | ✅ | | | textDocument/onTypeFormatting | ✅ | | | textDocument/rangeFormatting | ✅ | | +| textDocument/rangesFormatting | | | | textDocument/hover | ✅ | | | textDocument/implementation | ✅ | | | textDocument/inlayHint | ✅ | | | inlayHint/resolve | | | +| textDocument/inlineCompletion | | | | textDocument/inlineValue | ✅ | | | textDocument/linkedEditingRange | | | | textDocument/moniker | | | @@ -149,10 +151,13 @@ | workspace/didDeleteFiles | | | | workspace/didRenameFiles | | | | workspace/executeCommand | ✅ | | +| workspace/foldingRange/refresh | | | | workspace/inlayHint/refresh | | | | workspace/inlineValue/refresh | | | | workspace/symbol | ✅ | | | workspaceSymbol/resolve | | | +| workspace/textDocumentContent | | | +| workspace/textDocumentContent/refresh | | | | workspace/willCreateFiles | | | | workspace/willDeleteFiles | | | | workspace/willRenameFiles | | |
diff --git a/pkg/analysis_server/tool/lsp_spec/generate_all.dart b/pkg/analysis_server/tool/lsp_spec/generate_all.dart index fad7cae..1d52a8a 100644 --- a/pkg/analysis_server/tool/lsp_spec/generate_all.dart +++ b/pkg/analysis_server/tool/lsp_spec/generate_all.dart
@@ -99,7 +99,7 @@ /// 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://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/metaModel/metaModel.json', + 'https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/metaModel/metaModel.json', ); Future<void> downloadSpec() async { @@ -137,8 +137,8 @@ import 'package:collection/collection.dart'; import 'package:language_server_protocol/json_parsing.dart'; -import 'package:language_server_protocol/protocol_special.dart'; import 'package:language_server_protocol/protocol${importCustom ? '_custom' : ''}_generated.dart'; +import 'package:language_server_protocol/protocol_special.dart'; const jsonEncoder = JsonEncoder.withIndent(' ');
diff --git a/third_party/pkg/language_server_protocol/lib/protocol_generated.dart b/third_party/pkg/language_server_protocol/lib/protocol_generated.dart index aaf1d23..865abd3 100644 --- a/third_party/pkg/language_server_protocol/lib/protocol_generated.dart +++ b/third_party/pkg/language_server_protocol/lib/protocol_generated.dart
@@ -30,11 +30,35 @@ import 'package:collection/collection.dart'; import 'package:language_server_protocol/json_parsing.dart'; -import 'package:language_server_protocol/protocol_special.dart'; import 'package:language_server_protocol/protocol_custom_generated.dart'; +import 'package:language_server_protocol/protocol_special.dart'; const jsonEncoder = JsonEncoder.withIndent(' '); +bool _canParseApplyKind( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && !ApplyKind.canParse(value, reporter)) { + return false; + } + } finally { + reporter.pop(); + } + return true; +} + bool _canParseBool( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { @@ -89,6 +113,63 @@ return true; } +bool _canParseBoolClientSemanticTokensRequestFullDelta( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + (value is! bool && + !ClientSemanticTokensRequestFullDelta.canParse(value, reporter))) { + reporter.reportError( + 'must be of type Either2<bool, ClientSemanticTokensRequestFullDelta>'); + return false; + } + } finally { + reporter.pop(); + } + return true; +} + +bool _canParseBoolClientSemanticTokensRequestOptionsRange( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + (value is! bool && + !ClientSemanticTokensRequestOptionsRange.canParse( + value, reporter))) { + reporter.reportError( + 'must be of type Either2<bool, ClientSemanticTokensRequestOptionsRange>'); + return false; + } + } finally { + reporter.pop(); + } + return true; +} + bool _canParseBoolCodeActionOptions( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { @@ -423,6 +504,34 @@ return true; } +bool _canParseBoolInlineCompletionOptions( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + (value is! bool && + !InlineCompletionOptions.canParse(value, reporter))) { + reporter.reportError( + 'must be of type Either2<bool, InlineCompletionOptions>'); + return false; + } + } finally { + reporter.pop(); + } + return true; +} + bool _canParseBoolInlineValueOptionsInlineValueRegistrationOptions( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { @@ -618,64 +727,6 @@ return true; } -bool _canParseBoolSemanticTokensClientCapabilitiesRequestsFull( - Map<String, Object?> map, LspJsonReporter reporter, String fieldName, - {required bool allowsUndefined, required bool allowsNull}) { - reporter.push(fieldName); - try { - if (!allowsUndefined && !map.containsKey(fieldName)) { - reporter.reportError('must not be undefined'); - return false; - } - final value = map[fieldName]; - final nullCheck = allowsNull || allowsUndefined; - if (!nullCheck && value == null) { - reporter.reportError('must not be null'); - return false; - } - if ((!nullCheck || value != null) && - (value is! bool && - !SemanticTokensClientCapabilitiesRequestsFull.canParse( - value, reporter))) { - reporter.reportError( - 'must be of type Either2<bool, SemanticTokensClientCapabilitiesRequestsFull>'); - return false; - } - } finally { - reporter.pop(); - } - return true; -} - -bool _canParseBoolSemanticTokensClientCapabilitiesRequestsRange( - Map<String, Object?> map, LspJsonReporter reporter, String fieldName, - {required bool allowsUndefined, required bool allowsNull}) { - reporter.push(fieldName); - try { - if (!allowsUndefined && !map.containsKey(fieldName)) { - reporter.reportError('must not be undefined'); - return false; - } - final value = map[fieldName]; - final nullCheck = allowsNull || allowsUndefined; - if (!nullCheck && value == null) { - reporter.reportError('must not be null'); - return false; - } - if ((!nullCheck || value != null) && - (value is! bool && - !SemanticTokensClientCapabilitiesRequestsRange.canParse( - value, reporter))) { - reporter.reportError( - 'must be of type Either2<bool, SemanticTokensClientCapabilitiesRequestsRange>'); - return false; - } - } finally { - reporter.pop(); - } - return true; -} - bool _canParseBoolSemanticTokensFullDelta( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { @@ -892,6 +943,31 @@ return true; } +bool _canParseChangeAnnotationsSupportOptions( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + !ChangeAnnotationsSupportOptions.canParse(value, reporter)) { + return false; + } + } finally { + reporter.pop(); + } + return true; +} + bool _canParseClientCapabilities( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { @@ -942,6 +1018,131 @@ return true; } +bool _canParseClientCodeActionLiteralOptions( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + !ClientCodeActionLiteralOptions.canParse(value, reporter)) { + return false; + } + } finally { + reporter.pop(); + } + return true; +} + +bool _canParseClientCodeActionResolveOptions( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + !ClientCodeActionResolveOptions.canParse(value, reporter)) { + return false; + } + } finally { + reporter.pop(); + } + return true; +} + +bool _canParseClientCodeLensResolveOptions( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + !ClientCodeLensResolveOptions.canParse(value, reporter)) { + return false; + } + } finally { + reporter.pop(); + } + return true; +} + +bool _canParseClientCompletionItemInsertTextModeOptions( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + !ClientCompletionItemInsertTextModeOptions.canParse(value, reporter)) { + return false; + } + } finally { + reporter.pop(); + } + return true; +} + +bool _canParseClientCompletionItemOptions( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + !ClientCompletionItemOptions.canParse(value, reporter)) { + return false; + } + } finally { + reporter.pop(); + } + return true; +} + bool _canParseClientCompletionItemOptionsKind( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { @@ -967,6 +1168,106 @@ return true; } +bool _canParseClientCompletionItemResolveOptions( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + !ClientCompletionItemResolveOptions.canParse(value, reporter)) { + return false; + } + } finally { + reporter.pop(); + } + return true; +} + +bool _canParseClientDiagnosticsTagOptions( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + !ClientDiagnosticsTagOptions.canParse(value, reporter)) { + return false; + } + } finally { + reporter.pop(); + } + return true; +} + +bool _canParseClientFoldingRangeKindOptions( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + !ClientFoldingRangeKindOptions.canParse(value, reporter)) { + return false; + } + } finally { + reporter.pop(); + } + return true; +} + +bool _canParseClientFoldingRangeOptions( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + !ClientFoldingRangeOptions.canParse(value, reporter)) { + return false; + } + } finally { + reporter.pop(); + } + return true; +} + bool _canParseClientInfo( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { @@ -992,6 +1293,31 @@ return true; } +bool _canParseClientInlayHintResolveOptions( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + !ClientInlayHintResolveOptions.canParse(value, reporter)) { + return false; + } + } finally { + reporter.pop(); + } + return true; +} + bool _canParseClientSemanticTokensRequestOptions( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { @@ -1017,6 +1343,156 @@ return true; } +bool _canParseClientShowMessageActionItemOptions( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + !ClientShowMessageActionItemOptions.canParse(value, reporter)) { + return false; + } + } finally { + reporter.pop(); + } + return true; +} + +bool _canParseClientSignatureInformationOptions( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + !ClientSignatureInformationOptions.canParse(value, reporter)) { + return false; + } + } finally { + reporter.pop(); + } + return true; +} + +bool _canParseClientSignatureParameterInformationOptions( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + !ClientSignatureParameterInformationOptions.canParse(value, reporter)) { + return false; + } + } finally { + reporter.pop(); + } + return true; +} + +bool _canParseClientSymbolKindOptions( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + !ClientSymbolKindOptions.canParse(value, reporter)) { + return false; + } + } finally { + reporter.pop(); + } + return true; +} + +bool _canParseClientSymbolResolveOptions( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + !ClientSymbolResolveOptions.canParse(value, reporter)) { + return false; + } + } finally { + reporter.pop(); + } + return true; +} + +bool _canParseClientSymbolTagOptions( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + !ClientSymbolTagOptions.canParse(value, reporter)) { + return false; + } + } finally { + reporter.pop(); + } + return true; +} + bool _canParseCodeActionClientCapabilities( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { @@ -1042,57 +1518,6 @@ return true; } -bool _canParseCodeActionClientCapabilitiesCodeActionLiteralSupport( - Map<String, Object?> map, LspJsonReporter reporter, String fieldName, - {required bool allowsUndefined, required bool allowsNull}) { - reporter.push(fieldName); - try { - if (!allowsUndefined && !map.containsKey(fieldName)) { - reporter.reportError('must not be undefined'); - return false; - } - final value = map[fieldName]; - final nullCheck = allowsNull || allowsUndefined; - if (!nullCheck && value == null) { - reporter.reportError('must not be null'); - return false; - } - if ((!nullCheck || value != null) && - !CodeActionClientCapabilitiesCodeActionLiteralSupport.canParse( - value, reporter)) { - return false; - } - } finally { - reporter.pop(); - } - return true; -} - -bool _canParseCodeActionClientCapabilitiesResolveSupport( - Map<String, Object?> map, LspJsonReporter reporter, String fieldName, - {required bool allowsUndefined, required bool allowsNull}) { - reporter.push(fieldName); - try { - if (!allowsUndefined && !map.containsKey(fieldName)) { - reporter.reportError('must not be undefined'); - return false; - } - final value = map[fieldName]; - final nullCheck = allowsNull || allowsUndefined; - if (!nullCheck && value == null) { - reporter.reportError('must not be null'); - return false; - } - if ((!nullCheck || value != null) && - !CodeActionClientCapabilitiesResolveSupport.canParse(value, reporter)) { - return false; - } - } finally { - reporter.pop(); - } - return true; -} - bool _canParseCodeActionContext( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { @@ -1168,6 +1593,31 @@ return true; } +bool _canParseCodeActionTagOptions( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + !CodeActionTagOptions.canParse(value, reporter)) { + return false; + } + } finally { + reporter.pop(); + } + return true; +} + bool _canParseCodeActionTriggerKind( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { @@ -1366,56 +1816,6 @@ return true; } -bool _canParseCompletionClientCapabilitiesCompletionItem( - Map<String, Object?> map, LspJsonReporter reporter, String fieldName, - {required bool allowsUndefined, required bool allowsNull}) { - reporter.push(fieldName); - try { - if (!allowsUndefined && !map.containsKey(fieldName)) { - reporter.reportError('must not be undefined'); - return false; - } - final value = map[fieldName]; - final nullCheck = allowsNull || allowsUndefined; - if (!nullCheck && value == null) { - reporter.reportError('must not be null'); - return false; - } - if ((!nullCheck || value != null) && - !CompletionClientCapabilitiesCompletionItem.canParse(value, reporter)) { - return false; - } - } finally { - reporter.pop(); - } - return true; -} - -bool _canParseCompletionClientCapabilitiesCompletionList( - Map<String, Object?> map, LspJsonReporter reporter, String fieldName, - {required bool allowsUndefined, required bool allowsNull}) { - reporter.push(fieldName); - try { - if (!allowsUndefined && !map.containsKey(fieldName)) { - reporter.reportError('must not be undefined'); - return false; - } - final value = map[fieldName]; - final nullCheck = allowsNull || allowsUndefined; - if (!nullCheck && value == null) { - reporter.reportError('must not be null'); - return false; - } - if ((!nullCheck || value != null) && - !CompletionClientCapabilitiesCompletionList.canParse(value, reporter)) { - return false; - } - } finally { - reporter.pop(); - } - return true; -} - bool _canParseCompletionContext( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { @@ -1441,6 +1841,31 @@ return true; } +bool _canParseCompletionItemApplyKinds( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + !CompletionItemApplyKinds.canParse(value, reporter)) { + return false; + } + } finally { + reporter.pop(); + } + return true; +} + bool _canParseCompletionItemDefaults( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { @@ -1466,31 +1891,6 @@ return true; } -bool _canParseCompletionItemInsertTextModeSupport( - Map<String, Object?> map, LspJsonReporter reporter, String fieldName, - {required bool allowsUndefined, required bool allowsNull}) { - reporter.push(fieldName); - try { - if (!allowsUndefined && !map.containsKey(fieldName)) { - reporter.reportError('must not be undefined'); - return false; - } - final value = map[fieldName]; - final nullCheck = allowsNull || allowsUndefined; - if (!nullCheck && value == null) { - reporter.reportError('must not be null'); - return false; - } - if ((!nullCheck || value != null) && - !CompletionItemInsertTextModeSupport.canParse(value, reporter)) { - return false; - } - } finally { - reporter.pop(); - } - return true; -} - bool _canParseCompletionItemKind( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { @@ -1566,7 +1966,7 @@ return true; } -bool _canParseCompletionItemResolveSupport( +bool _canParseCompletionItemTagOptions( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { reporter.push(fieldName); @@ -1582,7 +1982,7 @@ return false; } if ((!nullCheck || value != null) && - !CompletionItemResolveSupport.canParse(value, reporter)) { + !CompletionItemTagOptions.canParse(value, reporter)) { return false; } } finally { @@ -1591,7 +1991,7 @@ return true; } -bool _canParseCompletionItemTagSupport( +bool _canParseCompletionListCapabilities( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { reporter.push(fieldName); @@ -1607,7 +2007,7 @@ return false; } if ((!nullCheck || value != null) && - !CompletionItemTagSupport.canParse(value, reporter)) { + !CompletionListCapabilities.canParse(value, reporter)) { return false; } } finally { @@ -2169,56 +2569,6 @@ return true; } -bool _canParseDocumentSymbolClientCapabilitiesSymbolKind( - Map<String, Object?> map, LspJsonReporter reporter, String fieldName, - {required bool allowsUndefined, required bool allowsNull}) { - reporter.push(fieldName); - try { - if (!allowsUndefined && !map.containsKey(fieldName)) { - reporter.reportError('must not be undefined'); - return false; - } - final value = map[fieldName]; - final nullCheck = allowsNull || allowsUndefined; - if (!nullCheck && value == null) { - reporter.reportError('must not be null'); - return false; - } - if ((!nullCheck || value != null) && - !DocumentSymbolClientCapabilitiesSymbolKind.canParse(value, reporter)) { - return false; - } - } finally { - reporter.pop(); - } - return true; -} - -bool _canParseDocumentSymbolClientCapabilitiesTagSupport( - Map<String, Object?> map, LspJsonReporter reporter, String fieldName, - {required bool allowsUndefined, required bool allowsNull}) { - reporter.push(fieldName); - try { - if (!allowsUndefined && !map.containsKey(fieldName)) { - reporter.reportError('must not be undefined'); - return false; - } - final value = map[fieldName]; - final nullCheck = allowsNull || allowsUndefined; - if (!nullCheck && value == null) { - reporter.reportError('must not be null'); - return false; - } - if ((!nullCheck || value != null) && - !DocumentSymbolClientCapabilitiesTagSupport.canParse(value, reporter)) { - return false; - } - } finally { - reporter.pop(); - } - return true; -} - bool _canParseEditRangeWithInsertReplaceRange( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { @@ -2547,57 +2897,6 @@ return true; } -bool _canParseFoldingRangeClientCapabilitiesFoldingRange( - Map<String, Object?> map, LspJsonReporter reporter, String fieldName, - {required bool allowsUndefined, required bool allowsNull}) { - reporter.push(fieldName); - try { - if (!allowsUndefined && !map.containsKey(fieldName)) { - reporter.reportError('must not be undefined'); - return false; - } - final value = map[fieldName]; - final nullCheck = allowsNull || allowsUndefined; - if (!nullCheck && value == null) { - reporter.reportError('must not be null'); - return false; - } - if ((!nullCheck || value != null) && - !FoldingRangeClientCapabilitiesFoldingRange.canParse(value, reporter)) { - return false; - } - } finally { - reporter.pop(); - } - return true; -} - -bool _canParseFoldingRangeClientCapabilitiesFoldingRangeKind( - Map<String, Object?> map, LspJsonReporter reporter, String fieldName, - {required bool allowsUndefined, required bool allowsNull}) { - reporter.push(fieldName); - try { - if (!allowsUndefined && !map.containsKey(fieldName)) { - reporter.reportError('must not be undefined'); - return false; - } - final value = map[fieldName]; - final nullCheck = allowsNull || allowsUndefined; - if (!nullCheck && value == null) { - reporter.reportError('must not be null'); - return false; - } - if ((!nullCheck || value != null) && - !FoldingRangeClientCapabilitiesFoldingRangeKind.canParse( - value, reporter)) { - return false; - } - } finally { - reporter.pop(); - } - return true; -} - bool _canParseFoldingRangeKind( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { @@ -2623,6 +2922,31 @@ return true; } +bool _canParseFoldingRangeWorkspaceClientCapabilities( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + !FoldingRangeWorkspaceClientCapabilities.canParse(value, reporter)) { + return false; + } + } finally { + reporter.pop(); + } + return true; +} + bool _canParseFormattingOptions( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { @@ -2673,32 +2997,6 @@ return true; } -bool _canParseGeneralClientCapabilitiesStaleRequestSupport( - Map<String, Object?> map, LspJsonReporter reporter, String fieldName, - {required bool allowsUndefined, required bool allowsNull}) { - reporter.push(fieldName); - try { - if (!allowsUndefined && !map.containsKey(fieldName)) { - reporter.reportError('must not be undefined'); - return false; - } - final value = map[fieldName]; - final nullCheck = allowsNull || allowsUndefined; - if (!nullCheck && value == null) { - reporter.reportError('must not be null'); - return false; - } - if ((!nullCheck || value != null) && - !GeneralClientCapabilitiesStaleRequestSupport.canParse( - value, reporter)) { - return false; - } - } finally { - reporter.pop(); - } - return true; -} - bool _canParseHoverClientCapabilities( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { @@ -2774,31 +3072,6 @@ return true; } -bool _canParseInlayHintClientCapabilitiesResolveSupport( - Map<String, Object?> map, LspJsonReporter reporter, String fieldName, - {required bool allowsUndefined, required bool allowsNull}) { - reporter.push(fieldName); - try { - if (!allowsUndefined && !map.containsKey(fieldName)) { - reporter.reportError('must not be undefined'); - return false; - } - final value = map[fieldName]; - final nullCheck = allowsNull || allowsUndefined; - if (!nullCheck && value == null) { - reporter.reportError('must not be null'); - return false; - } - if ((!nullCheck || value != null) && - !InlayHintClientCapabilitiesResolveSupport.canParse(value, reporter)) { - return false; - } - } finally { - reporter.pop(); - } - return true; -} - bool _canParseInlayHintKind( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { @@ -2849,6 +3122,81 @@ return true; } +bool _canParseInlineCompletionClientCapabilities( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + !InlineCompletionClientCapabilities.canParse(value, reporter)) { + return false; + } + } finally { + reporter.pop(); + } + return true; +} + +bool _canParseInlineCompletionContext( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + !InlineCompletionContext.canParse(value, reporter)) { + return false; + } + } finally { + reporter.pop(); + } + return true; +} + +bool _canParseInlineCompletionTriggerKind( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + !InlineCompletionTriggerKind.canParse(value, reporter)) { + return false; + } + } finally { + reporter.pop(); + } + return true; +} + bool _canParseInlineValueClientCapabilities( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { @@ -3052,6 +3400,31 @@ return true; } +bool _canParseLanguageKind( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + !LanguageKind.canParse(value, reporter)) { + return false; + } + } finally { + reporter.pop(); + } + return true; +} + bool _canParseLinkedEditingRangeClientCapabilities( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { @@ -3135,6 +3508,61 @@ return true; } +bool _canParseListCodeActionKindDocumentation( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + (value is! List<Object?> || + value.any((item) => + !CodeActionKindDocumentation.canParse(item, reporter)))) { + reporter.reportError('must be of type List<CodeActionKindDocumentation>'); + return false; + } + } finally { + reporter.pop(); + } + return true; +} + +bool _canParseListCodeActionTag( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + (value is! List<Object?> || + value.any((item) => !CodeActionTag.canParse(item, reporter)))) { + reporter.reportError('must be of type List<CodeActionTag>'); + return false; + } + } finally { + reporter.pop(); + } + return true; +} + bool _canParseListCompletionItem( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { @@ -3605,6 +4033,34 @@ return true; } +bool _canParseListInlineCompletionItem( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + (value is! List<Object?> || + value.any( + (item) => !InlineCompletionItem.canParse(item, reporter)))) { + reporter.reportError('must be of type List<InlineCompletionItem>'); + return false; + } + } finally { + reporter.pop(); + } + return true; +} + bool _canParseListInsertTextMode( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { @@ -3739,7 +4195,7 @@ return true; } -bool _canParseListNotebookDocumentChangeEventCellsTextContent( +bool _canParseListNotebookCellLanguage( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { reporter.push(fieldName); @@ -3756,11 +4212,9 @@ } if ((!nullCheck || value != null) && (value is! List<Object?> || - value.any((item) => - !NotebookDocumentChangeEventCellsTextContent.canParse( - item, reporter)))) { - reporter.reportError( - 'must be of type List<NotebookDocumentChangeEventCellsTextContent>'); + value.any( + (item) => !NotebookCellLanguage.canParse(item, reporter)))) { + reporter.reportError('must be of type List<NotebookCellLanguage>'); return false; } } finally { @@ -3769,7 +4223,7 @@ return true; } -bool _canParseListNotebookDocumentSyncOptionsNotebookSelector2Cells( +bool _canParseListNotebookDocumentCellContentChanges( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { reporter.push(fieldName); @@ -3786,41 +4240,10 @@ } if ((!nullCheck || value != null) && (value is! List<Object?> || - value.any((item) => - !NotebookDocumentSyncOptionsNotebookSelector2Cells.canParse( - item, reporter)))) { + value.any((item) => !NotebookDocumentCellContentChanges.canParse( + item, reporter)))) { reporter.reportError( - 'must be of type List<NotebookDocumentSyncOptionsNotebookSelector2Cells>'); - return false; - } - } finally { - reporter.pop(); - } - return true; -} - -bool _canParseListNotebookDocumentSyncOptionsNotebookSelectorCells( - Map<String, Object?> map, LspJsonReporter reporter, String fieldName, - {required bool allowsUndefined, required bool allowsNull}) { - reporter.push(fieldName); - try { - if (!allowsUndefined && !map.containsKey(fieldName)) { - reporter.reportError('must not be undefined'); - return false; - } - final value = map[fieldName]; - final nullCheck = allowsNull || allowsUndefined; - if (!nullCheck && value == null) { - reporter.reportError('must not be null'); - return false; - } - if ((!nullCheck || value != null) && - (value is! List<Object?> || - value.any((item) => - !NotebookDocumentSyncOptionsNotebookSelectorCells.canParse( - item, reporter)))) { - reporter.reportError( - 'must be of type List<NotebookDocumentSyncOptionsNotebookSelectorCells>'); + 'must be of type List<NotebookDocumentCellContentChanges>'); return false; } } finally { @@ -3830,7 +4253,7 @@ } bool - _canParseListNotebookDocumentSyncOptionsNotebookSelectorNotebookDocumentSyncOptionsNotebookSelector2( + _canParseListNotebookDocumentFilterWithCellsNotebookDocumentFilterWithNotebook( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { reporter.push(fieldName); @@ -3848,12 +4271,11 @@ if ((!nullCheck || value != null) && (value is! List<Object?> || value.any((item) => - !NotebookDocumentSyncOptionsNotebookSelector.canParse( - item, reporter) && - !NotebookDocumentSyncOptionsNotebookSelector2.canParse( + !NotebookDocumentFilterWithCells.canParse(item, reporter) && + !NotebookDocumentFilterWithNotebook.canParse( item, reporter)))) { reporter.reportError( - 'must be of type List<Either2<NotebookDocumentSyncOptionsNotebookSelector, NotebookDocumentSyncOptionsNotebookSelector2>>'); + 'must be of type List<Either2<NotebookDocumentFilterWithCells, NotebookDocumentFilterWithNotebook>>'); return false; } } finally { @@ -4523,7 +4945,7 @@ return true; } -bool _canParseLocationWorkspaceSymbolLocation( +bool _canParseLocationLocationUriOnly( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { reporter.push(fieldName); @@ -4540,9 +4962,9 @@ } if ((!nullCheck || value != null) && (!Location.canParse(value, reporter) && - !WorkspaceSymbolLocation.canParse(value, reporter))) { - reporter.reportError( - 'must be of type Either2<Location, WorkspaceSymbolLocation>'); + !LocationUriOnly.canParse(value, reporter))) { + reporter + .reportError('must be of type Either2<Location, LocationUriOnly>'); return false; } } finally { @@ -4874,6 +5296,56 @@ return true; } +bool _canParseNotebookDocumentCellChanges( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + !NotebookDocumentCellChanges.canParse(value, reporter)) { + return false; + } + } finally { + reporter.pop(); + } + return true; +} + +bool _canParseNotebookDocumentCellChangeStructure( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + !NotebookDocumentCellChangeStructure.canParse(value, reporter)) { + return false; + } + } finally { + reporter.pop(); + } + return true; +} + bool _canParseNotebookDocumentChangeEvent( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { @@ -4899,56 +5371,6 @@ return true; } -bool _canParseNotebookDocumentChangeEventCells( - Map<String, Object?> map, LspJsonReporter reporter, String fieldName, - {required bool allowsUndefined, required bool allowsNull}) { - reporter.push(fieldName); - try { - if (!allowsUndefined && !map.containsKey(fieldName)) { - reporter.reportError('must not be undefined'); - return false; - } - final value = map[fieldName]; - final nullCheck = allowsNull || allowsUndefined; - if (!nullCheck && value == null) { - reporter.reportError('must not be null'); - return false; - } - if ((!nullCheck || value != null) && - !NotebookDocumentChangeEventCells.canParse(value, reporter)) { - return false; - } - } finally { - reporter.pop(); - } - return true; -} - -bool _canParseNotebookDocumentChangeEventCellsStructure( - Map<String, Object?> map, LspJsonReporter reporter, String fieldName, - {required bool allowsUndefined, required bool allowsNull}) { - reporter.push(fieldName); - try { - if (!allowsUndefined && !map.containsKey(fieldName)) { - reporter.reportError('must not be undefined'); - return false; - } - final value = map[fieldName]; - final nullCheck = allowsNull || allowsUndefined; - if (!nullCheck && value == null) { - reporter.reportError('must not be null'); - return false; - } - if ((!nullCheck || value != null) && - !NotebookDocumentChangeEventCellsStructure.canParse(value, reporter)) { - return false; - } - } finally { - reporter.pop(); - } - return true; -} - bool _canParseNotebookDocumentClientCapabilities( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { @@ -4975,7 +5397,7 @@ } bool - _canParseNotebookDocumentFilter1NotebookDocumentFilter2NotebookDocumentFilter3String( + _canParseNotebookDocumentFilterNotebookTypeNotebookDocumentFilterPatternNotebookDocumentFilterSchemeString( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { reporter.push(fieldName); @@ -4991,9 +5413,9 @@ return false; } if ((!nullCheck || value != null) && - (!NotebookDocumentFilter1.canParse(value, reporter) && - !NotebookDocumentFilter2.canParse(value, reporter) && - !NotebookDocumentFilter3.canParse(value, reporter) && + (!NotebookDocumentFilterNotebookType.canParse(value, reporter) && + !NotebookDocumentFilterPattern.canParse(value, reporter) && + !NotebookDocumentFilterScheme.canParse(value, reporter) && value is! String)) { reporter.reportError( 'must be of type Either2<NotebookDocumentFilter, String>'); @@ -5259,32 +5681,6 @@ return true; } -bool _canParsePublishDiagnosticsClientCapabilitiesTagSupport( - Map<String, Object?> map, LspJsonReporter reporter, String fieldName, - {required bool allowsUndefined, required bool allowsNull}) { - reporter.push(fieldName); - try { - if (!allowsUndefined && !map.containsKey(fieldName)) { - reporter.reportError('must not be undefined'); - return false; - } - final value = map[fieldName]; - final nullCheck = allowsNull || allowsUndefined; - if (!nullCheck && value == null) { - reporter.reportError('must not be null'); - return false; - } - if ((!nullCheck || value != null) && - !PublishDiagnosticsClientCapabilitiesTagSupport.canParse( - value, reporter)) { - return false; - } - } finally { - reporter.pop(); - } - return true; -} - bool _canParseRange( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { @@ -5434,6 +5830,31 @@ return true; } +bool _canParseSelectedCompletionInfo( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + !SelectedCompletionInfo.canParse(value, reporter)) { + return false; + } + } finally { + reporter.pop(); + } + return true; +} + bool _canParseSelectionRange( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { @@ -5712,32 +6133,6 @@ return true; } -bool _canParseShowMessageRequestClientCapabilitiesMessageActionItem( - Map<String, Object?> map, LspJsonReporter reporter, String fieldName, - {required bool allowsUndefined, required bool allowsNull}) { - reporter.push(fieldName); - try { - if (!allowsUndefined && !map.containsKey(fieldName)) { - reporter.reportError('must not be undefined'); - return false; - } - final value = map[fieldName]; - final nullCheck = allowsNull || allowsUndefined; - if (!nullCheck && value == null) { - reporter.reportError('must not be null'); - return false; - } - if ((!nullCheck || value != null) && - !ShowMessageRequestClientCapabilitiesMessageActionItem.canParse( - value, reporter)) { - return false; - } - } finally { - reporter.pop(); - } - return true; -} - bool _canParseSignatureHelp( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { @@ -5788,32 +6183,6 @@ return true; } -bool _canParseSignatureHelpClientCapabilitiesSignatureInformation( - Map<String, Object?> map, LspJsonReporter reporter, String fieldName, - {required bool allowsUndefined, required bool allowsNull}) { - reporter.push(fieldName); - try { - if (!allowsUndefined && !map.containsKey(fieldName)) { - reporter.reportError('must not be undefined'); - return false; - } - final value = map[fieldName]; - final nullCheck = allowsNull || allowsUndefined; - if (!nullCheck && value == null) { - reporter.reportError('must not be null'); - return false; - } - if ((!nullCheck || value != null) && - !SignatureHelpClientCapabilitiesSignatureInformation.canParse( - value, reporter)) { - return false; - } - } finally { - reporter.pop(); - } - return true; -} - bool _canParseSignatureHelpContext( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { @@ -5889,7 +6258,7 @@ return true; } -bool _canParseSignatureInformationParameterInformation( +bool _canParseStaleRequestSupportOptions( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { reporter.push(fieldName); @@ -5905,7 +6274,7 @@ return false; } if ((!nullCheck || value != null) && - !SignatureInformationParameterInformation.canParse(value, reporter)) { + !StaleRequestSupportOptions.canParse(value, reporter)) { return false; } } finally { @@ -5966,6 +6335,57 @@ return true; } +bool _canParseStringStringValue( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + (value is! String && !StringValue.canParse(value, reporter))) { + reporter.reportError('must be of type Either2<String, StringValue>'); + return false; + } + } finally { + reporter.pop(); + } + return true; +} + +bool _canParseStringValue( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + !StringValue.canParse(value, reporter)) { + return false; + } + } finally { + reporter.pop(); + } + return true; +} + bool _canParseSymbolKind( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { @@ -6016,6 +6436,85 @@ return true; } +bool _canParseTextDocumentContentClientCapabilities( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + !TextDocumentContentClientCapabilities.canParse(value, reporter)) { + return false; + } + } finally { + reporter.pop(); + } + return true; +} + +bool _canParseTextDocumentContentOptionsTextDocumentContentRegistrationOptions( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + (!TextDocumentContentOptions.canParse(value, reporter) && + !TextDocumentContentRegistrationOptions.canParse( + value, reporter))) { + reporter.reportError( + 'must be of type Either2<TextDocumentContentOptions, TextDocumentContentRegistrationOptions>'); + return false; + } + } finally { + reporter.pop(); + } + return true; +} + +bool _canParseTextDocumentFilterClientCapabilities( + Map<String, Object?> map, LspJsonReporter reporter, String fieldName, + {required bool allowsUndefined, required bool allowsNull}) { + reporter.push(fieldName); + try { + if (!allowsUndefined && !map.containsKey(fieldName)) { + reporter.reportError('must not be undefined'); + return false; + } + final value = map[fieldName]; + final nullCheck = allowsNull || allowsUndefined; + if (!nullCheck && value == null) { + reporter.reportError('must not be null'); + return false; + } + if ((!nullCheck || value != null) && + !TextDocumentFilterClientCapabilities.canParse(value, reporter)) { + return false; + } + } finally { + reporter.pop(); + } + return true; +} + bool _canParseTextDocumentIdentifier( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { @@ -6570,7 +7069,7 @@ return true; } -bool _canParseWorkspaceEditClientCapabilitiesChangeAnnotationSupport( +bool _canParseWorkspaceEditMetadata( Map<String, Object?> map, LspJsonReporter reporter, String fieldName, {required bool allowsUndefined, required bool allowsNull}) { reporter.push(fieldName); @@ -6586,8 +7085,7 @@ return false; } if ((!nullCheck || value != null) && - !WorkspaceEditClientCapabilitiesChangeAnnotationSupport.canParse( - value, reporter)) { + !WorkspaceEditMetadata.canParse(value, reporter)) { return false; } } finally { @@ -6696,84 +7194,6 @@ return true; } -bool _canParseWorkspaceSymbolClientCapabilitiesResolveSupport( - Map<String, Object?> map, LspJsonReporter reporter, String fieldName, - {required bool allowsUndefined, required bool allowsNull}) { - reporter.push(fieldName); - try { - if (!allowsUndefined && !map.containsKey(fieldName)) { - reporter.reportError('must not be undefined'); - return false; - } - final value = map[fieldName]; - final nullCheck = allowsNull || allowsUndefined; - if (!nullCheck && value == null) { - reporter.reportError('must not be null'); - return false; - } - if ((!nullCheck || value != null) && - !WorkspaceSymbolClientCapabilitiesResolveSupport.canParse( - value, reporter)) { - return false; - } - } finally { - reporter.pop(); - } - return true; -} - -bool _canParseWorkspaceSymbolClientCapabilitiesSymbolKind( - Map<String, Object?> map, LspJsonReporter reporter, String fieldName, - {required bool allowsUndefined, required bool allowsNull}) { - reporter.push(fieldName); - try { - if (!allowsUndefined && !map.containsKey(fieldName)) { - reporter.reportError('must not be undefined'); - return false; - } - final value = map[fieldName]; - final nullCheck = allowsNull || allowsUndefined; - if (!nullCheck && value == null) { - reporter.reportError('must not be null'); - return false; - } - if ((!nullCheck || value != null) && - !WorkspaceSymbolClientCapabilitiesSymbolKind.canParse( - value, reporter)) { - return false; - } - } finally { - reporter.pop(); - } - return true; -} - -bool _canParseWorkspaceSymbolClientCapabilitiesTagSupport( - Map<String, Object?> map, LspJsonReporter reporter, String fieldName, - {required bool allowsUndefined, required bool allowsNull}) { - reporter.push(fieldName); - try { - if (!allowsUndefined && !map.containsKey(fieldName)) { - reporter.reportError('must not be undefined'); - return false; - } - final value = map[fieldName]; - final nullCheck = allowsNull || allowsUndefined; - if (!nullCheck && value == null) { - reporter.reportError('must not be null'); - return false; - } - if ((!nullCheck || value != null) && - !WorkspaceSymbolClientCapabilitiesTagSupport.canParse( - value, reporter)) { - return false; - } - } finally { - reporter.pop(); - } - return true; -} - Either3<AnnotatedTextEdit, SnippetableTextEdit, TextEdit> _eitherAnnotatedTextEditSnippetableTextEditTextEdit(Object? value) { return AnnotatedTextEdit.canParse(value, nullLspJsonReporter) @@ -6801,6 +7221,28 @@ : throw '$value was not one of (bool, CallHierarchyOptions, CallHierarchyRegistrationOptions)'; } +Either2<bool, ClientSemanticTokensRequestFullDelta> + _eitherBoolClientSemanticTokensRequestFullDelta(Object? value) { + return value is bool + ? Either2.t1(value) + : ClientSemanticTokensRequestFullDelta.canParse( + value, nullLspJsonReporter) + ? Either2.t2(ClientSemanticTokensRequestFullDelta.fromJson( + value as Map<String, Object?>)) + : throw '$value was not one of (bool, ClientSemanticTokensRequestFullDelta)'; +} + +Either2<bool, ClientSemanticTokensRequestOptionsRange> + _eitherBoolClientSemanticTokensRequestOptionsRange(Object? value) { + return value is bool + ? Either2.t1(value) + : ClientSemanticTokensRequestOptionsRange.canParse( + value, nullLspJsonReporter) + ? Either2.t2(ClientSemanticTokensRequestOptionsRange.fromJson( + value as Map<String, Object?>)) + : throw '$value was not one of (bool, ClientSemanticTokensRequestOptionsRange)'; +} + Either2<bool, CodeActionOptions> _eitherBoolCodeActionOptions(Object? value) { return value is bool ? Either2.t1(value) @@ -6936,6 +7378,16 @@ : throw '$value was not one of (bool, InlayHintOptions, InlayHintRegistrationOptions)'; } +Either2<bool, InlineCompletionOptions> _eitherBoolInlineCompletionOptions( + Object? value) { + return value is bool + ? Either2.t1(value) + : InlineCompletionOptions.canParse(value, nullLspJsonReporter) + ? Either2.t2( + InlineCompletionOptions.fromJson(value as Map<String, Object?>)) + : throw '$value was not one of (bool, InlineCompletionOptions)'; +} + Either3<bool, InlineValueOptions, InlineValueRegistrationOptions> _eitherBoolInlineValueOptionsInlineValueRegistrationOptions(Object? value) { return value is bool @@ -7015,28 +7467,6 @@ : throw '$value was not one of (bool, SelectionRangeOptions, SelectionRangeRegistrationOptions)'; } -Either2<bool, SemanticTokensClientCapabilitiesRequestsFull> - _eitherBoolSemanticTokensClientCapabilitiesRequestsFull(Object? value) { - return value is bool - ? Either2.t1(value) - : SemanticTokensClientCapabilitiesRequestsFull.canParse( - value, nullLspJsonReporter) - ? Either2.t2(SemanticTokensClientCapabilitiesRequestsFull.fromJson( - value as Map<String, Object?>)) - : throw '$value was not one of (bool, SemanticTokensClientCapabilitiesRequestsFull)'; -} - -Either2<bool, SemanticTokensClientCapabilitiesRequestsRange> - _eitherBoolSemanticTokensClientCapabilitiesRequestsRange(Object? value) { - return value is bool - ? Either2.t1(value) - : SemanticTokensClientCapabilitiesRequestsRange.canParse( - value, nullLspJsonReporter) - ? Either2.t2(SemanticTokensClientCapabilitiesRequestsRange.fromJson( - value as Map<String, Object?>)) - : throw '$value was not one of (bool, SemanticTokensClientCapabilitiesRequestsRange)'; -} - Either2<bool, SemanticTokensFullDelta> _eitherBoolSemanticTokensFullDelta( Object? value) { return value is bool @@ -7182,14 +7612,13 @@ : throw '$value was not one of (List<InlayHintLabelPart>, String)'; } -Either2<Location, WorkspaceSymbolLocation> - _eitherLocationWorkspaceSymbolLocation(Object? value) { +Either2<Location, LocationUriOnly> _eitherLocationLocationUriOnly( + Object? value) { return Location.canParse(value, nullLspJsonReporter) ? Either2.t1(Location.fromJson(value as Map<String, Object?>)) - : WorkspaceSymbolLocation.canParse(value, nullLspJsonReporter) - ? Either2.t2( - WorkspaceSymbolLocation.fromJson(value as Map<String, Object?>)) - : throw '$value was not one of (Location, WorkspaceSymbolLocation)'; + : LocationUriOnly.canParse(value, nullLspJsonReporter) + ? Either2.t2(LocationUriOnly.fromJson(value as Map<String, Object?>)) + : throw '$value was not one of (Location, LocationUriOnly)'; } Either2<MarkupContent, String> _eitherMarkupContentString(Object? value) { @@ -7200,36 +7629,49 @@ : throw '$value was not one of (MarkupContent, String)'; } -Either3<NotebookDocumentFilter1, NotebookDocumentFilter2, - NotebookDocumentFilter3> - _eitherNotebookDocumentFilter1NotebookDocumentFilter2NotebookDocumentFilter3( +Either3<NotebookDocumentFilterNotebookType, NotebookDocumentFilterPattern, + NotebookDocumentFilterScheme> + _eitherNotebookDocumentFilterNotebookTypeNotebookDocumentFilterPatternNotebookDocumentFilterScheme( Object? value) { - return NotebookDocumentFilter1.canParse(value, nullLspJsonReporter) - ? Either3.t1( - NotebookDocumentFilter1.fromJson(value as Map<String, Object?>)) - : NotebookDocumentFilter2.canParse(value, nullLspJsonReporter) - ? Either3.t2( - NotebookDocumentFilter2.fromJson(value as Map<String, Object?>)) - : NotebookDocumentFilter3.canParse(value, nullLspJsonReporter) - ? Either3.t3(NotebookDocumentFilter3.fromJson( + return NotebookDocumentFilterNotebookType.canParse(value, nullLspJsonReporter) + ? Either3.t1(NotebookDocumentFilterNotebookType.fromJson( + value as Map<String, Object?>)) + : NotebookDocumentFilterPattern.canParse(value, nullLspJsonReporter) + ? Either3.t2(NotebookDocumentFilterPattern.fromJson( + value as Map<String, Object?>)) + : NotebookDocumentFilterScheme.canParse(value, nullLspJsonReporter) + ? Either3.t3(NotebookDocumentFilterScheme.fromJson( value as Map<String, Object?>)) - : throw '$value was not one of (NotebookDocumentFilter1, NotebookDocumentFilter2, NotebookDocumentFilter3)'; + : throw '$value was not one of (NotebookDocumentFilterNotebookType, NotebookDocumentFilterPattern, NotebookDocumentFilterScheme)'; } Either2<NotebookDocumentFilter, String> - _eitherNotebookDocumentFilter1NotebookDocumentFilter2NotebookDocumentFilter3String( + _eitherNotebookDocumentFilterNotebookTypeNotebookDocumentFilterPatternNotebookDocumentFilterSchemeString( Object? value) { - return NotebookDocumentFilter1.canParse(value, nullLspJsonReporter) || - NotebookDocumentFilter2.canParse(value, nullLspJsonReporter) || - NotebookDocumentFilter3.canParse(value, nullLspJsonReporter) + return NotebookDocumentFilterNotebookType.canParse( + value, nullLspJsonReporter) || + NotebookDocumentFilterPattern.canParse(value, nullLspJsonReporter) || + NotebookDocumentFilterScheme.canParse(value, nullLspJsonReporter) ? Either2.t1( - _eitherNotebookDocumentFilter1NotebookDocumentFilter2NotebookDocumentFilter3( + _eitherNotebookDocumentFilterNotebookTypeNotebookDocumentFilterPatternNotebookDocumentFilterScheme( value)) : value is String ? Either2.t2(value) : throw '$value was not one of (NotebookDocumentFilter, String)'; } +Either2<NotebookDocumentFilterWithCells, NotebookDocumentFilterWithNotebook> + _eitherNotebookDocumentFilterWithCellsNotebookDocumentFilterWithNotebook( + Object? value) { + return NotebookDocumentFilterWithCells.canParse(value, nullLspJsonReporter) + ? Either2.t1(NotebookDocumentFilterWithCells.fromJson( + value as Map<String, Object?>)) + : NotebookDocumentFilterWithNotebook.canParse(value, nullLspJsonReporter) + ? Either2.t2(NotebookDocumentFilterWithNotebook.fromJson( + value as Map<String, Object?>)) + : throw '$value was not one of (NotebookDocumentFilterWithCells, NotebookDocumentFilterWithNotebook)'; +} + Either2<NotebookDocumentSyncOptions, NotebookDocumentSyncRegistrationOptions> _eitherNotebookDocumentSyncOptionsNotebookDocumentSyncRegistrationOptions( Object? value) { @@ -7243,21 +7685,6 @@ : throw '$value was not one of (NotebookDocumentSyncOptions, NotebookDocumentSyncRegistrationOptions)'; } -Either2<NotebookDocumentSyncOptionsNotebookSelector, - NotebookDocumentSyncOptionsNotebookSelector2> - _eitherNotebookDocumentSyncOptionsNotebookSelectorNotebookDocumentSyncOptionsNotebookSelector2( - Object? value) { - return NotebookDocumentSyncOptionsNotebookSelector.canParse( - value, nullLspJsonReporter) - ? Either2.t1(NotebookDocumentSyncOptionsNotebookSelector.fromJson( - value as Map<String, Object?>)) - : NotebookDocumentSyncOptionsNotebookSelector2.canParse( - value, nullLspJsonReporter) - ? Either2.t2(NotebookDocumentSyncOptionsNotebookSelector2.fromJson( - value as Map<String, Object?>)) - : throw '$value was not one of (NotebookDocumentSyncOptionsNotebookSelector, NotebookDocumentSyncOptionsNotebookSelector2)'; -} - Either2<SemanticTokensOptions, SemanticTokensRegistrationOptions> _eitherSemanticTokensOptionsSemanticTokensRegistrationOptions( Object? value) { @@ -7279,6 +7706,14 @@ : throw '$value was not one of (LspPattern, RelativePattern)'; } +Either2<String, StringValue> _eitherStringStringValue(Object? value) { + return value is String + ? Either2.t1(value) + : StringValue.canParse(value, nullLspJsonReporter) + ? Either2.t2(StringValue.fromJson(value as Map<String, Object?>)) + : throw '$value was not one of (String, StringValue)'; +} + Either2<TextDocumentContentChangePartial, TextDocumentContentChangeWholeDocument> _eitherTextDocumentContentChangePartialTextDocumentContentChangeWholeDocument( @@ -7293,6 +7728,19 @@ : throw '$value was not one of (TextDocumentContentChangePartial, TextDocumentContentChangeWholeDocument)'; } +Either2<TextDocumentContentOptions, TextDocumentContentRegistrationOptions> + _eitherTextDocumentContentOptionsTextDocumentContentRegistrationOptions( + Object? value) { + return TextDocumentContentOptions.canParse(value, nullLspJsonReporter) + ? Either2.t1( + TextDocumentContentOptions.fromJson(value as Map<String, Object?>)) + : TextDocumentContentRegistrationOptions.canParse( + value, nullLspJsonReporter) + ? Either2.t2(TextDocumentContentRegistrationOptions.fromJson( + value as Map<String, Object?>)) + : throw '$value was not one of (TextDocumentContentOptions, TextDocumentContentRegistrationOptions)'; +} + Either2<TextDocumentSyncKind, TextDocumentSyncOptions> _eitherTextDocumentSyncKindTextDocumentSyncOptions(Object? value) { return TextDocumentSyncKind.canParse(value, nullLspJsonReporter) @@ -7341,8 +7789,6 @@ /// An identifier to refer to a change annotation stored with a workspace edit. typedef ChangeAnnotationIdentifier = String; -typedef CodeActionLiteralSupportCodeActionKind = ClientCodeActionKindOptions; - /// The declaration of a symbol representation as one or many [Location]. typedef Declaration = Either2<List<Location>, Location>; @@ -7381,7 +7827,7 @@ /// A document filter describes a top level text document or a notebook cell /// document. /// -/// @since 3.17.0 - proposed support for NotebookCellTextDocumentFilter. +/// @since 3.17.0 - support for NotebookCellTextDocumentFilter. typedef DocumentFilter = Either2<NotebookCellTextDocumentFilter, TextDocumentFilter>; @@ -7414,7 +7860,7 @@ /// The glob pattern to watch relative to the base path. Glob patterns can have /// the following syntax: -/// - `*` to match one or more characters in a path segment +/// - `*` to match zero or more characters in a path segment /// - `?` to match on one character in a path segment /// - `**` to match any number of path segments, including none /// - `{}` to group conditions (e.g. `**/*.{ts,js}` matches all TypeScript and @@ -7432,14 +7878,16 @@ /// with documents) /// /// @since 3.17.0 -typedef NotebookDocumentFilter = Either3<NotebookDocumentFilter1, - NotebookDocumentFilter2, NotebookDocumentFilter3>; +typedef NotebookDocumentFilter = Either3<NotebookDocumentFilterNotebookType, + NotebookDocumentFilterPattern, NotebookDocumentFilterScheme>; typedef PrepareRenameResult - = Either3<PrepareRenamePlaceholder, PrepareRenameResult2, Range>; + = Either3<PrepareRenameDefaultBehavior, PrepareRenamePlaceholder, Range>; typedef ProgressToken = Either2<int, String>; +typedef RegularExpressionEngineKind = String; + /// Result for a request to provide commands for the given text document and /// range. typedef TextDocumentCodeActionResult @@ -7467,9 +7915,6 @@ typedef TextDocumentContentChangeEvent = Either2< TextDocumentContentChangePartial, TextDocumentContentChangeWholeDocument>; -typedef TextDocumentContentChangeEvent2 - = TextDocumentContentChangeWholeDocument; - /// Result for a request to resolve the type definition locations of a symbol at /// a given text document position. The request's parameter is of type /// [TextDocumentPositionParams] the response is of type [Declaration] or a @@ -7505,7 +7950,7 @@ /// glob-pattern that is applied to the [TextDocument.fileName]. /// /// Glob patterns can have the following syntax: -/// - `*` to match one or more characters in a path segment +/// - `*` to match zero 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}` @@ -7521,8 +7966,8 @@ /// language: 'json', pattern: '**package.json' }` /// /// @since 3.17.0 -typedef TextDocumentFilter = Either3<TextDocumentFilter1, - TextDocumentFilterScheme, TextDocumentFilter3>; +typedef TextDocumentFilter = Either3<TextDocumentFilterLanguage, + TextDocumentFilterPattern, TextDocumentFilterScheme>; /// Result for a request to provide folding ranges in a document. The request's /// parameter is of type [FoldingRangeParams], the response is of type @@ -7551,6 +7996,15 @@ /// @since 3.17.0 typedef TextDocumentInlayHintResult = List<InlayHint>?; +/// Result for a request to provide inline completions in a document. The +/// request's parameter is of type [InlineCompletionParams], the response is of +/// type +/// [InlineCompletion] or a [Future] that resolves to such. +/// +/// @since 3.18.0 +typedef TextDocumentInlineCompletionResult + = Either2<InlineCompletionList, List<InlineCompletionItem>>?; + /// Result for a request to provide inline values in a document. The request's /// parameter is of type [InlineValueParams], the response is of type /// [InlineValue] or a [Future] that resolves to such. @@ -7593,6 +8047,11 @@ /// Result for a request to format a range in a document. typedef TextDocumentRangeFormattingResult = List<TextEdit>?; +/// Result for a request to format ranges in a document. +/// +/// @since 3.18.0 +typedef TextDocumentRangesFormattingResult = List<TextEdit>?; + /// Result for a request to resolve project-wide references for the symbol /// denoted by the given text document position. The request's parameter is of /// type [ReferenceParams] the response is of type @@ -7786,6 +8245,41 @@ } } +/// Defines how values from a set of defaults and an individual item will be +/// merged. +/// +/// @since 3.18.0 +class ApplyKind implements ToJsonable { + /// The value from the item will be merged with the default. + /// + /// The specific rules for mergeing values are defined against each field that + /// supports merging. + static const Merge = ApplyKind(2); + + /// The value from the individual item (if provided and not `null`) will be + /// used instead of the default. + static const Replace = ApplyKind(1); + + final int _value; + + const ApplyKind(this._value); + const ApplyKind.fromJson(this._value); + @override + int get hashCode => _value.hashCode; + + @override + bool operator ==(Object other) => + other is ApplyKind && other._value == _value; + + @override + int toJson() => _value; + + @override + String toString() => _value.toString(); + + static bool canParse(Object? obj, LspJsonReporter reporter) => obj is int; +} + /// The parameters passed via an apply workspace edit request. class ApplyWorkspaceEditParams implements ToJsonable { static const jsonHandler = LspJsonHandler( @@ -7800,14 +8294,20 @@ /// user interface for example on an undo stack to undo the workspace edit. final String? label; + /// Additional data about the edit. + /// + /// @since 3.18.0 + final WorkspaceEditMetadata? metadata; ApplyWorkspaceEditParams({ required this.edit, this.label, + this.metadata, }); @override int get hashCode => Object.hash( edit, label, + metadata, ); @override @@ -7815,7 +8315,8 @@ return other is ApplyWorkspaceEditParams && other.runtimeType == ApplyWorkspaceEditParams && edit == other.edit && - label == other.label; + label == other.label && + metadata == other.metadata; } @override @@ -7825,6 +8326,9 @@ if (label != null) { result['label'] = label; } + if (metadata != null) { + result['metadata'] = metadata?.toJson(); + } return result; } @@ -7837,7 +8341,11 @@ allowsUndefined: false, allowsNull: false)) { return false; } - return _canParseString(obj, reporter, 'label', + if (!_canParseString(obj, reporter, 'label', + allowsUndefined: true, allowsNull: false)) { + return false; + } + return _canParseWorkspaceEditMetadata(obj, reporter, 'metadata', allowsUndefined: true, allowsNull: false); } else { reporter.reportError('must be of type ApplyWorkspaceEditParams'); @@ -7850,9 +8358,14 @@ final edit = WorkspaceEdit.fromJson(editJson as Map<String, Object?>); final labelJson = json['label']; final label = labelJson as String?; + final metadataJson = json['metadata']; + final metadata = metadataJson != null + ? WorkspaceEditMetadata.fromJson(metadataJson as Map<String, Object?>) + : null; return ApplyWorkspaceEditParams( edit: edit, label: label, + metadata: metadata, ); } } @@ -9011,6 +9524,63 @@ } } +/// @since 3.18.0 +class ChangeAnnotationsSupportOptions implements ToJsonable { + static const jsonHandler = LspJsonHandler( + ChangeAnnotationsSupportOptions.canParse, + ChangeAnnotationsSupportOptions.fromJson, + ); + + /// 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; + + ChangeAnnotationsSupportOptions({ + this.groupsOnLabel, + }); + + @override + int get hashCode => groupsOnLabel.hashCode; + + @override + bool operator ==(Object other) { + return other is ChangeAnnotationsSupportOptions && + other.runtimeType == ChangeAnnotationsSupportOptions && + groupsOnLabel == other.groupsOnLabel; + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + if (groupsOnLabel != null) { + result['groupsOnLabel'] = groupsOnLabel; + } + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + return _canParseBool(obj, reporter, 'groupsOnLabel', + allowsUndefined: true, allowsNull: false); + } else { + reporter.reportError('must be of type ChangeAnnotationsSupportOptions'); + return false; + } + } + + static ChangeAnnotationsSupportOptions fromJson(Map<String, Object?> json) { + final groupsOnLabelJson = json['groupsOnLabel']; + final groupsOnLabel = groupsOnLabelJson as bool?; + return ChangeAnnotationsSupportOptions( + groupsOnLabel: groupsOnLabel, + ); + } +} + /// Defines the capabilities provided by the client. class ClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( @@ -9162,6 +9732,7 @@ } } +/// @since 3.18.0 class ClientCodeActionKindOptions implements ToJsonable { static const jsonHandler = LspJsonHandler( ClientCodeActionKindOptions.canParse, @@ -9218,6 +9789,467 @@ } } +/// @since 3.18.0 +class ClientCodeActionLiteralOptions implements ToJsonable { + static const jsonHandler = LspJsonHandler( + ClientCodeActionLiteralOptions.canParse, + ClientCodeActionLiteralOptions.fromJson, + ); + + /// The code action kind is support with the following value set. + final ClientCodeActionKindOptions codeActionKind; + + ClientCodeActionLiteralOptions({ + required this.codeActionKind, + }); + + @override + int get hashCode => codeActionKind.hashCode; + + @override + bool operator ==(Object other) { + return other is ClientCodeActionLiteralOptions && + other.runtimeType == ClientCodeActionLiteralOptions && + codeActionKind == other.codeActionKind; + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + result['codeActionKind'] = codeActionKind.toJson(); + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + return _canParseClientCodeActionKindOptions( + obj, reporter, 'codeActionKind', + allowsUndefined: false, allowsNull: false); + } else { + reporter.reportError('must be of type ClientCodeActionLiteralOptions'); + return false; + } + } + + static ClientCodeActionLiteralOptions fromJson(Map<String, Object?> json) { + final codeActionKindJson = json['codeActionKind']; + final codeActionKind = ClientCodeActionKindOptions.fromJson( + codeActionKindJson as Map<String, Object?>); + return ClientCodeActionLiteralOptions( + codeActionKind: codeActionKind, + ); + } +} + +/// @since 3.18.0 +class ClientCodeActionResolveOptions implements ToJsonable { + static const jsonHandler = LspJsonHandler( + ClientCodeActionResolveOptions.canParse, + ClientCodeActionResolveOptions.fromJson, + ); + + /// The properties that a client can resolve lazily. + final List<String> properties; + + ClientCodeActionResolveOptions({ + required this.properties, + }); + + @override + int get hashCode => lspHashCode(properties); + + @override + bool operator ==(Object other) { + return other is ClientCodeActionResolveOptions && + other.runtimeType == ClientCodeActionResolveOptions && + const DeepCollectionEquality().equals(properties, other.properties); + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + result['properties'] = properties; + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + return _canParseListString(obj, reporter, 'properties', + allowsUndefined: false, allowsNull: false); + } else { + reporter.reportError('must be of type ClientCodeActionResolveOptions'); + return false; + } + } + + static ClientCodeActionResolveOptions fromJson(Map<String, Object?> json) { + final propertiesJson = json['properties']; + final properties = (propertiesJson as List<Object?>) + .map((item) => item as String) + .toList(); + return ClientCodeActionResolveOptions( + properties: properties, + ); + } +} + +/// @since 3.18.0 +class ClientCodeLensResolveOptions implements ToJsonable { + static const jsonHandler = LspJsonHandler( + ClientCodeLensResolveOptions.canParse, + ClientCodeLensResolveOptions.fromJson, + ); + + /// The properties that a client can resolve lazily. + final List<String> properties; + + ClientCodeLensResolveOptions({ + required this.properties, + }); + + @override + int get hashCode => lspHashCode(properties); + + @override + bool operator ==(Object other) { + return other is ClientCodeLensResolveOptions && + other.runtimeType == ClientCodeLensResolveOptions && + const DeepCollectionEquality().equals(properties, other.properties); + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + result['properties'] = properties; + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + return _canParseListString(obj, reporter, 'properties', + allowsUndefined: false, allowsNull: false); + } else { + reporter.reportError('must be of type ClientCodeLensResolveOptions'); + return false; + } + } + + static ClientCodeLensResolveOptions fromJson(Map<String, Object?> json) { + final propertiesJson = json['properties']; + final properties = (propertiesJson as List<Object?>) + .map((item) => item as String) + .toList(); + return ClientCodeLensResolveOptions( + properties: properties, + ); + } +} + +/// @since 3.18.0 +class ClientCompletionItemInsertTextModeOptions implements ToJsonable { + static const jsonHandler = LspJsonHandler( + ClientCompletionItemInsertTextModeOptions.canParse, + ClientCompletionItemInsertTextModeOptions.fromJson, + ); + + final List<InsertTextMode> valueSet; + + ClientCompletionItemInsertTextModeOptions({ + required this.valueSet, + }); + + @override + int get hashCode => lspHashCode(valueSet); + + @override + bool operator ==(Object other) { + return other is ClientCompletionItemInsertTextModeOptions && + other.runtimeType == ClientCompletionItemInsertTextModeOptions && + const DeepCollectionEquality().equals(valueSet, other.valueSet); + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + result['valueSet'] = valueSet.map((item) => item.toJson()).toList(); + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + return _canParseListInsertTextMode(obj, reporter, 'valueSet', + allowsUndefined: false, allowsNull: false); + } else { + reporter.reportError( + 'must be of type ClientCompletionItemInsertTextModeOptions'); + return false; + } + } + + static ClientCompletionItemInsertTextModeOptions fromJson( + Map<String, Object?> json) { + final valueSetJson = json['valueSet']; + final valueSet = (valueSetJson as List<Object?>) + .map((item) => InsertTextMode.fromJson(item as int)) + .toList(); + return ClientCompletionItemInsertTextModeOptions( + valueSet: valueSet, + ); + } +} + +/// @since 3.18.0 +class ClientCompletionItemOptions implements ToJsonable { + static const jsonHandler = LspJsonHandler( + ClientCompletionItemOptions.canParse, + ClientCompletionItemOptions.fromJson, + ); + + /// Client supports commit characters on a completion item. + final bool? commitCharactersSupport; + + /// Client supports the deprecated property on a completion item. + final bool? deprecatedSupport; + + /// Client supports the following content formats for the documentation + /// property. The order describes the preferred format of the client. + final List<MarkupKind>? documentationFormat; + + /// 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 + 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 + final ClientCompletionItemInsertTextModeOptions? insertTextModeSupport; + + /// The client has support for completion item label details (see also + /// `CompletionItemLabelDetails`). + /// + /// @since 3.17.0 + final bool? labelDetailsSupport; + + /// Client supports the preselect property on a completion item. + final bool? preselectSupport; + + /// Indicates which properties a client can resolve lazily on a completion + /// item. Before version 3.16.0 only the predefined properties `documentation` + /// and `details` could be resolved lazily. + /// + /// @since 3.16.0 + final ClientCompletionItemResolveOptions? 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. + 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 + final CompletionItemTagOptions? tagSupport; + ClientCompletionItemOptions({ + this.commitCharactersSupport, + this.deprecatedSupport, + this.documentationFormat, + this.insertReplaceSupport, + this.insertTextModeSupport, + this.labelDetailsSupport, + this.preselectSupport, + this.resolveSupport, + this.snippetSupport, + this.tagSupport, + }); + @override + int get hashCode => Object.hash( + commitCharactersSupport, + deprecatedSupport, + lspHashCode(documentationFormat), + insertReplaceSupport, + insertTextModeSupport, + labelDetailsSupport, + preselectSupport, + resolveSupport, + snippetSupport, + tagSupport, + ); + + @override + bool operator ==(Object other) { + return other is ClientCompletionItemOptions && + other.runtimeType == ClientCompletionItemOptions && + commitCharactersSupport == other.commitCharactersSupport && + deprecatedSupport == other.deprecatedSupport && + const DeepCollectionEquality() + .equals(documentationFormat, other.documentationFormat) && + insertReplaceSupport == other.insertReplaceSupport && + insertTextModeSupport == other.insertTextModeSupport && + labelDetailsSupport == other.labelDetailsSupport && + preselectSupport == other.preselectSupport && + resolveSupport == other.resolveSupport && + snippetSupport == other.snippetSupport && + tagSupport == other.tagSupport; + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + if (commitCharactersSupport != null) { + result['commitCharactersSupport'] = commitCharactersSupport; + } + if (deprecatedSupport != null) { + result['deprecatedSupport'] = deprecatedSupport; + } + if (documentationFormat != null) { + result['documentationFormat'] = + documentationFormat?.map((item) => item.toJson()).toList(); + } + if (insertReplaceSupport != null) { + result['insertReplaceSupport'] = insertReplaceSupport; + } + if (insertTextModeSupport != null) { + result['insertTextModeSupport'] = insertTextModeSupport?.toJson(); + } + if (labelDetailsSupport != null) { + result['labelDetailsSupport'] = labelDetailsSupport; + } + if (preselectSupport != null) { + result['preselectSupport'] = preselectSupport; + } + if (resolveSupport != null) { + result['resolveSupport'] = resolveSupport?.toJson(); + } + if (snippetSupport != null) { + result['snippetSupport'] = snippetSupport; + } + if (tagSupport != null) { + result['tagSupport'] = tagSupport?.toJson(); + } + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + if (!_canParseBool(obj, reporter, 'commitCharactersSupport', + allowsUndefined: true, allowsNull: false)) { + return false; + } + if (!_canParseBool(obj, reporter, 'deprecatedSupport', + allowsUndefined: true, allowsNull: false)) { + return false; + } + if (!_canParseListMarkupKind(obj, reporter, 'documentationFormat', + allowsUndefined: true, allowsNull: false)) { + return false; + } + if (!_canParseBool(obj, reporter, 'insertReplaceSupport', + allowsUndefined: true, allowsNull: false)) { + return false; + } + if (!_canParseClientCompletionItemInsertTextModeOptions( + obj, reporter, 'insertTextModeSupport', + allowsUndefined: true, allowsNull: false)) { + return false; + } + if (!_canParseBool(obj, reporter, 'labelDetailsSupport', + allowsUndefined: true, allowsNull: false)) { + return false; + } + if (!_canParseBool(obj, reporter, 'preselectSupport', + allowsUndefined: true, allowsNull: false)) { + return false; + } + if (!_canParseClientCompletionItemResolveOptions( + obj, reporter, 'resolveSupport', + allowsUndefined: true, allowsNull: false)) { + return false; + } + if (!_canParseBool(obj, reporter, 'snippetSupport', + allowsUndefined: true, allowsNull: false)) { + return false; + } + return _canParseCompletionItemTagOptions(obj, reporter, 'tagSupport', + allowsUndefined: true, allowsNull: false); + } else { + reporter.reportError('must be of type ClientCompletionItemOptions'); + return false; + } + } + + static ClientCompletionItemOptions fromJson(Map<String, Object?> json) { + final commitCharactersSupportJson = json['commitCharactersSupport']; + final commitCharactersSupport = commitCharactersSupportJson as bool?; + final deprecatedSupportJson = json['deprecatedSupport']; + final deprecatedSupport = deprecatedSupportJson as bool?; + final documentationFormatJson = json['documentationFormat']; + final documentationFormat = (documentationFormatJson as List<Object?>?) + ?.map((item) => MarkupKind.fromJson(item as String)) + .toList(); + final insertReplaceSupportJson = json['insertReplaceSupport']; + final insertReplaceSupport = insertReplaceSupportJson as bool?; + final insertTextModeSupportJson = json['insertTextModeSupport']; + final insertTextModeSupport = insertTextModeSupportJson != null + ? ClientCompletionItemInsertTextModeOptions.fromJson( + insertTextModeSupportJson as Map<String, Object?>) + : null; + final labelDetailsSupportJson = json['labelDetailsSupport']; + final labelDetailsSupport = labelDetailsSupportJson as bool?; + final preselectSupportJson = json['preselectSupport']; + final preselectSupport = preselectSupportJson as bool?; + final resolveSupportJson = json['resolveSupport']; + final resolveSupport = resolveSupportJson != null + ? ClientCompletionItemResolveOptions.fromJson( + resolveSupportJson as Map<String, Object?>) + : null; + final snippetSupportJson = json['snippetSupport']; + final snippetSupport = snippetSupportJson as bool?; + final tagSupportJson = json['tagSupport']; + final tagSupport = tagSupportJson != null + ? CompletionItemTagOptions.fromJson( + tagSupportJson as Map<String, Object?>) + : null; + return ClientCompletionItemOptions( + commitCharactersSupport: commitCharactersSupport, + deprecatedSupport: deprecatedSupport, + documentationFormat: documentationFormat, + insertReplaceSupport: insertReplaceSupport, + insertTextModeSupport: insertTextModeSupport, + labelDetailsSupport: labelDetailsSupport, + preselectSupport: preselectSupport, + resolveSupport: resolveSupport, + snippetSupport: snippetSupport, + tagSupport: tagSupport, + ); + } +} + +/// @since 3.18.0 class ClientCompletionItemOptionsKind implements ToJsonable { static const jsonHandler = LspJsonHandler( ClientCompletionItemOptionsKind.canParse, @@ -9280,6 +10312,239 @@ } } +/// @since 3.18.0 +class ClientCompletionItemResolveOptions implements ToJsonable { + static const jsonHandler = LspJsonHandler( + ClientCompletionItemResolveOptions.canParse, + ClientCompletionItemResolveOptions.fromJson, + ); + + /// The properties that a client can resolve lazily. + final List<String> properties; + + ClientCompletionItemResolveOptions({ + required this.properties, + }); + + @override + int get hashCode => lspHashCode(properties); + + @override + bool operator ==(Object other) { + return other is ClientCompletionItemResolveOptions && + other.runtimeType == ClientCompletionItemResolveOptions && + const DeepCollectionEquality().equals(properties, other.properties); + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + result['properties'] = properties; + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + return _canParseListString(obj, reporter, 'properties', + allowsUndefined: false, allowsNull: false); + } else { + reporter + .reportError('must be of type ClientCompletionItemResolveOptions'); + return false; + } + } + + static ClientCompletionItemResolveOptions fromJson( + Map<String, Object?> json) { + final propertiesJson = json['properties']; + final properties = (propertiesJson as List<Object?>) + .map((item) => item as String) + .toList(); + return ClientCompletionItemResolveOptions( + properties: properties, + ); + } +} + +/// @since 3.18.0 +class ClientDiagnosticsTagOptions implements ToJsonable { + static const jsonHandler = LspJsonHandler( + ClientDiagnosticsTagOptions.canParse, + ClientDiagnosticsTagOptions.fromJson, + ); + + /// The tags supported by the client. + final List<DiagnosticTag> valueSet; + + ClientDiagnosticsTagOptions({ + required this.valueSet, + }); + + @override + int get hashCode => lspHashCode(valueSet); + + @override + bool operator ==(Object other) { + return other is ClientDiagnosticsTagOptions && + other.runtimeType == ClientDiagnosticsTagOptions && + const DeepCollectionEquality().equals(valueSet, other.valueSet); + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + result['valueSet'] = valueSet.map((item) => item.toJson()).toList(); + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + return _canParseListDiagnosticTag(obj, reporter, 'valueSet', + allowsUndefined: false, allowsNull: false); + } else { + reporter.reportError('must be of type ClientDiagnosticsTagOptions'); + return false; + } + } + + static ClientDiagnosticsTagOptions fromJson(Map<String, Object?> json) { + final valueSetJson = json['valueSet']; + final valueSet = (valueSetJson as List<Object?>) + .map((item) => DiagnosticTag.fromJson(item as int)) + .toList(); + return ClientDiagnosticsTagOptions( + valueSet: valueSet, + ); + } +} + +/// @since 3.18.0 +class ClientFoldingRangeKindOptions implements ToJsonable { + static const jsonHandler = LspJsonHandler( + ClientFoldingRangeKindOptions.canParse, + ClientFoldingRangeKindOptions.fromJson, + ); + + /// The folding range kind values the client supports. When this property + /// exists the client also guarantees that it will handle values outside its + /// set gracefully and falls back to a default value when unknown. + final List<FoldingRangeKind>? valueSet; + + ClientFoldingRangeKindOptions({ + this.valueSet, + }); + + @override + int get hashCode => lspHashCode(valueSet); + + @override + bool operator ==(Object other) { + return other is ClientFoldingRangeKindOptions && + other.runtimeType == ClientFoldingRangeKindOptions && + const DeepCollectionEquality().equals(valueSet, other.valueSet); + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + if (valueSet != null) { + result['valueSet'] = valueSet?.map((item) => item.toJson()).toList(); + } + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + return _canParseListFoldingRangeKind(obj, reporter, 'valueSet', + allowsUndefined: true, allowsNull: false); + } else { + reporter.reportError('must be of type ClientFoldingRangeKindOptions'); + return false; + } + } + + static ClientFoldingRangeKindOptions fromJson(Map<String, Object?> json) { + final valueSetJson = json['valueSet']; + final valueSet = (valueSetJson as List<Object?>?) + ?.map((item) => FoldingRangeKind.fromJson(item as String)) + .toList(); + return ClientFoldingRangeKindOptions( + valueSet: valueSet, + ); + } +} + +/// @since 3.18.0 +class ClientFoldingRangeOptions implements ToJsonable { + static const jsonHandler = LspJsonHandler( + ClientFoldingRangeOptions.canParse, + ClientFoldingRangeOptions.fromJson, + ); + + /// 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 + final bool? collapsedText; + + ClientFoldingRangeOptions({ + this.collapsedText, + }); + + @override + int get hashCode => collapsedText.hashCode; + + @override + bool operator ==(Object other) { + return other is ClientFoldingRangeOptions && + other.runtimeType == ClientFoldingRangeOptions && + collapsedText == other.collapsedText; + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + if (collapsedText != null) { + result['collapsedText'] = collapsedText; + } + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + return _canParseBool(obj, reporter, 'collapsedText', + allowsUndefined: true, allowsNull: false); + } else { + reporter.reportError('must be of type ClientFoldingRangeOptions'); + return false; + } + } + + static ClientFoldingRangeOptions fromJson(Map<String, Object?> json) { + final collapsedTextJson = json['collapsedText']; + final collapsedText = collapsedTextJson as bool?; + return ClientFoldingRangeOptions( + collapsedText: collapsedText, + ); + } +} + +/// Information about the client +/// +/// @since 3.15.0 +/// @since 3.18.0 ClientInfo type name added. class ClientInfo implements ToJsonable { static const jsonHandler = LspJsonHandler( ClientInfo.canParse, @@ -9349,6 +10614,120 @@ } } +/// @since 3.18.0 +class ClientInlayHintResolveOptions implements ToJsonable { + static const jsonHandler = LspJsonHandler( + ClientInlayHintResolveOptions.canParse, + ClientInlayHintResolveOptions.fromJson, + ); + + /// The properties that a client can resolve lazily. + final List<String> properties; + + ClientInlayHintResolveOptions({ + required this.properties, + }); + + @override + int get hashCode => lspHashCode(properties); + + @override + bool operator ==(Object other) { + return other is ClientInlayHintResolveOptions && + other.runtimeType == ClientInlayHintResolveOptions && + const DeepCollectionEquality().equals(properties, other.properties); + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + result['properties'] = properties; + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + return _canParseListString(obj, reporter, 'properties', + allowsUndefined: false, allowsNull: false); + } else { + reporter.reportError('must be of type ClientInlayHintResolveOptions'); + return false; + } + } + + static ClientInlayHintResolveOptions fromJson(Map<String, Object?> json) { + final propertiesJson = json['properties']; + final properties = (propertiesJson as List<Object?>) + .map((item) => item as String) + .toList(); + return ClientInlayHintResolveOptions( + properties: properties, + ); + } +} + +/// @since 3.18.0 +class ClientSemanticTokensRequestFullDelta implements ToJsonable { + static const jsonHandler = LspJsonHandler( + ClientSemanticTokensRequestFullDelta.canParse, + ClientSemanticTokensRequestFullDelta.fromJson, + ); + + /// The client will send the `textDocument/semanticTokens/full/delta` request + /// if the server provides a corresponding handler. + final bool? delta; + + ClientSemanticTokensRequestFullDelta({ + this.delta, + }); + + @override + int get hashCode => delta.hashCode; + + @override + bool operator ==(Object other) { + return other is ClientSemanticTokensRequestFullDelta && + other.runtimeType == ClientSemanticTokensRequestFullDelta && + delta == other.delta; + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + if (delta != null) { + result['delta'] = delta; + } + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + return _canParseBool(obj, reporter, 'delta', + allowsUndefined: true, allowsNull: false); + } else { + reporter + .reportError('must be of type ClientSemanticTokensRequestFullDelta'); + return false; + } + } + + static ClientSemanticTokensRequestFullDelta fromJson( + Map<String, Object?> json) { + final deltaJson = json['delta']; + final delta = deltaJson as bool?; + return ClientSemanticTokensRequestFullDelta( + delta: delta, + ); + } +} + +/// @since 3.18.0 class ClientSemanticTokensRequestOptions implements ToJsonable { static const jsonHandler = LspJsonHandler( ClientSemanticTokensRequestOptions.canParse, @@ -9357,11 +10736,11 @@ /// The client will send the `textDocument/semanticTokens/full` request if the /// server provides a corresponding handler. - final Either2<bool, SemanticTokensClientCapabilitiesRequestsFull>? full; + final Either2<bool, ClientSemanticTokensRequestFullDelta>? full; /// The client will send the `textDocument/semanticTokens/range` request if /// the server provides a corresponding handler. - final Either2<bool, SemanticTokensClientCapabilitiesRequestsRange>? range; + final Either2<bool, ClientSemanticTokensRequestOptionsRange>? range; ClientSemanticTokensRequestOptions({ this.full, @@ -9398,12 +10777,12 @@ static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map<String, Object?>) { - if (!_canParseBoolSemanticTokensClientCapabilitiesRequestsFull( + if (!_canParseBoolClientSemanticTokensRequestFullDelta( obj, reporter, 'full', allowsUndefined: true, allowsNull: false)) { return false; } - return _canParseBoolSemanticTokensClientCapabilitiesRequestsRange( + return _canParseBoolClientSemanticTokensRequestOptionsRange( obj, reporter, 'range', allowsUndefined: true, allowsNull: false); } else { @@ -9418,11 +10797,11 @@ final fullJson = json['full']; final full = fullJson == null ? null - : _eitherBoolSemanticTokensClientCapabilitiesRequestsFull(fullJson); + : _eitherBoolClientSemanticTokensRequestFullDelta(fullJson); final rangeJson = json['range']; final range = rangeJson == null ? null - : _eitherBoolSemanticTokensClientCapabilitiesRequestsRange(rangeJson); + : _eitherBoolClientSemanticTokensRequestOptionsRange(rangeJson); return ClientSemanticTokensRequestOptions( full: full, range: range, @@ -9430,6 +10809,453 @@ } } +class ClientSemanticTokensRequestOptionsRange implements ToJsonable { + static const jsonHandler = LspJsonHandler( + ClientSemanticTokensRequestOptionsRange.canParse, + ClientSemanticTokensRequestOptionsRange.fromJson, + ); + + @override + int get hashCode => 42; + + @override + bool operator ==(Object other) { + return other is ClientSemanticTokensRequestOptionsRange && + other.runtimeType == ClientSemanticTokensRequestOptionsRange; + } + + @override + Map<String, Object?> toJson() => {}; + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + return true; + } else { + reporter.reportError( + 'must be of type ClientSemanticTokensRequestOptionsRange'); + return false; + } + } + + static ClientSemanticTokensRequestOptionsRange fromJson( + Map<String, Object?> json) { + return ClientSemanticTokensRequestOptionsRange(); + } +} + +/// @since 3.18.0 +class ClientShowMessageActionItemOptions implements ToJsonable { + static const jsonHandler = LspJsonHandler( + ClientShowMessageActionItemOptions.canParse, + ClientShowMessageActionItemOptions.fromJson, + ); + + /// Whether the client supports additional attributes which are preserved and + /// send back to the server in the request's response. + final bool? additionalPropertiesSupport; + + ClientShowMessageActionItemOptions({ + this.additionalPropertiesSupport, + }); + + @override + int get hashCode => additionalPropertiesSupport.hashCode; + + @override + bool operator ==(Object other) { + return other is ClientShowMessageActionItemOptions && + other.runtimeType == ClientShowMessageActionItemOptions && + additionalPropertiesSupport == other.additionalPropertiesSupport; + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + if (additionalPropertiesSupport != null) { + result['additionalPropertiesSupport'] = additionalPropertiesSupport; + } + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + return _canParseBool(obj, reporter, 'additionalPropertiesSupport', + allowsUndefined: true, allowsNull: false); + } else { + reporter + .reportError('must be of type ClientShowMessageActionItemOptions'); + return false; + } + } + + static ClientShowMessageActionItemOptions fromJson( + Map<String, Object?> json) { + final additionalPropertiesSupportJson = json['additionalPropertiesSupport']; + final additionalPropertiesSupport = + additionalPropertiesSupportJson as bool?; + return ClientShowMessageActionItemOptions( + additionalPropertiesSupport: additionalPropertiesSupport, + ); + } +} + +/// @since 3.18.0 +class ClientSignatureInformationOptions implements ToJsonable { + static const jsonHandler = LspJsonHandler( + ClientSignatureInformationOptions.canParse, + ClientSignatureInformationOptions.fromJson, + ); + + /// The client supports the `activeParameter` property on + /// `SignatureInformation` literal. + /// + /// @since 3.16.0 + final bool? activeParameterSupport; + + /// Client supports the following content formats for the documentation + /// property. The order describes the preferred format of the client. + final List<MarkupKind>? documentationFormat; + + /// The client supports the `activeParameter` property on + /// `SignatureHelp`/`SignatureInformation` being set to `null` to indicate + /// that no parameter should be active. + /// + /// @since 3.18.0 + final bool? noActiveParameterSupport; + + /// Client capabilities specific to parameter information. + final ClientSignatureParameterInformationOptions? parameterInformation; + ClientSignatureInformationOptions({ + this.activeParameterSupport, + this.documentationFormat, + this.noActiveParameterSupport, + this.parameterInformation, + }); + @override + int get hashCode => Object.hash( + activeParameterSupport, + lspHashCode(documentationFormat), + noActiveParameterSupport, + parameterInformation, + ); + + @override + bool operator ==(Object other) { + return other is ClientSignatureInformationOptions && + other.runtimeType == ClientSignatureInformationOptions && + activeParameterSupport == other.activeParameterSupport && + const DeepCollectionEquality() + .equals(documentationFormat, other.documentationFormat) && + noActiveParameterSupport == other.noActiveParameterSupport && + parameterInformation == other.parameterInformation; + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + if (activeParameterSupport != null) { + result['activeParameterSupport'] = activeParameterSupport; + } + if (documentationFormat != null) { + result['documentationFormat'] = + documentationFormat?.map((item) => item.toJson()).toList(); + } + if (noActiveParameterSupport != null) { + result['noActiveParameterSupport'] = noActiveParameterSupport; + } + if (parameterInformation != null) { + result['parameterInformation'] = parameterInformation?.toJson(); + } + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + if (!_canParseBool(obj, reporter, 'activeParameterSupport', + allowsUndefined: true, allowsNull: false)) { + return false; + } + if (!_canParseListMarkupKind(obj, reporter, 'documentationFormat', + allowsUndefined: true, allowsNull: false)) { + return false; + } + if (!_canParseBool(obj, reporter, 'noActiveParameterSupport', + allowsUndefined: true, allowsNull: false)) { + return false; + } + return _canParseClientSignatureParameterInformationOptions( + obj, reporter, 'parameterInformation', + allowsUndefined: true, allowsNull: false); + } else { + reporter.reportError('must be of type ClientSignatureInformationOptions'); + return false; + } + } + + static ClientSignatureInformationOptions fromJson(Map<String, Object?> json) { + final activeParameterSupportJson = json['activeParameterSupport']; + final activeParameterSupport = activeParameterSupportJson as bool?; + final documentationFormatJson = json['documentationFormat']; + final documentationFormat = (documentationFormatJson as List<Object?>?) + ?.map((item) => MarkupKind.fromJson(item as String)) + .toList(); + final noActiveParameterSupportJson = json['noActiveParameterSupport']; + final noActiveParameterSupport = noActiveParameterSupportJson as bool?; + final parameterInformationJson = json['parameterInformation']; + final parameterInformation = parameterInformationJson != null + ? ClientSignatureParameterInformationOptions.fromJson( + parameterInformationJson as Map<String, Object?>) + : null; + return ClientSignatureInformationOptions( + activeParameterSupport: activeParameterSupport, + documentationFormat: documentationFormat, + noActiveParameterSupport: noActiveParameterSupport, + parameterInformation: parameterInformation, + ); + } +} + +/// @since 3.18.0 +class ClientSignatureParameterInformationOptions implements ToJsonable { + static const jsonHandler = LspJsonHandler( + ClientSignatureParameterInformationOptions.canParse, + ClientSignatureParameterInformationOptions.fromJson, + ); + + /// The client supports processing label offsets instead of a simple label + /// string. + /// + /// @since 3.14.0 + final bool? labelOffsetSupport; + + ClientSignatureParameterInformationOptions({ + this.labelOffsetSupport, + }); + + @override + int get hashCode => labelOffsetSupport.hashCode; + + @override + bool operator ==(Object other) { + return other is ClientSignatureParameterInformationOptions && + other.runtimeType == ClientSignatureParameterInformationOptions && + labelOffsetSupport == other.labelOffsetSupport; + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + if (labelOffsetSupport != null) { + result['labelOffsetSupport'] = labelOffsetSupport; + } + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + return _canParseBool(obj, reporter, 'labelOffsetSupport', + allowsUndefined: true, allowsNull: false); + } else { + reporter.reportError( + 'must be of type ClientSignatureParameterInformationOptions'); + return false; + } + } + + static ClientSignatureParameterInformationOptions fromJson( + Map<String, Object?> json) { + final labelOffsetSupportJson = json['labelOffsetSupport']; + final labelOffsetSupport = labelOffsetSupportJson as bool?; + return ClientSignatureParameterInformationOptions( + labelOffsetSupport: labelOffsetSupport, + ); + } +} + +/// @since 3.18.0 +class ClientSymbolKindOptions implements ToJsonable { + static const jsonHandler = LspJsonHandler( + ClientSymbolKindOptions.canParse, + ClientSymbolKindOptions.fromJson, + ); + + /// The symbol kind values the client supports. When this property exists the + /// client also guarantees that it will handle values outside its set + /// gracefully and falls back to a default value when unknown. + /// + /// If this property is not present the client only supports the symbol kinds + /// from `File` to `Array` as defined in the initial version of the protocol. + final List<SymbolKind>? valueSet; + + ClientSymbolKindOptions({ + this.valueSet, + }); + + @override + int get hashCode => lspHashCode(valueSet); + + @override + bool operator ==(Object other) { + return other is ClientSymbolKindOptions && + other.runtimeType == ClientSymbolKindOptions && + const DeepCollectionEquality().equals(valueSet, other.valueSet); + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + if (valueSet != null) { + result['valueSet'] = valueSet?.map((item) => item.toJson()).toList(); + } + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + return _canParseListSymbolKind(obj, reporter, 'valueSet', + allowsUndefined: true, allowsNull: false); + } else { + reporter.reportError('must be of type ClientSymbolKindOptions'); + return false; + } + } + + static ClientSymbolKindOptions fromJson(Map<String, Object?> json) { + final valueSetJson = json['valueSet']; + final valueSet = (valueSetJson as List<Object?>?) + ?.map((item) => SymbolKind.fromJson(item as int)) + .toList(); + return ClientSymbolKindOptions( + valueSet: valueSet, + ); + } +} + +/// @since 3.18.0 +class ClientSymbolResolveOptions implements ToJsonable { + static const jsonHandler = LspJsonHandler( + ClientSymbolResolveOptions.canParse, + ClientSymbolResolveOptions.fromJson, + ); + + /// The properties that a client can resolve lazily. Usually `location.range` + final List<String> properties; + + ClientSymbolResolveOptions({ + required this.properties, + }); + + @override + int get hashCode => lspHashCode(properties); + + @override + bool operator ==(Object other) { + return other is ClientSymbolResolveOptions && + other.runtimeType == ClientSymbolResolveOptions && + const DeepCollectionEquality().equals(properties, other.properties); + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + result['properties'] = properties; + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + return _canParseListString(obj, reporter, 'properties', + allowsUndefined: false, allowsNull: false); + } else { + reporter.reportError('must be of type ClientSymbolResolveOptions'); + return false; + } + } + + static ClientSymbolResolveOptions fromJson(Map<String, Object?> json) { + final propertiesJson = json['properties']; + final properties = (propertiesJson as List<Object?>) + .map((item) => item as String) + .toList(); + return ClientSymbolResolveOptions( + properties: properties, + ); + } +} + +/// @since 3.18.0 +class ClientSymbolTagOptions implements ToJsonable { + static const jsonHandler = LspJsonHandler( + ClientSymbolTagOptions.canParse, + ClientSymbolTagOptions.fromJson, + ); + + /// The tags supported by the client. + final List<SymbolTag> valueSet; + + ClientSymbolTagOptions({ + required this.valueSet, + }); + + @override + int get hashCode => lspHashCode(valueSet); + + @override + bool operator ==(Object other) { + return other is ClientSymbolTagOptions && + other.runtimeType == ClientSymbolTagOptions && + const DeepCollectionEquality().equals(valueSet, other.valueSet); + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + result['valueSet'] = valueSet.map((item) => item.toJson()).toList(); + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + return _canParseListSymbolTag(obj, reporter, 'valueSet', + allowsUndefined: false, allowsNull: false); + } else { + reporter.reportError('must be of type ClientSymbolTagOptions'); + return false; + } + } + + static ClientSymbolTagOptions fromJson(Map<String, Object?> json) { + final valueSetJson = json['valueSet']; + final valueSet = (valueSetJson as List<Object?>) + .map((item) => SymbolTag.fromJson(item as int)) + .toList(); + return ClientSymbolTagOptions( + valueSet: valueSet, + ); + } +} + /// The Client Capabilities of a [CodeActionRequest]. class CodeActionClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( @@ -9442,8 +11268,7 @@ /// set the request can only return `Command` literals. /// /// @since 3.8.0 - final CodeActionClientCapabilitiesCodeActionLiteralSupport? - codeActionLiteralSupport; + final ClientCodeActionLiteralOptions? codeActionLiteralSupport; /// Whether code action supports the `data` property which is preserved /// between a `textDocument/codeAction` and a `codeAction/resolve` request. @@ -9456,6 +11281,11 @@ /// @since 3.16.0 final bool? disabledSupport; + /// Whether the client supports documentation for a class of code actions. + /// + /// @since 3.18.0 + final bool? documentationSupport; + /// Whether code action supports dynamic registration. final bool? dynamicRegistration; @@ -9476,25 +11306,35 @@ /// via a separate `codeAction/resolve` request. /// /// @since 3.16.0 - final CodeActionClientCapabilitiesResolveSupport? resolveSupport; + final ClientCodeActionResolveOptions? resolveSupport; + + /// Client supports the tag property on a code action. Clients supporting tags + /// have to handle unknown tags gracefully. + /// + /// @since 3.18.0 - proposed + final CodeActionTagOptions? tagSupport; CodeActionClientCapabilities({ this.codeActionLiteralSupport, this.dataSupport, this.disabledSupport, + this.documentationSupport, this.dynamicRegistration, this.honorsChangeAnnotations, this.isPreferredSupport, this.resolveSupport, + this.tagSupport, }); @override int get hashCode => Object.hash( codeActionLiteralSupport, dataSupport, disabledSupport, + documentationSupport, dynamicRegistration, honorsChangeAnnotations, isPreferredSupport, resolveSupport, + tagSupport, ); @override @@ -9504,10 +11344,12 @@ codeActionLiteralSupport == other.codeActionLiteralSupport && dataSupport == other.dataSupport && disabledSupport == other.disabledSupport && + documentationSupport == other.documentationSupport && dynamicRegistration == other.dynamicRegistration && honorsChangeAnnotations == other.honorsChangeAnnotations && isPreferredSupport == other.isPreferredSupport && - resolveSupport == other.resolveSupport; + resolveSupport == other.resolveSupport && + tagSupport == other.tagSupport; } @override @@ -9522,6 +11364,9 @@ if (disabledSupport != null) { result['disabledSupport'] = disabledSupport; } + if (documentationSupport != null) { + result['documentationSupport'] = documentationSupport; + } if (dynamicRegistration != null) { result['dynamicRegistration'] = dynamicRegistration; } @@ -9534,6 +11379,9 @@ if (resolveSupport != null) { result['resolveSupport'] = resolveSupport?.toJson(); } + if (tagSupport != null) { + result['tagSupport'] = tagSupport?.toJson(); + } return result; } @@ -9542,7 +11390,7 @@ static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map<String, Object?>) { - if (!_canParseCodeActionClientCapabilitiesCodeActionLiteralSupport( + if (!_canParseClientCodeActionLiteralOptions( obj, reporter, 'codeActionLiteralSupport', allowsUndefined: true, allowsNull: false)) { return false; @@ -9555,6 +11403,10 @@ allowsUndefined: true, allowsNull: false)) { return false; } + if (!_canParseBool(obj, reporter, 'documentationSupport', + allowsUndefined: true, allowsNull: false)) { + return false; + } if (!_canParseBool(obj, reporter, 'dynamicRegistration', allowsUndefined: true, allowsNull: false)) { return false; @@ -9567,8 +11419,12 @@ allowsUndefined: true, allowsNull: false)) { return false; } - return _canParseCodeActionClientCapabilitiesResolveSupport( + if (!_canParseClientCodeActionResolveOptions( obj, reporter, 'resolveSupport', + allowsUndefined: true, allowsNull: false)) { + return false; + } + return _canParseCodeActionTagOptions(obj, reporter, 'tagSupport', allowsUndefined: true, allowsNull: false); } else { reporter.reportError('must be of type CodeActionClientCapabilities'); @@ -9579,13 +11435,15 @@ static CodeActionClientCapabilities fromJson(Map<String, Object?> json) { final codeActionLiteralSupportJson = json['codeActionLiteralSupport']; final codeActionLiteralSupport = codeActionLiteralSupportJson != null - ? CodeActionClientCapabilitiesCodeActionLiteralSupport.fromJson( + ? ClientCodeActionLiteralOptions.fromJson( codeActionLiteralSupportJson as Map<String, Object?>) : null; final dataSupportJson = json['dataSupport']; final dataSupport = dataSupportJson as bool?; final disabledSupportJson = json['disabledSupport']; final disabledSupport = disabledSupportJson as bool?; + final documentationSupportJson = json['documentationSupport']; + final documentationSupport = documentationSupportJson as bool?; final dynamicRegistrationJson = json['dynamicRegistration']; final dynamicRegistration = dynamicRegistrationJson as bool?; final honorsChangeAnnotationsJson = json['honorsChangeAnnotations']; @@ -9594,131 +11452,23 @@ final isPreferredSupport = isPreferredSupportJson as bool?; final resolveSupportJson = json['resolveSupport']; final resolveSupport = resolveSupportJson != null - ? CodeActionClientCapabilitiesResolveSupport.fromJson( + ? ClientCodeActionResolveOptions.fromJson( resolveSupportJson as Map<String, Object?>) : null; + final tagSupportJson = json['tagSupport']; + final tagSupport = tagSupportJson != null + ? CodeActionTagOptions.fromJson(tagSupportJson as Map<String, Object?>) + : null; return CodeActionClientCapabilities( codeActionLiteralSupport: codeActionLiteralSupport, dataSupport: dataSupport, disabledSupport: disabledSupport, + documentationSupport: documentationSupport, dynamicRegistration: dynamicRegistration, honorsChangeAnnotations: honorsChangeAnnotations, isPreferredSupport: isPreferredSupport, resolveSupport: resolveSupport, - ); - } -} - -class CodeActionClientCapabilitiesCodeActionLiteralSupport - implements ToJsonable { - static const jsonHandler = LspJsonHandler( - CodeActionClientCapabilitiesCodeActionLiteralSupport.canParse, - CodeActionClientCapabilitiesCodeActionLiteralSupport.fromJson, - ); - - /// The code action kind is support with the following value set. - final ClientCodeActionKindOptions codeActionKind; - - CodeActionClientCapabilitiesCodeActionLiteralSupport({ - required this.codeActionKind, - }); - - @override - int get hashCode => codeActionKind.hashCode; - - @override - bool operator ==(Object other) { - return other is CodeActionClientCapabilitiesCodeActionLiteralSupport && - other.runtimeType == - CodeActionClientCapabilitiesCodeActionLiteralSupport && - codeActionKind == other.codeActionKind; - } - - @override - Map<String, Object?> toJson() { - var result = <String, Object?>{}; - result['codeActionKind'] = codeActionKind.toJson(); - return result; - } - - @override - String toString() => jsonEncoder.convert(toJson()); - - static bool canParse(Object? obj, LspJsonReporter reporter) { - if (obj is Map<String, Object?>) { - return _canParseClientCodeActionKindOptions( - obj, reporter, 'codeActionKind', - allowsUndefined: false, allowsNull: false); - } else { - reporter.reportError( - 'must be of type CodeActionClientCapabilitiesCodeActionLiteralSupport'); - return false; - } - } - - static CodeActionClientCapabilitiesCodeActionLiteralSupport fromJson( - Map<String, Object?> json) { - final codeActionKindJson = json['codeActionKind']; - final codeActionKind = ClientCodeActionKindOptions.fromJson( - codeActionKindJson as Map<String, Object?>); - return CodeActionClientCapabilitiesCodeActionLiteralSupport( - codeActionKind: codeActionKind, - ); - } -} - -class CodeActionClientCapabilitiesResolveSupport implements ToJsonable { - static const jsonHandler = LspJsonHandler( - CodeActionClientCapabilitiesResolveSupport.canParse, - CodeActionClientCapabilitiesResolveSupport.fromJson, - ); - - /// The properties that a client can resolve lazily. - final List<String> properties; - - CodeActionClientCapabilitiesResolveSupport({ - required this.properties, - }); - - @override - int get hashCode => lspHashCode(properties); - - @override - bool operator ==(Object other) { - return other is CodeActionClientCapabilitiesResolveSupport && - other.runtimeType == CodeActionClientCapabilitiesResolveSupport && - const DeepCollectionEquality().equals(properties, other.properties); - } - - @override - Map<String, Object?> toJson() { - var result = <String, Object?>{}; - result['properties'] = properties; - return result; - } - - @override - String toString() => jsonEncoder.convert(toJson()); - - static bool canParse(Object? obj, LspJsonReporter reporter) { - if (obj is Map<String, Object?>) { - return _canParseListString(obj, reporter, 'properties', - allowsUndefined: false, allowsNull: false); - } else { - reporter.reportError( - 'must be of type CodeActionClientCapabilitiesResolveSupport'); - return false; - } - } - - static CodeActionClientCapabilitiesResolveSupport fromJson( - Map<String, Object?> json) { - final propertiesJson = json['properties']; - final properties = (propertiesJson as List<Object?>) - .map((item) => item as String) - .toList(); - return CodeActionClientCapabilitiesResolveSupport( - properties: properties, + tagSupport: tagSupport, ); } } @@ -9825,6 +11575,9 @@ } } +/// Captures why the code action is currently disabled. +/// +/// @since 3.18.0 class CodeActionDisabled implements ToJsonable { static const jsonHandler = LspJsonHandler( CodeActionDisabled.canParse, @@ -9884,6 +11637,12 @@ /// Empty kind. static const Empty = CodeActionKind(''); + /// Base kind for all code actions applying to the entire notebook's scope. + /// CodeActionKinds using this should always begin with `notebook.` + /// + /// @since 3.18.0 + static const Notebook = CodeActionKind('notebook'); + /// Base kind for quickfix actions: 'quickfix' static const QuickFix = CodeActionKind('quickfix'); @@ -9911,6 +11670,18 @@ /// - ... static const RefactorInline = CodeActionKind('refactor.inline'); + /// Base kind for refactoring move actions: `refactor.move` + /// + /// Example move actions: + /// + /// - Move a function to a new file + /// - Move a property between classes + /// - Move method to base class + /// - ... + /// + /// @since 3.18.0 + static const RefactorMove = CodeActionKind('refactor.move'); + /// Base kind for refactoring rewrite actions: 'refactor.rewrite' /// /// Example rewrite actions: @@ -9958,6 +11729,85 @@ static bool canParse(Object? obj, LspJsonReporter reporter) => obj is String; } +/// Documentation for a class of code actions. +/// +/// @since 3.18.0 +class CodeActionKindDocumentation implements ToJsonable { + static const jsonHandler = LspJsonHandler( + CodeActionKindDocumentation.canParse, + CodeActionKindDocumentation.fromJson, + ); + + /// Command that is ued to display the documentation to the user. + /// + /// The title of this documentation code action is taken from {@linkcode + /// Command.title} + final Command command; + + /// The kind of the code action being documented. + /// + /// If the kind is generic, such as `CodeActionKind.Refactor`, the + /// documentation will be shown whenever any refactorings are returned. If the + /// kind if more specific, such as `CodeActionKind.RefactorExtract`, the + /// documentation will only be shown when extract refactoring code actions are + /// returned. + final CodeActionKind kind; + + CodeActionKindDocumentation({ + required this.command, + required this.kind, + }); + @override + int get hashCode => Object.hash( + command, + kind, + ); + + @override + bool operator ==(Object other) { + return other is CodeActionKindDocumentation && + other.runtimeType == CodeActionKindDocumentation && + command == other.command && + kind == other.kind; + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + result['command'] = command.toJson(); + result['kind'] = kind.toJson(); + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + if (!_canParseCommand(obj, reporter, 'command', + allowsUndefined: false, allowsNull: false)) { + return false; + } + return _canParseCodeActionKind(obj, reporter, 'kind', + allowsUndefined: false, allowsNull: false); + } else { + reporter.reportError('must be of type CodeActionKindDocumentation'); + return false; + } + } + + static CodeActionKindDocumentation fromJson(Map<String, Object?> json) { + final commandJson = json['command']; + final command = Command.fromJson(commandJson as Map<String, Object?>); + final kindJson = json['kind']; + final kind = CodeActionKind.fromJson(kindJson as String); + return CodeActionKindDocumentation( + command: command, + kind: kind, + ); + } +} + /// A code action represents a change that can be performed in code, e.g. to fix /// a problem or to refactor code. /// @@ -10022,6 +11872,11 @@ /// Used to filter code actions. final CodeActionKind? kind; + /// Tags for this code action. + /// + /// @since 3.18.0 - proposed + final List<CodeActionTag>? tags; + /// A short, human-readable, title for this code action. final String title; CodeActionLiteral({ @@ -10032,6 +11887,7 @@ this.edit, this.isPreferred, this.kind, + this.tags, required this.title, }); @override @@ -10043,6 +11899,7 @@ edit, isPreferred, kind, + lspHashCode(tags), title, ); @@ -10057,6 +11914,7 @@ edit == other.edit && isPreferred == other.isPreferred && kind == other.kind && + const DeepCollectionEquality().equals(tags, other.tags) && title == other.title; } @@ -10085,6 +11943,9 @@ if (kind != null) { result['kind'] = kind?.toJson(); } + if (tags != null) { + result['tags'] = tags?.map((item) => item.toJson()).toList(); + } result['title'] = title; return result; } @@ -10118,6 +11979,10 @@ allowsUndefined: true, allowsNull: false)) { return false; } + if (!_canParseListCodeActionTag(obj, reporter, 'tags', + allowsUndefined: true, allowsNull: false)) { + return false; + } return _canParseString(obj, reporter, 'title', allowsUndefined: false, allowsNull: false); } else { @@ -10150,6 +12015,10 @@ final kindJson = json['kind']; final kind = kindJson != null ? CodeActionKind.fromJson(kindJson as String) : null; + final tagsJson = json['tags']; + final tags = (tagsJson as List<Object?>?) + ?.map((item) => CodeActionTag.fromJson(item as int)) + .toList(); final titleJson = json['title']; final title = titleJson as String; return CodeActionLiteral( @@ -10160,6 +12029,7 @@ edit: edit, isPreferred: isPreferred, kind: kind, + tags: tags, title: title, ); } @@ -10178,22 +12048,44 @@ /// the server may list out every specific kind they provide. final List<CodeActionKind>? codeActionKinds; + /// Static documentation for a class of code actions. + /// + /// Documentation from the provider should be shown in the code actions menu + /// if either: + /// + /// - Code actions of `kind` are requested by the editor. In this case, the + /// editor will show the documentation that + /// most closely matches the requested code action kind. For example, if a + /// provider has documentation for + /// both `Refactor` and `RefactorExtract`, when the user requests code + /// actions for `RefactorExtract`, + /// the editor will use the documentation for `RefactorExtract` instead of + /// the documentation for `Refactor`. + /// + /// - Any code actions of `kind` are returned by the provider. + /// + /// At most one documentation entry should be shown per provider. + /// + /// @since 3.18.0 + final List<CodeActionKindDocumentation>? documentation; + /// The server provides support to resolve additional information for a code /// action. /// /// @since 3.16.0 final bool? resolveProvider; - @override final bool? workDoneProgress; CodeActionOptions({ this.codeActionKinds, + this.documentation, this.resolveProvider, this.workDoneProgress, }); @override int get hashCode => Object.hash( lspHashCode(codeActionKinds), + lspHashCode(documentation), resolveProvider, workDoneProgress, ); @@ -10204,6 +12096,8 @@ other.runtimeType == CodeActionOptions && const DeepCollectionEquality() .equals(codeActionKinds, other.codeActionKinds) && + const DeepCollectionEquality() + .equals(documentation, other.documentation) && resolveProvider == other.resolveProvider && workDoneProgress == other.workDoneProgress; } @@ -10215,6 +12109,10 @@ result['codeActionKinds'] = codeActionKinds?.map((item) => item.toJson()).toList(); } + if (documentation != null) { + result['documentation'] = + documentation?.map((item) => item.toJson()).toList(); + } if (resolveProvider != null) { result['resolveProvider'] = resolveProvider; } @@ -10233,6 +12131,11 @@ allowsUndefined: true, allowsNull: false)) { return false; } + if (!_canParseListCodeActionKindDocumentation( + obj, reporter, 'documentation', + allowsUndefined: true, allowsNull: false)) { + return false; + } if (!_canParseBool(obj, reporter, 'resolveProvider', allowsUndefined: true, allowsNull: false)) { return false; @@ -10253,12 +12156,18 @@ final codeActionKinds = (codeActionKindsJson as List<Object?>?) ?.map((item) => CodeActionKind.fromJson(item as String)) .toList(); + final documentationJson = json['documentation']; + final documentation = (documentationJson as List<Object?>?) + ?.map((item) => + CodeActionKindDocumentation.fromJson(item as Map<String, Object?>)) + .toList(); final resolveProviderJson = json['resolveProvider']; final resolveProvider = resolveProviderJson as bool?; final workDoneProgressJson = json['workDoneProgress']; final workDoneProgress = workDoneProgressJson as bool?; return CodeActionOptions( codeActionKinds: codeActionKinds, + documentation: documentation, resolveProvider: resolveProvider, workDoneProgress: workDoneProgress, ); @@ -10407,6 +12316,28 @@ @override final List<TextDocumentFilterScheme>? documentSelector; + /// Static documentation for a class of code actions. + /// + /// Documentation from the provider should be shown in the code actions menu + /// if either: + /// + /// - Code actions of `kind` are requested by the editor. In this case, the + /// editor will show the documentation that + /// most closely matches the requested code action kind. For example, if a + /// provider has documentation for + /// both `Refactor` and `RefactorExtract`, when the user requests code + /// actions for `RefactorExtract`, + /// the editor will use the documentation for `RefactorExtract` instead of + /// the documentation for `Refactor`. + /// + /// - Any code actions of `kind` are returned by the provider. + /// + /// At most one documentation entry should be shown per provider. + /// + /// @since 3.18.0 + @override + final List<CodeActionKindDocumentation>? documentation; + /// The server provides support to resolve additional information for a code /// action. /// @@ -10418,6 +12349,7 @@ CodeActionRegistrationOptions({ this.codeActionKinds, this.documentSelector, + this.documentation, this.resolveProvider, this.workDoneProgress, }); @@ -10425,6 +12357,7 @@ int get hashCode => Object.hash( lspHashCode(codeActionKinds), lspHashCode(documentSelector), + lspHashCode(documentation), resolveProvider, workDoneProgress, ); @@ -10437,6 +12370,8 @@ .equals(codeActionKinds, other.codeActionKinds) && const DeepCollectionEquality() .equals(documentSelector, other.documentSelector) && + const DeepCollectionEquality() + .equals(documentation, other.documentation) && resolveProvider == other.resolveProvider && workDoneProgress == other.workDoneProgress; } @@ -10449,6 +12384,10 @@ codeActionKinds?.map((item) => item.toJson()).toList(); } result['documentSelector'] = documentSelector; + if (documentation != null) { + result['documentation'] = + documentation?.map((item) => item.toJson()).toList(); + } if (resolveProvider != null) { result['resolveProvider'] = resolveProvider; } @@ -10472,6 +12411,11 @@ allowsUndefined: false, allowsNull: true)) { return false; } + if (!_canParseListCodeActionKindDocumentation( + obj, reporter, 'documentation', + allowsUndefined: true, allowsNull: false)) { + return false; + } if (!_canParseBool(obj, reporter, 'resolveProvider', allowsUndefined: true, allowsNull: false)) { return false; @@ -10494,6 +12438,11 @@ ?.map((item) => TextDocumentFilterScheme.fromJson(item as Map<String, Object?>)) .toList(); + final documentationJson = json['documentation']; + final documentation = (documentationJson as List<Object?>?) + ?.map((item) => + CodeActionKindDocumentation.fromJson(item as Map<String, Object?>)) + .toList(); final resolveProviderJson = json['resolveProvider']; final resolveProvider = resolveProviderJson as bool?; final workDoneProgressJson = json['workDoneProgress']; @@ -10501,12 +12450,96 @@ return CodeActionRegistrationOptions( codeActionKinds: codeActionKinds, documentSelector: documentSelector, + documentation: documentation, resolveProvider: resolveProvider, workDoneProgress: workDoneProgress, ); } } +/// Code action tags are extra annotations that tweak the behavior of a code +/// action. +/// +/// @since 3.18.0 - proposed +class CodeActionTag implements ToJsonable { + /// Marks the code action as LLM-generated. + static const LLMGenerated = CodeActionTag(1); + final int _value; + + const CodeActionTag(this._value); + + const CodeActionTag.fromJson(this._value); + @override + int get hashCode => _value.hashCode; + + @override + bool operator ==(Object other) => + other is CodeActionTag && other._value == _value; + + @override + int toJson() => _value; + + @override + String toString() => _value.toString(); + + static bool canParse(Object? obj, LspJsonReporter reporter) => obj is int; +} + +/// @since 3.18.0 - proposed +class CodeActionTagOptions implements ToJsonable { + static const jsonHandler = LspJsonHandler( + CodeActionTagOptions.canParse, + CodeActionTagOptions.fromJson, + ); + + /// The tags supported by the client. + final List<CodeActionTag> valueSet; + + CodeActionTagOptions({ + required this.valueSet, + }); + + @override + int get hashCode => lspHashCode(valueSet); + + @override + bool operator ==(Object other) { + return other is CodeActionTagOptions && + other.runtimeType == CodeActionTagOptions && + const DeepCollectionEquality().equals(valueSet, other.valueSet); + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + result['valueSet'] = valueSet.map((item) => item.toJson()).toList(); + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + return _canParseListCodeActionTag(obj, reporter, 'valueSet', + allowsUndefined: false, allowsNull: false); + } else { + reporter.reportError('must be of type CodeActionTagOptions'); + return false; + } + } + + static CodeActionTagOptions fromJson(Map<String, Object?> json) { + final valueSetJson = json['valueSet']; + final valueSet = (valueSetJson as List<Object?>) + .map((item) => CodeActionTag.fromJson(item as int)) + .toList(); + return CodeActionTagOptions( + valueSet: valueSet, + ); + } +} + /// The reason why code actions were requested. /// /// @since 3.17.0 @@ -10695,18 +12728,28 @@ /// Whether code lens supports dynamic registration. final bool? dynamicRegistration; + /// Whether the client supports resolving additional code lens properties via + /// a separate `codeLens/resolve` request. + /// + /// @since 3.18.0 + final ClientCodeLensResolveOptions? resolveSupport; + CodeLensClientCapabilities({ this.dynamicRegistration, + this.resolveSupport, }); - @override - int get hashCode => dynamicRegistration.hashCode; + int get hashCode => Object.hash( + dynamicRegistration, + resolveSupport, + ); @override bool operator ==(Object other) { return other is CodeLensClientCapabilities && other.runtimeType == CodeLensClientCapabilities && - dynamicRegistration == other.dynamicRegistration; + dynamicRegistration == other.dynamicRegistration && + resolveSupport == other.resolveSupport; } @override @@ -10715,6 +12758,9 @@ if (dynamicRegistration != null) { result['dynamicRegistration'] = dynamicRegistration; } + if (resolveSupport != null) { + result['resolveSupport'] = resolveSupport?.toJson(); + } return result; } @@ -10723,7 +12769,12 @@ static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map<String, Object?>) { - return _canParseBool(obj, reporter, 'dynamicRegistration', + if (!_canParseBool(obj, reporter, 'dynamicRegistration', + allowsUndefined: true, allowsNull: false)) { + return false; + } + return _canParseClientCodeLensResolveOptions( + obj, reporter, 'resolveSupport', allowsUndefined: true, allowsNull: false); } else { reporter.reportError('must be of type CodeLensClientCapabilities'); @@ -10734,8 +12785,14 @@ static CodeLensClientCapabilities fromJson(Map<String, Object?> json) { final dynamicRegistrationJson = json['dynamicRegistration']; final dynamicRegistration = dynamicRegistrationJson as bool?; + final resolveSupportJson = json['resolveSupport']; + final resolveSupport = resolveSupportJson != null + ? ClientCodeLensResolveOptions.fromJson( + resolveSupportJson as Map<String, Object?>) + : null; return CodeLensClientCapabilities( dynamicRegistration: dynamicRegistration, + resolveSupport: resolveSupport, ); } } @@ -11463,16 +13520,23 @@ /// Title of the command, like `save`. final String title; + + /// An optional tooltip. + /// + /// @since 3.18.0 + final String? tooltip; Command({ this.arguments, required this.command, required this.title, + this.tooltip, }); @override int get hashCode => Object.hash( lspHashCode(arguments), command, title, + tooltip, ); @override @@ -11481,7 +13545,8 @@ other.runtimeType == Command && const DeepCollectionEquality().equals(arguments, other.arguments) && command == other.command && - title == other.title; + title == other.title && + tooltip == other.tooltip; } @override @@ -11492,6 +13557,9 @@ } result['command'] = command; result['title'] = title; + if (tooltip != null) { + result['tooltip'] = tooltip; + } return result; } @@ -11508,8 +13576,12 @@ allowsUndefined: false, allowsNull: false)) { return false; } - return _canParseString(obj, reporter, 'title', - allowsUndefined: false, allowsNull: false); + if (!_canParseString(obj, reporter, 'title', + allowsUndefined: false, allowsNull: false)) { + return false; + } + return _canParseString(obj, reporter, 'tooltip', + allowsUndefined: true, allowsNull: false); } else { reporter.reportError('must be of type Command'); return false; @@ -11524,10 +13596,13 @@ final command = commandJson as String; final titleJson = json['title']; final title = titleJson as String; + final tooltipJson = json['tooltip']; + final tooltip = tooltipJson as String?; return Command( arguments: arguments, command: command, title: title, + tooltip: tooltip, ); } } @@ -11540,14 +13615,15 @@ ); /// The client supports the following `CompletionItem` specific capabilities. - final CompletionClientCapabilitiesCompletionItem? completionItem; + final ClientCompletionItemOptions? completionItem; + /// The client supports the following completion item kinds. final ClientCompletionItemOptionsKind? completionItemKind; /// The client supports the following `CompletionList` specific capabilities. /// /// @since 3.17.0 - final CompletionClientCapabilitiesCompletionList? completionList; + final CompletionListCapabilities? completionList; /// The client supports to send additional context information for a /// `textDocument/completion` request. @@ -11621,8 +13697,7 @@ static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map<String, Object?>) { - if (!_canParseCompletionClientCapabilitiesCompletionItem( - obj, reporter, 'completionItem', + if (!_canParseClientCompletionItemOptions(obj, reporter, 'completionItem', allowsUndefined: true, allowsNull: false)) { return false; } @@ -11631,8 +13706,7 @@ allowsUndefined: true, allowsNull: false)) { return false; } - if (!_canParseCompletionClientCapabilitiesCompletionList( - obj, reporter, 'completionList', + if (!_canParseCompletionListCapabilities(obj, reporter, 'completionList', allowsUndefined: true, allowsNull: false)) { return false; } @@ -11655,7 +13729,7 @@ static CompletionClientCapabilities fromJson(Map<String, Object?> json) { final completionItemJson = json['completionItem']; final completionItem = completionItemJson != null - ? CompletionClientCapabilitiesCompletionItem.fromJson( + ? ClientCompletionItemOptions.fromJson( completionItemJson as Map<String, Object?>) : null; final completionItemKindJson = json['completionItemKind']; @@ -11665,7 +13739,7 @@ : null; final completionListJson = json['completionList']; final completionList = completionListJson != null - ? CompletionClientCapabilitiesCompletionList.fromJson( + ? CompletionListCapabilities.fromJson( completionListJson as Map<String, Object?>) : null; final contextSupportJson = json['contextSupport']; @@ -11687,310 +13761,6 @@ } } -class CompletionClientCapabilitiesCompletionItem implements ToJsonable { - static const jsonHandler = LspJsonHandler( - CompletionClientCapabilitiesCompletionItem.canParse, - CompletionClientCapabilitiesCompletionItem.fromJson, - ); - - /// Client supports commit characters on a completion item. - final bool? commitCharactersSupport; - - /// Client supports the deprecated property on a completion item. - final bool? deprecatedSupport; - - /// Client supports the following content formats for the documentation - /// property. The order describes the preferred format of the client. - final List<MarkupKind>? documentationFormat; - - /// 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 - 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 - final CompletionItemInsertTextModeSupport? insertTextModeSupport; - - /// The client has support for completion item label details (see also - /// `CompletionItemLabelDetails`). - /// - /// @since 3.17.0 - final bool? labelDetailsSupport; - - /// Client supports the preselect property on a completion item. - final bool? preselectSupport; - - /// Indicates which properties a client can resolve lazily on a completion - /// item. Before version 3.16.0 only the predefined properties `documentation` - /// and `details` could be resolved lazily. - /// - /// @since 3.16.0 - 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. - 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 - final CompletionItemTagSupport? tagSupport; - CompletionClientCapabilitiesCompletionItem({ - this.commitCharactersSupport, - this.deprecatedSupport, - this.documentationFormat, - this.insertReplaceSupport, - this.insertTextModeSupport, - this.labelDetailsSupport, - this.preselectSupport, - this.resolveSupport, - this.snippetSupport, - this.tagSupport, - }); - @override - int get hashCode => Object.hash( - commitCharactersSupport, - deprecatedSupport, - lspHashCode(documentationFormat), - insertReplaceSupport, - insertTextModeSupport, - labelDetailsSupport, - preselectSupport, - resolveSupport, - snippetSupport, - tagSupport, - ); - - @override - bool operator ==(Object other) { - return other is CompletionClientCapabilitiesCompletionItem && - other.runtimeType == CompletionClientCapabilitiesCompletionItem && - commitCharactersSupport == other.commitCharactersSupport && - deprecatedSupport == other.deprecatedSupport && - const DeepCollectionEquality() - .equals(documentationFormat, other.documentationFormat) && - insertReplaceSupport == other.insertReplaceSupport && - insertTextModeSupport == other.insertTextModeSupport && - labelDetailsSupport == other.labelDetailsSupport && - preselectSupport == other.preselectSupport && - resolveSupport == other.resolveSupport && - snippetSupport == other.snippetSupport && - tagSupport == other.tagSupport; - } - - @override - Map<String, Object?> toJson() { - var result = <String, Object?>{}; - if (commitCharactersSupport != null) { - result['commitCharactersSupport'] = commitCharactersSupport; - } - if (deprecatedSupport != null) { - result['deprecatedSupport'] = deprecatedSupport; - } - if (documentationFormat != null) { - result['documentationFormat'] = - documentationFormat?.map((item) => item.toJson()).toList(); - } - if (insertReplaceSupport != null) { - result['insertReplaceSupport'] = insertReplaceSupport; - } - if (insertTextModeSupport != null) { - result['insertTextModeSupport'] = insertTextModeSupport?.toJson(); - } - if (labelDetailsSupport != null) { - result['labelDetailsSupport'] = labelDetailsSupport; - } - if (preselectSupport != null) { - result['preselectSupport'] = preselectSupport; - } - if (resolveSupport != null) { - result['resolveSupport'] = resolveSupport?.toJson(); - } - if (snippetSupport != null) { - result['snippetSupport'] = snippetSupport; - } - if (tagSupport != null) { - result['tagSupport'] = tagSupport?.toJson(); - } - return result; - } - - @override - String toString() => jsonEncoder.convert(toJson()); - - static bool canParse(Object? obj, LspJsonReporter reporter) { - if (obj is Map<String, Object?>) { - if (!_canParseBool(obj, reporter, 'commitCharactersSupport', - allowsUndefined: true, allowsNull: false)) { - return false; - } - if (!_canParseBool(obj, reporter, 'deprecatedSupport', - allowsUndefined: true, allowsNull: false)) { - return false; - } - if (!_canParseListMarkupKind(obj, reporter, 'documentationFormat', - allowsUndefined: true, allowsNull: false)) { - return false; - } - if (!_canParseBool(obj, reporter, 'insertReplaceSupport', - allowsUndefined: true, allowsNull: false)) { - return false; - } - if (!_canParseCompletionItemInsertTextModeSupport( - obj, reporter, 'insertTextModeSupport', - allowsUndefined: true, allowsNull: false)) { - return false; - } - if (!_canParseBool(obj, reporter, 'labelDetailsSupport', - allowsUndefined: true, allowsNull: false)) { - return false; - } - if (!_canParseBool(obj, reporter, 'preselectSupport', - allowsUndefined: true, allowsNull: false)) { - return false; - } - if (!_canParseCompletionItemResolveSupport( - obj, reporter, 'resolveSupport', - allowsUndefined: true, allowsNull: false)) { - return false; - } - if (!_canParseBool(obj, reporter, 'snippetSupport', - allowsUndefined: true, allowsNull: false)) { - return false; - } - return _canParseCompletionItemTagSupport(obj, reporter, 'tagSupport', - allowsUndefined: true, allowsNull: false); - } else { - reporter.reportError( - 'must be of type CompletionClientCapabilitiesCompletionItem'); - return false; - } - } - - static CompletionClientCapabilitiesCompletionItem fromJson( - Map<String, Object?> json) { - final commitCharactersSupportJson = json['commitCharactersSupport']; - final commitCharactersSupport = commitCharactersSupportJson as bool?; - final deprecatedSupportJson = json['deprecatedSupport']; - final deprecatedSupport = deprecatedSupportJson as bool?; - final documentationFormatJson = json['documentationFormat']; - final documentationFormat = (documentationFormatJson as List<Object?>?) - ?.map((item) => MarkupKind.fromJson(item as String)) - .toList(); - final insertReplaceSupportJson = json['insertReplaceSupport']; - final insertReplaceSupport = insertReplaceSupportJson as bool?; - final insertTextModeSupportJson = json['insertTextModeSupport']; - final insertTextModeSupport = insertTextModeSupportJson != null - ? CompletionItemInsertTextModeSupport.fromJson( - insertTextModeSupportJson as Map<String, Object?>) - : null; - final labelDetailsSupportJson = json['labelDetailsSupport']; - final labelDetailsSupport = labelDetailsSupportJson as bool?; - final preselectSupportJson = json['preselectSupport']; - final preselectSupport = preselectSupportJson as bool?; - final resolveSupportJson = json['resolveSupport']; - final resolveSupport = resolveSupportJson != null - ? CompletionItemResolveSupport.fromJson( - resolveSupportJson as Map<String, Object?>) - : null; - final snippetSupportJson = json['snippetSupport']; - final snippetSupport = snippetSupportJson as bool?; - final tagSupportJson = json['tagSupport']; - final tagSupport = tagSupportJson != null - ? CompletionItemTagSupport.fromJson( - tagSupportJson as Map<String, Object?>) - : null; - return CompletionClientCapabilitiesCompletionItem( - commitCharactersSupport: commitCharactersSupport, - deprecatedSupport: deprecatedSupport, - documentationFormat: documentationFormat, - insertReplaceSupport: insertReplaceSupport, - insertTextModeSupport: insertTextModeSupport, - labelDetailsSupport: labelDetailsSupport, - preselectSupport: preselectSupport, - resolveSupport: resolveSupport, - snippetSupport: snippetSupport, - tagSupport: tagSupport, - ); - } -} - -class CompletionClientCapabilitiesCompletionList implements ToJsonable { - static const jsonHandler = LspJsonHandler( - CompletionClientCapabilitiesCompletionList.canParse, - CompletionClientCapabilitiesCompletionList.fromJson, - ); - - /// The client supports the following itemDefaults on a completion list. - /// - /// The value lists the supported property names of the - /// `CompletionList.itemDefaults` object. If omitted no properties are - /// supported. - /// - /// @since 3.17.0 - final List<String>? itemDefaults; - - CompletionClientCapabilitiesCompletionList({ - this.itemDefaults, - }); - - @override - int get hashCode => lspHashCode(itemDefaults); - - @override - bool operator ==(Object other) { - return other is CompletionClientCapabilitiesCompletionList && - other.runtimeType == CompletionClientCapabilitiesCompletionList && - const DeepCollectionEquality().equals(itemDefaults, other.itemDefaults); - } - - @override - Map<String, Object?> toJson() { - var result = <String, Object?>{}; - if (itemDefaults != null) { - result['itemDefaults'] = itemDefaults; - } - return result; - } - - @override - String toString() => jsonEncoder.convert(toJson()); - - static bool canParse(Object? obj, LspJsonReporter reporter) { - if (obj is Map<String, Object?>) { - return _canParseListString(obj, reporter, 'itemDefaults', - allowsUndefined: true, allowsNull: false); - } else { - reporter.reportError( - 'must be of type CompletionClientCapabilitiesCompletionList'); - return false; - } - } - - static CompletionClientCapabilitiesCompletionList fromJson( - Map<String, Object?> json) { - final itemDefaultsJson = json['itemDefaults']; - final itemDefaults = (itemDefaultsJson as List<Object?>?) - ?.map((item) => item as String) - .toList(); - return CompletionClientCapabilitiesCompletionList( - itemDefaults: itemDefaults, - ); - } -} - /// Contains additional information about the context in which a completion /// request is triggered. class CompletionContext implements ToJsonable { @@ -12507,6 +14277,144 @@ } } +/// Specifies how fields from a completion item should be combined with those +/// from `completionList.itemDefaults`. +/// +/// If unspecified, all fields will be treated as ApplyKind.Replace. +/// +/// If a field's value is ApplyKind.Replace, the value from a completion item +/// (if provided and not `null`) will always be used instead of the value from +/// `completionItem.itemDefaults`. +/// +/// If a field's value is ApplyKind.Merge, the values will be merged using the +/// rules defined against each field below. +/// +/// Servers are only allowed to return `applyKind` if the client signals support +/// for this via the `completionList.applyKindSupport` capability. +/// +/// @since 3.18.0 +class CompletionItemApplyKinds implements ToJsonable { + static const jsonHandler = LspJsonHandler( + CompletionItemApplyKinds.canParse, + CompletionItemApplyKinds.fromJson, + ); + + /// Specifies whether commitCharacters on a completion will replace or be + /// merged with those in `completionList.itemDefaults.commitCharacters`. + /// + /// If ApplyKind.Replace, the commit characters from the completion item will + /// always be used unless not provided, in which case those from + /// `completionList.itemDefaults.commitCharacters` will be used. An empty list + /// can be used if a completion item does not have any commit characters and + /// also should not use those from + /// `completionList.itemDefaults.commitCharacters`. + /// + /// If ApplyKind.Merge the commitCharacters for the completion will be the + /// union of all values in both `completionList.itemDefaults.commitCharacters` + /// and the completion's own `commitCharacters`. + /// + /// @since 3.18.0 + final ApplyKind? commitCharacters; + + /// Specifies whether the `data` field on a completion will replace or be + /// merged with data from `completionList.itemDefaults.data`. + /// + /// If ApplyKind.Replace, the data from the completion item will be used if + /// provided (and not `null`), otherwise `completionList.itemDefaults.data` + /// will be used. An empty object can be used if a completion item does not + /// have any data but also should not use the value from + /// `completionList.itemDefaults.data`. + /// + /// If ApplyKind.Merge, a shallow merge will be performed between + /// `completionList.itemDefaults.data` and the completion's own data using the + /// following rules: + /// + /// - If a completion's `data` field is not provided (or `null`), the + /// entire `data` field from `completionList.itemDefaults.data` will be + /// used as-is. + /// - If a completion's `data` field is provided, each field will + /// overwrite the field of the same name in + /// `completionList.itemDefaults.data` but no merging of nested fields + /// within that value will occur. + /// + /// @since 3.18.0 + final ApplyKind? data; + + CompletionItemApplyKinds({ + this.commitCharacters, + this.data, + }); + @override + int get hashCode => Object.hash( + commitCharacters, + data, + ); + + @override + bool operator ==(Object other) { + return other is CompletionItemApplyKinds && + other.runtimeType == CompletionItemApplyKinds && + commitCharacters == other.commitCharacters && + data == other.data; + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + if (commitCharacters != null) { + result['commitCharacters'] = commitCharacters?.toJson(); + } + if (data != null) { + result['data'] = data?.toJson(); + } + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + if (!_canParseApplyKind(obj, reporter, 'commitCharacters', + allowsUndefined: true, allowsNull: false)) { + return false; + } + return _canParseApplyKind(obj, reporter, 'data', + allowsUndefined: true, allowsNull: false); + } else { + reporter.reportError('must be of type CompletionItemApplyKinds'); + return false; + } + } + + static CompletionItemApplyKinds fromJson(Map<String, Object?> json) { + final commitCharactersJson = json['commitCharacters']; + final commitCharacters = commitCharactersJson != null + ? ApplyKind.fromJson(commitCharactersJson as int) + : null; + final dataJson = json['data']; + final data = dataJson != null ? ApplyKind.fromJson(dataJson as int) : null; + return CompletionItemApplyKinds( + commitCharacters: commitCharacters, + data: data, + ); + } +} + +/// In many cases the items of an actual completion result share the same value +/// for properties like `commitCharacters` or the range of a text edit. A +/// completion list can therefore define item defaults which will be used if a +/// completion item itself doesn't specify the value. +/// +/// If a completion list specifies a default value and a completion item also +/// specifies a corresponding value, the rules for combining these are defined +/// by `applyKinds` (if the client supports it), defaulting to +/// ApplyKind.Replace. +/// +/// Servers are only allowed to return default values if the client signals +/// support for this via the `completionList.itemDefaults` capability. +/// +/// @since 3.17.0 class CompletionItemDefaults implements ToJsonable { static const jsonHandler = LspJsonHandler( CompletionItemDefaults.canParse, @@ -12640,61 +14548,6 @@ } } -class CompletionItemInsertTextModeSupport implements ToJsonable { - static const jsonHandler = LspJsonHandler( - CompletionItemInsertTextModeSupport.canParse, - CompletionItemInsertTextModeSupport.fromJson, - ); - - final List<InsertTextMode> valueSet; - - CompletionItemInsertTextModeSupport({ - required this.valueSet, - }); - - @override - int get hashCode => lspHashCode(valueSet); - - @override - bool operator ==(Object other) { - return other is CompletionItemInsertTextModeSupport && - other.runtimeType == CompletionItemInsertTextModeSupport && - const DeepCollectionEquality().equals(valueSet, other.valueSet); - } - - @override - Map<String, Object?> toJson() { - var result = <String, Object?>{}; - result['valueSet'] = valueSet.map((item) => item.toJson()).toList(); - return result; - } - - @override - String toString() => jsonEncoder.convert(toJson()); - - static bool canParse(Object? obj, LspJsonReporter reporter) { - if (obj is Map<String, Object?>) { - return _canParseListInsertTextMode(obj, reporter, 'valueSet', - allowsUndefined: false, allowsNull: false); - } else { - reporter - .reportError('must be of type CompletionItemInsertTextModeSupport'); - return false; - } - } - - static CompletionItemInsertTextModeSupport fromJson( - Map<String, Object?> json) { - final valueSetJson = json['valueSet']; - final valueSet = (valueSetJson as List<Object?>) - .map((item) => InsertTextMode.fromJson(item as int)) - .toList(); - return CompletionItemInsertTextModeSupport( - valueSet: valueSet, - ); - } -} - /// The kind of a completion entry. class CompletionItemKind implements ToJsonable { static const Class = CompletionItemKind(7); @@ -12822,60 +14675,6 @@ } } -class CompletionItemResolveSupport implements ToJsonable { - static const jsonHandler = LspJsonHandler( - CompletionItemResolveSupport.canParse, - CompletionItemResolveSupport.fromJson, - ); - - /// The properties that a client can resolve lazily. - final List<String> properties; - - CompletionItemResolveSupport({ - required this.properties, - }); - - @override - int get hashCode => lspHashCode(properties); - - @override - bool operator ==(Object other) { - return other is CompletionItemResolveSupport && - other.runtimeType == CompletionItemResolveSupport && - const DeepCollectionEquality().equals(properties, other.properties); - } - - @override - Map<String, Object?> toJson() { - var result = <String, Object?>{}; - result['properties'] = properties; - return result; - } - - @override - String toString() => jsonEncoder.convert(toJson()); - - static bool canParse(Object? obj, LspJsonReporter reporter) { - if (obj is Map<String, Object?>) { - return _canParseListString(obj, reporter, 'properties', - allowsUndefined: false, allowsNull: false); - } else { - reporter.reportError('must be of type CompletionItemResolveSupport'); - return false; - } - } - - static CompletionItemResolveSupport fromJson(Map<String, Object?> json) { - final propertiesJson = json['properties']; - final properties = (propertiesJson as List<Object?>) - .map((item) => item as String) - .toList(); - return CompletionItemResolveSupport( - properties: properties, - ); - } -} - /// Completion item tags are extra annotations that tweak the rendering of a /// completion item. /// @@ -12904,16 +14703,17 @@ static bool canParse(Object? obj, LspJsonReporter reporter) => obj is int; } -class CompletionItemTagSupport implements ToJsonable { +/// @since 3.18.0 +class CompletionItemTagOptions implements ToJsonable { static const jsonHandler = LspJsonHandler( - CompletionItemTagSupport.canParse, - CompletionItemTagSupport.fromJson, + CompletionItemTagOptions.canParse, + CompletionItemTagOptions.fromJson, ); /// The tags supported by the client. final List<CompletionItemTag> valueSet; - CompletionItemTagSupport({ + CompletionItemTagOptions({ required this.valueSet, }); @@ -12922,8 +14722,8 @@ @override bool operator ==(Object other) { - return other is CompletionItemTagSupport && - other.runtimeType == CompletionItemTagSupport && + return other is CompletionItemTagOptions && + other.runtimeType == CompletionItemTagOptions && const DeepCollectionEquality().equals(valueSet, other.valueSet); } @@ -12942,17 +14742,17 @@ return _canParseListCompletionItemTag(obj, reporter, 'valueSet', allowsUndefined: false, allowsNull: false); } else { - reporter.reportError('must be of type CompletionItemTagSupport'); + reporter.reportError('must be of type CompletionItemTagOptions'); return false; } } - static CompletionItemTagSupport fromJson(Map<String, Object?> json) { + static CompletionItemTagOptions fromJson(Map<String, Object?> json) { final valueSetJson = json['valueSet']; final valueSet = (valueSetJson as List<Object?>) .map((item) => CompletionItemTag.fromJson(item as int)) .toList(); - return CompletionItemTagSupport( + return CompletionItemTagOptions( valueSet: valueSet, ); } @@ -12965,6 +14765,24 @@ CompletionList.fromJson, ); + /// Specifies how fields from a completion item should be combined with those + /// from `completionList.itemDefaults`. + /// + /// If unspecified, all fields will be treated as ApplyKind.Replace. + /// + /// If a field's value is ApplyKind.Replace, the value from a completion item + /// (if provided and not `null`) will always be used instead of the value from + /// `completionItem.itemDefaults`. + /// + /// If a field's value is ApplyKind.Merge, the values will be merged using the + /// rules defined against each field below. + /// + /// Servers are only allowed to return `applyKind` if the client signals + /// support for this via the `completionList.applyKindSupport` capability. + /// + /// @since 3.18.0 + final CompletionItemApplyKinds? applyKind; + /// This list it not complete. Further typing results in recomputing this /// list. /// @@ -12978,7 +14796,9 @@ /// a completion item itself doesn't specify the value. /// /// If a completion list specifies a default value and a completion item also - /// specifies a corresponding value the one from the item is used. + /// specifies a corresponding value, the rules for combining these are defined + /// by `applyKinds` (if the client supports it), defaulting to + /// ApplyKind.Replace. /// /// Servers are only allowed to return default values if the client signals /// support for this via the `completionList.itemDefaults` capability. @@ -12989,12 +14809,14 @@ /// The completion items. final List<CompletionItem> items; CompletionList({ + this.applyKind, required this.isIncomplete, this.itemDefaults, required this.items, }); @override int get hashCode => Object.hash( + applyKind, isIncomplete, itemDefaults, lspHashCode(items), @@ -13004,6 +14826,7 @@ bool operator ==(Object other) { return other is CompletionList && other.runtimeType == CompletionList && + applyKind == other.applyKind && isIncomplete == other.isIncomplete && itemDefaults == other.itemDefaults && const DeepCollectionEquality().equals(items, other.items); @@ -13012,6 +14835,9 @@ @override Map<String, Object?> toJson() { var result = <String, Object?>{}; + if (applyKind != null) { + result['applyKind'] = applyKind?.toJson(); + } result['isIncomplete'] = isIncomplete; if (itemDefaults != null) { result['itemDefaults'] = itemDefaults?.toJson(); @@ -13025,6 +14851,10 @@ static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map<String, Object?>) { + if (!_canParseCompletionItemApplyKinds(obj, reporter, 'applyKind', + allowsUndefined: true, allowsNull: false)) { + return false; + } if (!_canParseBool(obj, reporter, 'isIncomplete', allowsUndefined: false, allowsNull: false)) { return false; @@ -13042,6 +14872,11 @@ } static CompletionList fromJson(Map<String, Object?> json) { + final applyKindJson = json['applyKind']; + final applyKind = applyKindJson != null + ? CompletionItemApplyKinds.fromJson( + applyKindJson as Map<String, Object?>) + : null; final isIncompleteJson = json['isIncomplete']; final isIncomplete = isIncompleteJson as bool; final itemDefaultsJson = json['itemDefaults']; @@ -13054,6 +14889,7 @@ .map((item) => CompletionItem.fromJson(item as Map<String, Object?>)) .toList(); return CompletionList( + applyKind: applyKind, isIncomplete: isIncomplete, itemDefaults: itemDefaults, items: items, @@ -13061,6 +14897,98 @@ } } +/// The client supports the following `CompletionList` specific capabilities. +/// +/// @since 3.17.0 +class CompletionListCapabilities implements ToJsonable { + static const jsonHandler = LspJsonHandler( + CompletionListCapabilities.canParse, + CompletionListCapabilities.fromJson, + ); + + /// Specifies whether the client supports `CompletionList.applyKind` to + /// indicate how supported values from `completionList.itemDefaults` and + /// `completion` will be combined. + /// + /// If a client supports `applyKind` it must support it for all fields that it + /// supports that are listed in `CompletionList.applyKind`. This means when + /// clients add support for new/future fields in completion items the MUST + /// also support merge for them if those fields are defined in + /// `CompletionList.applyKind`. + /// + /// @since 3.18.0 + final bool? applyKindSupport; + + /// The client supports the following itemDefaults on a completion list. + /// + /// The value lists the supported property names of the + /// `CompletionList.itemDefaults` object. If omitted no properties are + /// supported. + /// + /// @since 3.17.0 + final List<String>? itemDefaults; + + CompletionListCapabilities({ + this.applyKindSupport, + this.itemDefaults, + }); + @override + int get hashCode => Object.hash( + applyKindSupport, + lspHashCode(itemDefaults), + ); + + @override + bool operator ==(Object other) { + return other is CompletionListCapabilities && + other.runtimeType == CompletionListCapabilities && + applyKindSupport == other.applyKindSupport && + const DeepCollectionEquality().equals(itemDefaults, other.itemDefaults); + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + if (applyKindSupport != null) { + result['applyKindSupport'] = applyKindSupport; + } + if (itemDefaults != null) { + result['itemDefaults'] = itemDefaults; + } + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + if (!_canParseBool(obj, reporter, 'applyKindSupport', + allowsUndefined: true, allowsNull: false)) { + return false; + } + return _canParseListString(obj, reporter, 'itemDefaults', + allowsUndefined: true, allowsNull: false); + } else { + reporter.reportError('must be of type CompletionListCapabilities'); + return false; + } + } + + static CompletionListCapabilities fromJson(Map<String, Object?> json) { + final applyKindSupportJson = json['applyKindSupport']; + final applyKindSupport = applyKindSupportJson as bool?; + final itemDefaultsJson = json['itemDefaults']; + final itemDefaults = (itemDefaultsJson as List<Object?>?) + ?.map((item) => item as String) + .toList(); + return CompletionListCapabilities( + applyKindSupport: applyKindSupport, + itemDefaults: itemDefaults, + ); + } +} + /// Completion options. class CompletionOptions implements WorkDoneProgressOptions, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -14849,8 +16777,11 @@ /// @since 3.16.0 final LSPAny data; - /// The diagnostic's message. It usually appears in the user interface - final String message; + /// The diagnostic's message. It usually appears in the user interface. + /// + /// @since 3.18.0 - support for MarkupContent. This is guarded by the client + /// capability `textDocument.diagnostic.markupMessageSupport`. + final Either2<MarkupContent, String> message; /// The range at which the message applies final Range range; @@ -14859,8 +16790,9 @@ /// a scope collide all definitions can be marked via this property. final List<DiagnosticRelatedInformation>? relatedInformation; - /// The diagnostic's severity. Can be omitted. If omitted it is up to the - /// client to interpret diagnostics as error, warning, info or hint. + /// The diagnostic's severity. To avoid interpretation mismatches when a + /// server is used with different clients it is highly recommended that + /// servers always provide a severity value. final DiagnosticSeverity? severity; /// A human-readable string describing the source of this diagnostic, e.g. @@ -14923,7 +16855,7 @@ if (data != null) { result['data'] = data; } - result['message'] = message; + result['message'] = message.toJson(); result['range'] = range.toJson(); if (relatedInformation != null) { result['relatedInformation'] = @@ -14954,7 +16886,7 @@ allowsUndefined: true, allowsNull: false)) { return false; } - if (!_canParseString(obj, reporter, 'message', + if (!_canParseMarkupContentString(obj, reporter, 'message', allowsUndefined: false, allowsNull: false)) { return false; } @@ -14993,7 +16925,7 @@ final dataJson = json['data']; final data = dataJson; final messageJson = json['message']; - final message = messageJson as String; + final message = _eitherMarkupContentString(messageJson); final rangeJson = json['range']; final range = Range.fromJson(rangeJson as Map<String, Object?>); final relatedInformationJson = json['relatedInformation']; @@ -15028,49 +16960,109 @@ /// Client capabilities specific to diagnostic pull requests. /// /// @since 3.17.0 -class DiagnosticClientCapabilities implements ToJsonable { +class DiagnosticClientCapabilities + implements DiagnosticsCapabilities, ToJsonable { static const jsonHandler = LspJsonHandler( DiagnosticClientCapabilities.canParse, DiagnosticClientCapabilities.fromJson, ); + /// Client supports a codeDescription property + /// + /// @since 3.16.0 + @override + 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 + @override + final bool? dataSupport; + /// 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. final bool? dynamicRegistration; + /// Whether the client supports `MarkupContent` in diagnostic messages. + /// + /// @since 3.18.0 + final bool? markupMessageSupport; + /// Whether the clients supports related documents for document diagnostic /// pulls. final bool? relatedDocumentSupport; + /// Whether the clients accepts diagnostics with related information. + @override + final bool? relatedInformation; + + /// 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 + @override + final ClientDiagnosticsTagOptions? tagSupport; DiagnosticClientCapabilities({ + this.codeDescriptionSupport, + this.dataSupport, this.dynamicRegistration, + this.markupMessageSupport, this.relatedDocumentSupport, + this.relatedInformation, + this.tagSupport, }); @override int get hashCode => Object.hash( + codeDescriptionSupport, + dataSupport, dynamicRegistration, + markupMessageSupport, relatedDocumentSupport, + relatedInformation, + tagSupport, ); @override bool operator ==(Object other) { return other is DiagnosticClientCapabilities && other.runtimeType == DiagnosticClientCapabilities && + codeDescriptionSupport == other.codeDescriptionSupport && + dataSupport == other.dataSupport && dynamicRegistration == other.dynamicRegistration && - relatedDocumentSupport == other.relatedDocumentSupport; + markupMessageSupport == other.markupMessageSupport && + relatedDocumentSupport == other.relatedDocumentSupport && + relatedInformation == other.relatedInformation && + tagSupport == other.tagSupport; } @override Map<String, Object?> toJson() { var result = <String, Object?>{}; + if (codeDescriptionSupport != null) { + result['codeDescriptionSupport'] = codeDescriptionSupport; + } + if (dataSupport != null) { + result['dataSupport'] = dataSupport; + } if (dynamicRegistration != null) { result['dynamicRegistration'] = dynamicRegistration; } + if (markupMessageSupport != null) { + result['markupMessageSupport'] = markupMessageSupport; + } if (relatedDocumentSupport != null) { result['relatedDocumentSupport'] = relatedDocumentSupport; } + if (relatedInformation != null) { + result['relatedInformation'] = relatedInformation; + } + if (tagSupport != null) { + result['tagSupport'] = tagSupport?.toJson(); + } return result; } @@ -15079,11 +17071,31 @@ static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map<String, Object?>) { + if (!_canParseBool(obj, reporter, 'codeDescriptionSupport', + allowsUndefined: true, allowsNull: false)) { + return false; + } + if (!_canParseBool(obj, reporter, 'dataSupport', + allowsUndefined: true, allowsNull: false)) { + return false; + } if (!_canParseBool(obj, reporter, 'dynamicRegistration', allowsUndefined: true, allowsNull: false)) { return false; } - return _canParseBool(obj, reporter, 'relatedDocumentSupport', + if (!_canParseBool(obj, reporter, 'markupMessageSupport', + allowsUndefined: true, allowsNull: false)) { + return false; + } + if (!_canParseBool(obj, reporter, 'relatedDocumentSupport', + allowsUndefined: true, allowsNull: false)) { + return false; + } + if (!_canParseBool(obj, reporter, 'relatedInformation', + allowsUndefined: true, allowsNull: false)) { + return false; + } + return _canParseClientDiagnosticsTagOptions(obj, reporter, 'tagSupport', allowsUndefined: true, allowsNull: false); } else { reporter.reportError('must be of type DiagnosticClientCapabilities'); @@ -15092,13 +17104,31 @@ } static DiagnosticClientCapabilities fromJson(Map<String, Object?> json) { + final codeDescriptionSupportJson = json['codeDescriptionSupport']; + final codeDescriptionSupport = codeDescriptionSupportJson as bool?; + final dataSupportJson = json['dataSupport']; + final dataSupport = dataSupportJson as bool?; final dynamicRegistrationJson = json['dynamicRegistration']; final dynamicRegistration = dynamicRegistrationJson as bool?; + final markupMessageSupportJson = json['markupMessageSupport']; + final markupMessageSupport = markupMessageSupportJson as bool?; final relatedDocumentSupportJson = json['relatedDocumentSupport']; final relatedDocumentSupport = relatedDocumentSupportJson as bool?; + final relatedInformationJson = json['relatedInformation']; + final relatedInformation = relatedInformationJson as bool?; + final tagSupportJson = json['tagSupport']; + final tagSupport = tagSupportJson != null + ? ClientDiagnosticsTagOptions.fromJson( + tagSupportJson as Map<String, Object?>) + : null; return DiagnosticClientCapabilities( + codeDescriptionSupport: codeDescriptionSupport, + dataSupport: dataSupport, dynamicRegistration: dynamicRegistration, + markupMessageSupport: markupMessageSupport, relatedDocumentSupport: relatedDocumentSupport, + relatedInformation: relatedInformation, + tagSupport: tagSupport, ); } } @@ -15432,6 +17462,128 @@ } } +/// General diagnostics capabilities for pull and push model. +class DiagnosticsCapabilities implements ToJsonable { + static const jsonHandler = LspJsonHandler( + DiagnosticsCapabilities.canParse, + DiagnosticsCapabilities.fromJson, + ); + + /// Client supports a codeDescription property + /// + /// @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 + final bool? dataSupport; + + /// Whether the clients accepts diagnostics with related information. + final bool? relatedInformation; + + /// 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 + final ClientDiagnosticsTagOptions? tagSupport; + DiagnosticsCapabilities({ + this.codeDescriptionSupport, + this.dataSupport, + this.relatedInformation, + this.tagSupport, + }); + @override + int get hashCode => Object.hash( + codeDescriptionSupport, + dataSupport, + relatedInformation, + tagSupport, + ); + + @override + bool operator ==(Object other) { + return other is DiagnosticsCapabilities && + other.runtimeType == DiagnosticsCapabilities && + codeDescriptionSupport == other.codeDescriptionSupport && + dataSupport == other.dataSupport && + relatedInformation == other.relatedInformation && + tagSupport == other.tagSupport; + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + if (codeDescriptionSupport != null) { + result['codeDescriptionSupport'] = codeDescriptionSupport; + } + if (dataSupport != null) { + result['dataSupport'] = dataSupport; + } + if (relatedInformation != null) { + result['relatedInformation'] = relatedInformation; + } + if (tagSupport != null) { + result['tagSupport'] = tagSupport?.toJson(); + } + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + if (!_canParseBool(obj, reporter, 'codeDescriptionSupport', + allowsUndefined: true, allowsNull: false)) { + return false; + } + if (!_canParseBool(obj, reporter, 'dataSupport', + allowsUndefined: true, allowsNull: false)) { + return false; + } + if (!_canParseBool(obj, reporter, 'relatedInformation', + allowsUndefined: true, allowsNull: false)) { + return false; + } + return _canParseClientDiagnosticsTagOptions(obj, reporter, 'tagSupport', + allowsUndefined: true, allowsNull: false); + } else { + reporter.reportError('must be of type DiagnosticsCapabilities'); + return false; + } + } + + static DiagnosticsCapabilities fromJson(Map<String, Object?> json) { + if (DiagnosticClientCapabilities.canParse(json, nullLspJsonReporter)) { + return DiagnosticClientCapabilities.fromJson(json); + } + if (PublishDiagnosticsClientCapabilities.canParse( + json, nullLspJsonReporter)) { + return PublishDiagnosticsClientCapabilities.fromJson(json); + } + final codeDescriptionSupportJson = json['codeDescriptionSupport']; + final codeDescriptionSupport = codeDescriptionSupportJson as bool?; + final dataSupportJson = json['dataSupport']; + final dataSupport = dataSupportJson as bool?; + final relatedInformationJson = json['relatedInformation']; + final relatedInformation = relatedInformationJson as bool?; + final tagSupportJson = json['tagSupport']; + final tagSupport = tagSupportJson != null + ? ClientDiagnosticsTagOptions.fromJson( + tagSupportJson as Map<String, Object?>) + : null; + return DiagnosticsCapabilities( + codeDescriptionSupport: codeDescriptionSupport, + dataSupport: dataSupport, + relatedInformation: relatedInformation, + tagSupport: tagSupport, + ); + } +} + /// Cancellation data returned from a diagnostic request. /// /// @since 3.17.0 @@ -18561,18 +20713,27 @@ /// Whether range formatting supports dynamic registration. final bool? dynamicRegistration; + /// Whether the client supports formatting multiple ranges at once. + /// + /// @since 3.18.0 + final bool? rangesSupport; + DocumentRangeFormattingClientCapabilities({ this.dynamicRegistration, + this.rangesSupport, }); - @override - int get hashCode => dynamicRegistration.hashCode; + int get hashCode => Object.hash( + dynamicRegistration, + rangesSupport, + ); @override bool operator ==(Object other) { return other is DocumentRangeFormattingClientCapabilities && other.runtimeType == DocumentRangeFormattingClientCapabilities && - dynamicRegistration == other.dynamicRegistration; + dynamicRegistration == other.dynamicRegistration && + rangesSupport == other.rangesSupport; } @override @@ -18581,6 +20742,9 @@ if (dynamicRegistration != null) { result['dynamicRegistration'] = dynamicRegistration; } + if (rangesSupport != null) { + result['rangesSupport'] = rangesSupport; + } return result; } @@ -18589,7 +20753,11 @@ static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map<String, Object?>) { - return _canParseBool(obj, reporter, 'dynamicRegistration', + if (!_canParseBool(obj, reporter, 'dynamicRegistration', + allowsUndefined: true, allowsNull: false)) { + return false; + } + return _canParseBool(obj, reporter, 'rangesSupport', allowsUndefined: true, allowsNull: false); } else { reporter.reportError( @@ -18602,8 +20770,11 @@ Map<String, Object?> json) { final dynamicRegistrationJson = json['dynamicRegistration']; final dynamicRegistration = dynamicRegistrationJson as bool?; + final rangesSupportJson = json['rangesSupport']; + final rangesSupport = rangesSupportJson as bool?; return DocumentRangeFormattingClientCapabilities( dynamicRegistration: dynamicRegistration, + rangesSupport: rangesSupport, ); } } @@ -18616,26 +20787,38 @@ DocumentRangeFormattingOptions.fromJson, ); + /// Whether the server supports formatting multiple ranges at once. + /// + /// @since 3.18.0 + final bool? rangesSupport; + @override final bool? workDoneProgress; DocumentRangeFormattingOptions({ + this.rangesSupport, this.workDoneProgress, }); - @override - int get hashCode => workDoneProgress.hashCode; + int get hashCode => Object.hash( + rangesSupport, + workDoneProgress, + ); @override bool operator ==(Object other) { return other is DocumentRangeFormattingOptions && other.runtimeType == DocumentRangeFormattingOptions && + rangesSupport == other.rangesSupport && workDoneProgress == other.workDoneProgress; } @override Map<String, Object?> toJson() { var result = <String, Object?>{}; + if (rangesSupport != null) { + result['rangesSupport'] = rangesSupport; + } if (workDoneProgress != null) { result['workDoneProgress'] = workDoneProgress; } @@ -18647,6 +20830,10 @@ static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map<String, Object?>) { + if (!_canParseBool(obj, reporter, 'rangesSupport', + allowsUndefined: true, allowsNull: false)) { + return false; + } return _canParseBool(obj, reporter, 'workDoneProgress', allowsUndefined: true, allowsNull: false); } else { @@ -18660,9 +20847,12 @@ json, nullLspJsonReporter)) { return DocumentRangeFormattingRegistrationOptions.fromJson(json); } + final rangesSupportJson = json['rangesSupport']; + final rangesSupport = rangesSupportJson as bool?; final workDoneProgressJson = json['workDoneProgress']; final workDoneProgress = workDoneProgressJson as bool?; return DocumentRangeFormattingOptions( + rangesSupport: rangesSupport, workDoneProgress: workDoneProgress, ); } @@ -18786,16 +20976,23 @@ @override final List<TextDocumentFilterScheme>? documentSelector; + /// Whether the server supports formatting multiple ranges at once. + /// + /// @since 3.18.0 + @override + final bool? rangesSupport; + @override final bool? workDoneProgress; - DocumentRangeFormattingRegistrationOptions({ this.documentSelector, + this.rangesSupport, this.workDoneProgress, }); @override int get hashCode => Object.hash( lspHashCode(documentSelector), + rangesSupport, workDoneProgress, ); @@ -18805,6 +21002,7 @@ other.runtimeType == DocumentRangeFormattingRegistrationOptions && const DeepCollectionEquality() .equals(documentSelector, other.documentSelector) && + rangesSupport == other.rangesSupport && workDoneProgress == other.workDoneProgress; } @@ -18812,6 +21010,9 @@ Map<String, Object?> toJson() { var result = <String, Object?>{}; result['documentSelector'] = documentSelector; + if (rangesSupport != null) { + result['rangesSupport'] = rangesSupport; + } if (workDoneProgress != null) { result['workDoneProgress'] = workDoneProgress; } @@ -18828,6 +21029,10 @@ allowsUndefined: false, allowsNull: true)) { return false; } + if (!_canParseBool(obj, reporter, 'rangesSupport', + allowsUndefined: true, allowsNull: false)) { + return false; + } return _canParseBool(obj, reporter, 'workDoneProgress', allowsUndefined: true, allowsNull: false); } else { @@ -18844,15 +21049,124 @@ ?.map((item) => TextDocumentFilterScheme.fromJson(item as Map<String, Object?>)) .toList(); + final rangesSupportJson = json['rangesSupport']; + final rangesSupport = rangesSupportJson as bool?; final workDoneProgressJson = json['workDoneProgress']; final workDoneProgress = workDoneProgressJson as bool?; return DocumentRangeFormattingRegistrationOptions( documentSelector: documentSelector, + rangesSupport: rangesSupport, workDoneProgress: workDoneProgress, ); } } +/// The parameters of a [DocumentRangesFormattingRequest]. +/// +/// @since 3.18.0 +class DocumentRangesFormattingParams + implements WorkDoneProgressParams, ToJsonable { + static const jsonHandler = LspJsonHandler( + DocumentRangesFormattingParams.canParse, + DocumentRangesFormattingParams.fromJson, + ); + + /// The format options + final FormattingOptions options; + + /// The ranges to format + final List<Range> ranges; + + /// The document to format. + final TextDocumentIdentifier textDocument; + + /// An optional token that a server can use to report work done progress. + @override + final ProgressToken? workDoneToken; + DocumentRangesFormattingParams({ + required this.options, + required this.ranges, + required this.textDocument, + this.workDoneToken, + }); + @override + int get hashCode => Object.hash( + options, + lspHashCode(ranges), + textDocument, + workDoneToken, + ); + + @override + bool operator ==(Object other) { + return other is DocumentRangesFormattingParams && + other.runtimeType == DocumentRangesFormattingParams && + options == other.options && + const DeepCollectionEquality().equals(ranges, other.ranges) && + textDocument == other.textDocument && + workDoneToken == other.workDoneToken; + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + result['options'] = options.toJson(); + result['ranges'] = ranges.map((item) => item.toJson()).toList(); + result['textDocument'] = textDocument.toJson(); + if (workDoneToken != null) { + result['workDoneToken'] = workDoneToken?.toJson(); + } + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + if (!_canParseFormattingOptions(obj, reporter, 'options', + allowsUndefined: false, allowsNull: false)) { + return false; + } + if (!_canParseListRange(obj, reporter, 'ranges', + allowsUndefined: false, allowsNull: false)) { + return false; + } + if (!_canParseTextDocumentIdentifier(obj, reporter, 'textDocument', + allowsUndefined: false, allowsNull: false)) { + return false; + } + return _canParseIntString(obj, reporter, 'workDoneToken', + allowsUndefined: true, allowsNull: false); + } else { + reporter.reportError('must be of type DocumentRangesFormattingParams'); + return false; + } + } + + static DocumentRangesFormattingParams fromJson(Map<String, Object?> json) { + final optionsJson = json['options']; + final options = + FormattingOptions.fromJson(optionsJson as Map<String, Object?>); + final rangesJson = json['ranges']; + final ranges = (rangesJson as List<Object?>) + .map((item) => Range.fromJson(item as Map<String, Object?>)) + .toList(); + final textDocumentJson = json['textDocument']; + final textDocument = TextDocumentIdentifier.fromJson( + textDocumentJson as Map<String, Object?>); + final workDoneTokenJson = json['workDoneToken']; + final workDoneToken = + workDoneTokenJson == null ? null : _eitherIntString(workDoneTokenJson); + return DocumentRangesFormattingParams( + options: options, + ranges: ranges, + textDocument: textDocument, + workDoneToken: workDoneToken, + ); + } +} + /// Represents programming constructs like variables, classes, interfaces etc. /// that appear in a document. Document symbols can be hierarchical and they /// have two ranges: one that encloses its definition and one that points to its @@ -19051,14 +21365,14 @@ /// Specific capabilities for the `SymbolKind` in the /// `textDocument/documentSymbol` request. - final DocumentSymbolClientCapabilitiesSymbolKind? symbolKind; + final ClientSymbolKindOptions? symbolKind; /// 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 - final DocumentSymbolClientCapabilitiesTagSupport? tagSupport; + final ClientSymbolTagOptions? tagSupport; DocumentSymbolClientCapabilities({ this.dynamicRegistration, this.hierarchicalDocumentSymbolSupport, @@ -19126,13 +21440,11 @@ allowsUndefined: true, allowsNull: false)) { return false; } - if (!_canParseDocumentSymbolClientCapabilitiesSymbolKind( - obj, reporter, 'symbolKind', + if (!_canParseClientSymbolKindOptions(obj, reporter, 'symbolKind', allowsUndefined: true, allowsNull: false)) { return false; } - return _canParseDocumentSymbolClientCapabilitiesTagSupport( - obj, reporter, 'tagSupport', + return _canParseClientSymbolTagOptions(obj, reporter, 'tagSupport', allowsUndefined: true, allowsNull: false); } else { reporter.reportError('must be of type DocumentSymbolClientCapabilities'); @@ -19151,12 +21463,12 @@ final labelSupport = labelSupportJson as bool?; final symbolKindJson = json['symbolKind']; final symbolKind = symbolKindJson != null - ? DocumentSymbolClientCapabilitiesSymbolKind.fromJson( + ? ClientSymbolKindOptions.fromJson( symbolKindJson as Map<String, Object?>) : null; final tagSupportJson = json['tagSupport']; final tagSupport = tagSupportJson != null - ? DocumentSymbolClientCapabilitiesTagSupport.fromJson( + ? ClientSymbolTagOptions.fromJson( tagSupportJson as Map<String, Object?>) : null; return DocumentSymbolClientCapabilities( @@ -19169,125 +21481,6 @@ } } -class DocumentSymbolClientCapabilitiesSymbolKind implements ToJsonable { - static const jsonHandler = LspJsonHandler( - DocumentSymbolClientCapabilitiesSymbolKind.canParse, - DocumentSymbolClientCapabilitiesSymbolKind.fromJson, - ); - - /// The symbol kind values the client supports. When this property exists the - /// client also guarantees that it will handle values outside its set - /// gracefully and falls back to a default value when unknown. - /// - /// If this property is not present the client only supports the symbol kinds - /// from `File` to `Array` as defined in the initial version of the protocol. - final List<SymbolKind>? valueSet; - - DocumentSymbolClientCapabilitiesSymbolKind({ - this.valueSet, - }); - - @override - int get hashCode => lspHashCode(valueSet); - - @override - bool operator ==(Object other) { - return other is DocumentSymbolClientCapabilitiesSymbolKind && - other.runtimeType == DocumentSymbolClientCapabilitiesSymbolKind && - const DeepCollectionEquality().equals(valueSet, other.valueSet); - } - - @override - Map<String, Object?> toJson() { - var result = <String, Object?>{}; - if (valueSet != null) { - result['valueSet'] = valueSet?.map((item) => item.toJson()).toList(); - } - return result; - } - - @override - String toString() => jsonEncoder.convert(toJson()); - - static bool canParse(Object? obj, LspJsonReporter reporter) { - if (obj is Map<String, Object?>) { - return _canParseListSymbolKind(obj, reporter, 'valueSet', - allowsUndefined: true, allowsNull: false); - } else { - reporter.reportError( - 'must be of type DocumentSymbolClientCapabilitiesSymbolKind'); - return false; - } - } - - static DocumentSymbolClientCapabilitiesSymbolKind fromJson( - Map<String, Object?> json) { - final valueSetJson = json['valueSet']; - final valueSet = (valueSetJson as List<Object?>?) - ?.map((item) => SymbolKind.fromJson(item as int)) - .toList(); - return DocumentSymbolClientCapabilitiesSymbolKind( - valueSet: valueSet, - ); - } -} - -class DocumentSymbolClientCapabilitiesTagSupport implements ToJsonable { - static const jsonHandler = LspJsonHandler( - DocumentSymbolClientCapabilitiesTagSupport.canParse, - DocumentSymbolClientCapabilitiesTagSupport.fromJson, - ); - - /// The tags supported by the client. - final List<SymbolTag> valueSet; - - DocumentSymbolClientCapabilitiesTagSupport({ - required this.valueSet, - }); - - @override - int get hashCode => lspHashCode(valueSet); - - @override - bool operator ==(Object other) { - return other is DocumentSymbolClientCapabilitiesTagSupport && - other.runtimeType == DocumentSymbolClientCapabilitiesTagSupport && - const DeepCollectionEquality().equals(valueSet, other.valueSet); - } - - @override - Map<String, Object?> toJson() { - var result = <String, Object?>{}; - result['valueSet'] = valueSet.map((item) => item.toJson()).toList(); - return result; - } - - @override - String toString() => jsonEncoder.convert(toJson()); - - static bool canParse(Object? obj, LspJsonReporter reporter) { - if (obj is Map<String, Object?>) { - return _canParseListSymbolTag(obj, reporter, 'valueSet', - allowsUndefined: false, allowsNull: false); - } else { - reporter.reportError( - 'must be of type DocumentSymbolClientCapabilitiesTagSupport'); - return false; - } - } - - static DocumentSymbolClientCapabilitiesTagSupport fromJson( - Map<String, Object?> json) { - final valueSetJson = json['valueSet']; - final valueSet = (valueSetJson as List<Object?>) - .map((item) => SymbolTag.fromJson(item as int)) - .toList(); - return DocumentSymbolClientCapabilitiesTagSupport( - valueSet: valueSet, - ); - } -} - /// Provider options for a [DocumentSymbolRequest]. class DocumentSymbolOptions implements WorkDoneProgressOptions, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -19559,6 +21752,9 @@ } } +/// Edit range variant that includes ranges for insert and replace operations. +/// +/// @since 3.18.0 class EditRangeWithInsertReplace implements ToJsonable { static const jsonHandler = LspJsonHandler( EditRangeWithInsertReplace.canParse, @@ -19642,7 +21838,7 @@ static const MethodNotFound = ErrorCodes(-32601); static const ParseError = ErrorCodes(-32700); - /// The client has canceled a request and a server as detected the cancel. + /// The client has canceled a request and a server has detected the cancel. static const RequestCancelled = ErrorCodes(-32800); /// A request failed but it was syntactically correct, e.g the method name was @@ -20700,7 +22896,7 @@ ); /// The glob pattern to match. Glob patterns can have the following syntax: - /// - `*` to match one or more characters in a path segment + /// - `*` to match zero 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}` @@ -21243,12 +23439,12 @@ /// Specific options for the folding range. /// /// @since 3.17.0 - final FoldingRangeClientCapabilitiesFoldingRange? foldingRange; + final ClientFoldingRangeOptions? foldingRange; /// Specific options for the folding range kind. /// /// @since 3.17.0 - final FoldingRangeClientCapabilitiesFoldingRangeKind? foldingRangeKind; + final ClientFoldingRangeKindOptions? foldingRangeKind; /// If set, the client signals that it only supports folding complete lines. /// If set, client will ignore specified `startCharacter` and `endCharacter` @@ -21316,12 +23512,11 @@ allowsUndefined: true, allowsNull: false)) { return false; } - if (!_canParseFoldingRangeClientCapabilitiesFoldingRange( - obj, reporter, 'foldingRange', + if (!_canParseClientFoldingRangeOptions(obj, reporter, 'foldingRange', allowsUndefined: true, allowsNull: false)) { return false; } - if (!_canParseFoldingRangeClientCapabilitiesFoldingRangeKind( + if (!_canParseClientFoldingRangeKindOptions( obj, reporter, 'foldingRangeKind', allowsUndefined: true, allowsNull: false)) { return false; @@ -21343,12 +23538,12 @@ final dynamicRegistration = dynamicRegistrationJson as bool?; final foldingRangeJson = json['foldingRange']; final foldingRange = foldingRangeJson != null - ? FoldingRangeClientCapabilitiesFoldingRange.fromJson( + ? ClientFoldingRangeOptions.fromJson( foldingRangeJson as Map<String, Object?>) : null; final foldingRangeKindJson = json['foldingRangeKind']; final foldingRangeKind = foldingRangeKindJson != null - ? FoldingRangeClientCapabilitiesFoldingRangeKind.fromJson( + ? ClientFoldingRangeKindOptions.fromJson( foldingRangeKindJson as Map<String, Object?>) : null; final lineFoldingOnlyJson = json['lineFoldingOnly']; @@ -21365,125 +23560,6 @@ } } -class FoldingRangeClientCapabilitiesFoldingRange implements ToJsonable { - static const jsonHandler = LspJsonHandler( - FoldingRangeClientCapabilitiesFoldingRange.canParse, - FoldingRangeClientCapabilitiesFoldingRange.fromJson, - ); - - /// 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 - final bool? collapsedText; - - FoldingRangeClientCapabilitiesFoldingRange({ - this.collapsedText, - }); - - @override - int get hashCode => collapsedText.hashCode; - - @override - bool operator ==(Object other) { - return other is FoldingRangeClientCapabilitiesFoldingRange && - other.runtimeType == FoldingRangeClientCapabilitiesFoldingRange && - collapsedText == other.collapsedText; - } - - @override - Map<String, Object?> toJson() { - var result = <String, Object?>{}; - if (collapsedText != null) { - result['collapsedText'] = collapsedText; - } - return result; - } - - @override - String toString() => jsonEncoder.convert(toJson()); - - static bool canParse(Object? obj, LspJsonReporter reporter) { - if (obj is Map<String, Object?>) { - return _canParseBool(obj, reporter, 'collapsedText', - allowsUndefined: true, allowsNull: false); - } else { - reporter.reportError( - 'must be of type FoldingRangeClientCapabilitiesFoldingRange'); - return false; - } - } - - static FoldingRangeClientCapabilitiesFoldingRange fromJson( - Map<String, Object?> json) { - final collapsedTextJson = json['collapsedText']; - final collapsedText = collapsedTextJson as bool?; - return FoldingRangeClientCapabilitiesFoldingRange( - collapsedText: collapsedText, - ); - } -} - -class FoldingRangeClientCapabilitiesFoldingRangeKind implements ToJsonable { - static const jsonHandler = LspJsonHandler( - FoldingRangeClientCapabilitiesFoldingRangeKind.canParse, - FoldingRangeClientCapabilitiesFoldingRangeKind.fromJson, - ); - - /// The folding range kind values the client supports. When this property - /// exists the client also guarantees that it will handle values outside its - /// set gracefully and falls back to a default value when unknown. - final List<FoldingRangeKind>? valueSet; - - FoldingRangeClientCapabilitiesFoldingRangeKind({ - this.valueSet, - }); - - @override - int get hashCode => lspHashCode(valueSet); - - @override - bool operator ==(Object other) { - return other is FoldingRangeClientCapabilitiesFoldingRangeKind && - other.runtimeType == FoldingRangeClientCapabilitiesFoldingRangeKind && - const DeepCollectionEquality().equals(valueSet, other.valueSet); - } - - @override - Map<String, Object?> toJson() { - var result = <String, Object?>{}; - if (valueSet != null) { - result['valueSet'] = valueSet?.map((item) => item.toJson()).toList(); - } - return result; - } - - @override - String toString() => jsonEncoder.convert(toJson()); - - static bool canParse(Object? obj, LspJsonReporter reporter) { - if (obj is Map<String, Object?>) { - return _canParseListFoldingRangeKind(obj, reporter, 'valueSet', - allowsUndefined: true, allowsNull: false); - } else { - reporter.reportError( - 'must be of type FoldingRangeClientCapabilitiesFoldingRangeKind'); - return false; - } - } - - static FoldingRangeClientCapabilitiesFoldingRangeKind fromJson( - Map<String, Object?> json) { - final valueSetJson = json['valueSet']; - final valueSet = (valueSetJson as List<Object?>?) - ?.map((item) => FoldingRangeKind.fromJson(item as String)) - .toList(); - return FoldingRangeClientCapabilitiesFoldingRangeKind( - valueSet: valueSet, - ); - } -} - /// A set of predefined range kinds. class FoldingRangeKind implements ToJsonable { /// Folding range for a comment @@ -21762,6 +23838,73 @@ } } +/// Client workspace capabilities specific to folding ranges +/// +/// @since 3.18.0 +class FoldingRangeWorkspaceClientCapabilities implements ToJsonable { + static const jsonHandler = LspJsonHandler( + FoldingRangeWorkspaceClientCapabilities.canParse, + FoldingRangeWorkspaceClientCapabilities.fromJson, + ); + + /// Whether the client implementation supports a refresh request sent from the + /// server to the client. + /// + /// Note that this event is global and will force the client to refresh all + /// folding ranges currently shown. It should be used with absolute care and + /// is useful for situation where a server for example detects a project wide + /// change that requires such a calculation. + /// + /// @since 3.18.0 + final bool? refreshSupport; + + FoldingRangeWorkspaceClientCapabilities({ + this.refreshSupport, + }); + + @override + int get hashCode => refreshSupport.hashCode; + + @override + bool operator ==(Object other) { + return other is FoldingRangeWorkspaceClientCapabilities && + other.runtimeType == FoldingRangeWorkspaceClientCapabilities && + refreshSupport == other.refreshSupport; + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + if (refreshSupport != null) { + result['refreshSupport'] = refreshSupport; + } + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + return _canParseBool(obj, reporter, 'refreshSupport', + allowsUndefined: true, allowsNull: false); + } else { + reporter.reportError( + 'must be of type FoldingRangeWorkspaceClientCapabilities'); + return false; + } + } + + static FoldingRangeWorkspaceClientCapabilities fromJson( + Map<String, Object?> json) { + final refreshSupportJson = json['refreshSupport']; + final refreshSupport = refreshSupportJson as bool?; + return FoldingRangeWorkspaceClientCapabilities( + refreshSupport: refreshSupport, + ); + } +} + /// Value-object describing what options formatting should use. class FormattingOptions implements ToJsonable { static const jsonHandler = LspJsonHandler( @@ -22025,7 +24168,7 @@ /// the information is outdated). /// /// @since 3.17.0 - final GeneralClientCapabilitiesStaleRequestSupport? staleRequestSupport; + final StaleRequestSupportOptions? staleRequestSupport; GeneralClientCapabilities({ this.markdown, this.positionEncodings, @@ -22088,7 +24231,7 @@ allowsUndefined: true, allowsNull: false)) { return false; } - return _canParseGeneralClientCapabilitiesStaleRequestSupport( + return _canParseStaleRequestSupportOptions( obj, reporter, 'staleRequestSupport', allowsUndefined: true, allowsNull: false); } else { @@ -22114,7 +24257,7 @@ : null; final staleRequestSupportJson = json['staleRequestSupport']; final staleRequestSupport = staleRequestSupportJson != null - ? GeneralClientCapabilitiesStaleRequestSupport.fromJson( + ? StaleRequestSupportOptions.fromJson( staleRequestSupportJson as Map<String, Object?>) : null; return GeneralClientCapabilities( @@ -22126,79 +24269,6 @@ } } -class GeneralClientCapabilitiesStaleRequestSupport implements ToJsonable { - static const jsonHandler = LspJsonHandler( - GeneralClientCapabilitiesStaleRequestSupport.canParse, - GeneralClientCapabilitiesStaleRequestSupport.fromJson, - ); - - /// The client will actively cancel the request. - final bool cancel; - - /// The list of requests for which the client will retry the request if it - /// receives a response with error code `ContentModified` - final List<String> retryOnContentModified; - - GeneralClientCapabilitiesStaleRequestSupport({ - required this.cancel, - required this.retryOnContentModified, - }); - @override - int get hashCode => Object.hash( - cancel, - lspHashCode(retryOnContentModified), - ); - - @override - bool operator ==(Object other) { - return other is GeneralClientCapabilitiesStaleRequestSupport && - other.runtimeType == GeneralClientCapabilitiesStaleRequestSupport && - cancel == other.cancel && - const DeepCollectionEquality() - .equals(retryOnContentModified, other.retryOnContentModified); - } - - @override - Map<String, Object?> toJson() { - var result = <String, Object?>{}; - result['cancel'] = cancel; - result['retryOnContentModified'] = retryOnContentModified; - return result; - } - - @override - String toString() => jsonEncoder.convert(toJson()); - - static bool canParse(Object? obj, LspJsonReporter reporter) { - if (obj is Map<String, Object?>) { - if (!_canParseBool(obj, reporter, 'cancel', - allowsUndefined: false, allowsNull: false)) { - return false; - } - return _canParseListString(obj, reporter, 'retryOnContentModified', - allowsUndefined: false, allowsNull: false); - } else { - reporter.reportError( - 'must be of type GeneralClientCapabilitiesStaleRequestSupport'); - return false; - } - } - - static GeneralClientCapabilitiesStaleRequestSupport fromJson( - Map<String, Object?> json) { - final cancelJson = json['cancel']; - final cancel = cancelJson as bool; - final retryOnContentModifiedJson = json['retryOnContentModified']; - final retryOnContentModified = (retryOnContentModifiedJson as List<Object?>) - .map((item) => item as String) - .toList(); - return GeneralClientCapabilitiesStaleRequestSupport( - cancel: cancel, - retryOnContentModified: retryOnContentModified, - ); - } -} - /// The result of a hover request. class Hover implements ToJsonable { static const jsonHandler = LspJsonHandler( @@ -23285,6 +25355,9 @@ final bool? paddingRight; /// The position of this hint. + /// + /// If multiple hints have the same position, they will be shown in the order + /// they appear in the response. final Position position; /// Optional text edits that are performed when accepting this inlay hint. @@ -23442,7 +25515,7 @@ final bool? dynamicRegistration; /// Indicates which properties a client can resolve lazily on an inlay hint. - final InlayHintClientCapabilitiesResolveSupport? resolveSupport; + final ClientInlayHintResolveOptions? resolveSupport; InlayHintClientCapabilities({ this.dynamicRegistration, @@ -23483,7 +25556,7 @@ allowsUndefined: true, allowsNull: false)) { return false; } - return _canParseInlayHintClientCapabilitiesResolveSupport( + return _canParseClientInlayHintResolveOptions( obj, reporter, 'resolveSupport', allowsUndefined: true, allowsNull: false); } else { @@ -23497,7 +25570,7 @@ final dynamicRegistration = dynamicRegistrationJson as bool?; final resolveSupportJson = json['resolveSupport']; final resolveSupport = resolveSupportJson != null - ? InlayHintClientCapabilitiesResolveSupport.fromJson( + ? ClientInlayHintResolveOptions.fromJson( resolveSupportJson as Map<String, Object?>) : null; return InlayHintClientCapabilities( @@ -23507,62 +25580,6 @@ } } -class InlayHintClientCapabilitiesResolveSupport implements ToJsonable { - static const jsonHandler = LspJsonHandler( - InlayHintClientCapabilitiesResolveSupport.canParse, - InlayHintClientCapabilitiesResolveSupport.fromJson, - ); - - /// The properties that a client can resolve lazily. - final List<String> properties; - - InlayHintClientCapabilitiesResolveSupport({ - required this.properties, - }); - - @override - int get hashCode => lspHashCode(properties); - - @override - bool operator ==(Object other) { - return other is InlayHintClientCapabilitiesResolveSupport && - other.runtimeType == InlayHintClientCapabilitiesResolveSupport && - const DeepCollectionEquality().equals(properties, other.properties); - } - - @override - Map<String, Object?> toJson() { - var result = <String, Object?>{}; - result['properties'] = properties; - return result; - } - - @override - String toString() => jsonEncoder.convert(toJson()); - - static bool canParse(Object? obj, LspJsonReporter reporter) { - if (obj is Map<String, Object?>) { - return _canParseListString(obj, reporter, 'properties', - allowsUndefined: false, allowsNull: false); - } else { - reporter.reportError( - 'must be of type InlayHintClientCapabilitiesResolveSupport'); - return false; - } - } - - static InlayHintClientCapabilitiesResolveSupport fromJson( - Map<String, Object?> json) { - final propertiesJson = json['properties']; - final properties = (propertiesJson as List<Object?>) - .map((item) => item as String) - .toList(); - return InlayHintClientCapabilitiesResolveSupport( - properties: properties, - ); - } -} - /// Inlay hint kinds. /// /// @since 3.17.0 @@ -24065,6 +26082,614 @@ } } +/// Client capabilities specific to inline completions. +/// +/// @since 3.18.0 +class InlineCompletionClientCapabilities implements ToJsonable { + static const jsonHandler = LspJsonHandler( + InlineCompletionClientCapabilities.canParse, + InlineCompletionClientCapabilities.fromJson, + ); + + /// Whether implementation supports dynamic registration for inline completion + /// providers. + final bool? dynamicRegistration; + + InlineCompletionClientCapabilities({ + this.dynamicRegistration, + }); + + @override + int get hashCode => dynamicRegistration.hashCode; + + @override + bool operator ==(Object other) { + return other is InlineCompletionClientCapabilities && + other.runtimeType == InlineCompletionClientCapabilities && + dynamicRegistration == other.dynamicRegistration; + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + if (dynamicRegistration != null) { + result['dynamicRegistration'] = dynamicRegistration; + } + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + return _canParseBool(obj, reporter, 'dynamicRegistration', + allowsUndefined: true, allowsNull: false); + } else { + reporter + .reportError('must be of type InlineCompletionClientCapabilities'); + return false; + } + } + + static InlineCompletionClientCapabilities fromJson( + Map<String, Object?> json) { + final dynamicRegistrationJson = json['dynamicRegistration']; + final dynamicRegistration = dynamicRegistrationJson as bool?; + return InlineCompletionClientCapabilities( + dynamicRegistration: dynamicRegistration, + ); + } +} + +/// Provides information about the context in which an inline completion was +/// requested. +/// +/// @since 3.18.0 +class InlineCompletionContext implements ToJsonable { + static const jsonHandler = LspJsonHandler( + InlineCompletionContext.canParse, + InlineCompletionContext.fromJson, + ); + + /// Provides information about the currently selected item in the autocomplete + /// widget if it is visible. + final SelectedCompletionInfo? selectedCompletionInfo; + + /// Describes how the inline completion was triggered. + final InlineCompletionTriggerKind triggerKind; + + InlineCompletionContext({ + this.selectedCompletionInfo, + required this.triggerKind, + }); + @override + int get hashCode => Object.hash( + selectedCompletionInfo, + triggerKind, + ); + + @override + bool operator ==(Object other) { + return other is InlineCompletionContext && + other.runtimeType == InlineCompletionContext && + selectedCompletionInfo == other.selectedCompletionInfo && + triggerKind == other.triggerKind; + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + if (selectedCompletionInfo != null) { + result['selectedCompletionInfo'] = selectedCompletionInfo?.toJson(); + } + result['triggerKind'] = triggerKind.toJson(); + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + if (!_canParseSelectedCompletionInfo( + obj, reporter, 'selectedCompletionInfo', + allowsUndefined: true, allowsNull: false)) { + return false; + } + return _canParseInlineCompletionTriggerKind(obj, reporter, 'triggerKind', + allowsUndefined: false, allowsNull: false); + } else { + reporter.reportError('must be of type InlineCompletionContext'); + return false; + } + } + + static InlineCompletionContext fromJson(Map<String, Object?> json) { + final selectedCompletionInfoJson = json['selectedCompletionInfo']; + final selectedCompletionInfo = selectedCompletionInfoJson != null + ? SelectedCompletionInfo.fromJson( + selectedCompletionInfoJson as Map<String, Object?>) + : null; + final triggerKindJson = json['triggerKind']; + final triggerKind = + InlineCompletionTriggerKind.fromJson(triggerKindJson as int); + return InlineCompletionContext( + selectedCompletionInfo: selectedCompletionInfo, + triggerKind: triggerKind, + ); + } +} + +/// An inline completion item represents a text snippet that is proposed inline +/// to complete text that is being typed. +/// +/// @since 3.18.0 +class InlineCompletionItem implements ToJsonable { + static const jsonHandler = LspJsonHandler( + InlineCompletionItem.canParse, + InlineCompletionItem.fromJson, + ); + + /// An optional [Command] that is executed *after* inserting this completion. + final Command? command; + + /// A text that is used to decide if this inline completion should be shown. + /// When `falsy` the [InlineCompletionItem.insertText] is used. + final String? filterText; + + /// The text to replace the range with. Must be set. + final Either2<String, StringValue> insertText; + + /// The range to replace. Must begin and end on the same line. + final Range? range; + InlineCompletionItem({ + this.command, + this.filterText, + required this.insertText, + this.range, + }); + @override + int get hashCode => Object.hash( + command, + filterText, + insertText, + range, + ); + + @override + bool operator ==(Object other) { + return other is InlineCompletionItem && + other.runtimeType == InlineCompletionItem && + command == other.command && + filterText == other.filterText && + insertText == other.insertText && + range == other.range; + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + if (command != null) { + result['command'] = command?.toJson(); + } + if (filterText != null) { + result['filterText'] = filterText; + } + result['insertText'] = insertText.toJson(); + if (range != null) { + result['range'] = range?.toJson(); + } + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + if (!_canParseCommand(obj, reporter, 'command', + allowsUndefined: true, allowsNull: false)) { + return false; + } + if (!_canParseString(obj, reporter, 'filterText', + allowsUndefined: true, allowsNull: false)) { + return false; + } + if (!_canParseStringStringValue(obj, reporter, 'insertText', + allowsUndefined: false, allowsNull: false)) { + return false; + } + return _canParseRange(obj, reporter, 'range', + allowsUndefined: true, allowsNull: false); + } else { + reporter.reportError('must be of type InlineCompletionItem'); + return false; + } + } + + static InlineCompletionItem fromJson(Map<String, Object?> json) { + final commandJson = json['command']; + final command = commandJson != null + ? Command.fromJson(commandJson as Map<String, Object?>) + : null; + final filterTextJson = json['filterText']; + final filterText = filterTextJson as String?; + final insertTextJson = json['insertText']; + final insertText = _eitherStringStringValue(insertTextJson); + final rangeJson = json['range']; + final range = rangeJson != null + ? Range.fromJson(rangeJson as Map<String, Object?>) + : null; + return InlineCompletionItem( + command: command, + filterText: filterText, + insertText: insertText, + range: range, + ); + } +} + +/// Represents a collection of [InlineCompletionItem] to be presented in the +/// editor. +/// +/// @since 3.18.0 +class InlineCompletionList implements ToJsonable { + static const jsonHandler = LspJsonHandler( + InlineCompletionList.canParse, + InlineCompletionList.fromJson, + ); + + /// The inline completion items + final List<InlineCompletionItem> items; + + InlineCompletionList({ + required this.items, + }); + + @override + int get hashCode => lspHashCode(items); + + @override + bool operator ==(Object other) { + return other is InlineCompletionList && + other.runtimeType == InlineCompletionList && + const DeepCollectionEquality().equals(items, other.items); + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + result['items'] = items.map((item) => item.toJson()).toList(); + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + return _canParseListInlineCompletionItem(obj, reporter, 'items', + allowsUndefined: false, allowsNull: false); + } else { + reporter.reportError('must be of type InlineCompletionList'); + return false; + } + } + + static InlineCompletionList fromJson(Map<String, Object?> json) { + final itemsJson = json['items']; + final items = (itemsJson as List<Object?>) + .map((item) => + InlineCompletionItem.fromJson(item as Map<String, Object?>)) + .toList(); + return InlineCompletionList( + items: items, + ); + } +} + +/// Inline completion options used during static registration. +/// +/// @since 3.18.0 +class InlineCompletionOptions implements WorkDoneProgressOptions, ToJsonable { + static const jsonHandler = LspJsonHandler( + InlineCompletionOptions.canParse, + InlineCompletionOptions.fromJson, + ); + + @override + final bool? workDoneProgress; + + InlineCompletionOptions({ + this.workDoneProgress, + }); + + @override + int get hashCode => workDoneProgress.hashCode; + + @override + bool operator ==(Object other) { + return other is InlineCompletionOptions && + other.runtimeType == InlineCompletionOptions && + workDoneProgress == other.workDoneProgress; + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + if (workDoneProgress != null) { + result['workDoneProgress'] = workDoneProgress; + } + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + return _canParseBool(obj, reporter, 'workDoneProgress', + allowsUndefined: true, allowsNull: false); + } else { + reporter.reportError('must be of type InlineCompletionOptions'); + return false; + } + } + + static InlineCompletionOptions fromJson(Map<String, Object?> json) { + if (InlineCompletionRegistrationOptions.canParse( + json, nullLspJsonReporter)) { + return InlineCompletionRegistrationOptions.fromJson(json); + } + final workDoneProgressJson = json['workDoneProgress']; + final workDoneProgress = workDoneProgressJson as bool?; + return InlineCompletionOptions( + workDoneProgress: workDoneProgress, + ); + } +} + +/// A parameter literal used in inline completion requests. +/// +/// @since 3.18.0 +class InlineCompletionParams + implements TextDocumentPositionParams, WorkDoneProgressParams, ToJsonable { + static const jsonHandler = LspJsonHandler( + InlineCompletionParams.canParse, + InlineCompletionParams.fromJson, + ); + + /// Additional information about the context in which inline completions were + /// requested. + final InlineCompletionContext context; + + /// The position inside the text document. + @override + final Position position; + + /// The text document. + @override + final TextDocumentIdentifier textDocument; + + /// An optional token that a server can use to report work done progress. + @override + final ProgressToken? workDoneToken; + InlineCompletionParams({ + required this.context, + required this.position, + required this.textDocument, + this.workDoneToken, + }); + @override + int get hashCode => Object.hash( + context, + position, + textDocument, + workDoneToken, + ); + + @override + bool operator ==(Object other) { + return other is InlineCompletionParams && + other.runtimeType == InlineCompletionParams && + context == other.context && + position == other.position && + textDocument == other.textDocument && + workDoneToken == other.workDoneToken; + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + result['context'] = context.toJson(); + result['position'] = position.toJson(); + result['textDocument'] = textDocument.toJson(); + if (workDoneToken != null) { + result['workDoneToken'] = workDoneToken?.toJson(); + } + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + if (!_canParseInlineCompletionContext(obj, reporter, 'context', + allowsUndefined: false, allowsNull: false)) { + return false; + } + if (!_canParsePosition(obj, reporter, 'position', + allowsUndefined: false, allowsNull: false)) { + return false; + } + if (!_canParseTextDocumentIdentifier(obj, reporter, 'textDocument', + allowsUndefined: false, allowsNull: false)) { + return false; + } + return _canParseIntString(obj, reporter, 'workDoneToken', + allowsUndefined: true, allowsNull: false); + } else { + reporter.reportError('must be of type InlineCompletionParams'); + return false; + } + } + + static InlineCompletionParams fromJson(Map<String, Object?> json) { + final contextJson = json['context']; + final context = + InlineCompletionContext.fromJson(contextJson as Map<String, Object?>); + final positionJson = json['position']; + final position = Position.fromJson(positionJson as Map<String, Object?>); + final textDocumentJson = json['textDocument']; + final textDocument = TextDocumentIdentifier.fromJson( + textDocumentJson as Map<String, Object?>); + final workDoneTokenJson = json['workDoneToken']; + final workDoneToken = + workDoneTokenJson == null ? null : _eitherIntString(workDoneTokenJson); + return InlineCompletionParams( + context: context, + position: position, + textDocument: textDocument, + workDoneToken: workDoneToken, + ); + } +} + +/// Inline completion options used during static or dynamic registration. +/// +/// @since 3.18.0 +class InlineCompletionRegistrationOptions + implements + InlineCompletionOptions, + StaticRegistrationOptions, + TextDocumentRegistrationOptions, + ToJsonable { + static const jsonHandler = LspJsonHandler( + InlineCompletionRegistrationOptions.canParse, + InlineCompletionRegistrationOptions.fromJson, + ); + + /// A document selector to identify the scope of the registration. If set to + /// null the document selector provided on the client side will be used. + @override + final List<TextDocumentFilterScheme>? documentSelector; + + /// The id used to register the request. The id can be used to deregister the + /// request again. See also Registration#id. + @override + final String? id; + + @override + final bool? workDoneProgress; + InlineCompletionRegistrationOptions({ + this.documentSelector, + this.id, + this.workDoneProgress, + }); + @override + int get hashCode => Object.hash( + lspHashCode(documentSelector), + id, + workDoneProgress, + ); + + @override + bool operator ==(Object other) { + return other is InlineCompletionRegistrationOptions && + other.runtimeType == InlineCompletionRegistrationOptions && + const DeepCollectionEquality() + .equals(documentSelector, other.documentSelector) && + id == other.id && + workDoneProgress == other.workDoneProgress; + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + result['documentSelector'] = documentSelector; + if (id != null) { + result['id'] = id; + } + if (workDoneProgress != null) { + result['workDoneProgress'] = workDoneProgress; + } + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + if (!_canParseListTextDocumentFilterScheme( + obj, reporter, 'documentSelector', + allowsUndefined: false, allowsNull: true)) { + return false; + } + if (!_canParseString(obj, reporter, 'id', + allowsUndefined: true, allowsNull: false)) { + return false; + } + return _canParseBool(obj, reporter, 'workDoneProgress', + allowsUndefined: true, allowsNull: false); + } else { + reporter + .reportError('must be of type InlineCompletionRegistrationOptions'); + return false; + } + } + + static InlineCompletionRegistrationOptions fromJson( + Map<String, Object?> json) { + final documentSelectorJson = json['documentSelector']; + final documentSelector = (documentSelectorJson as List<Object?>?) + ?.map((item) => + TextDocumentFilterScheme.fromJson(item as Map<String, Object?>)) + .toList(); + final idJson = json['id']; + final id = idJson as String?; + final workDoneProgressJson = json['workDoneProgress']; + final workDoneProgress = workDoneProgressJson as bool?; + return InlineCompletionRegistrationOptions( + documentSelector: documentSelector, + id: id, + workDoneProgress: workDoneProgress, + ); + } +} + +/// Describes how an [InlineCompletionItemProvider] was triggered. +/// +/// @since 3.18.0 +class InlineCompletionTriggerKind implements ToJsonable { + /// Completion was triggered automatically while editing. + static const Automatic = InlineCompletionTriggerKind(2); + + /// Completion was triggered explicitly by a user gesture. + static const Invoked = InlineCompletionTriggerKind(1); + + final int _value; + + const InlineCompletionTriggerKind(this._value); + const InlineCompletionTriggerKind.fromJson(this._value); + @override + int get hashCode => _value.hashCode; + + @override + bool operator ==(Object other) => + other is InlineCompletionTriggerKind && other._value == _value; + + @override + int toJson() => _value; + + @override + String toString() => _value.toString(); + + static bool canParse(Object? obj, LspJsonReporter reporter) => obj is int; +} + /// Client capabilities specific to inline values. /// /// @since 3.17.0 @@ -24193,9 +26818,13 @@ } } -/// 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. +/// To compute an inline value through an expression evaluation. +/// +/// If only a range is specified, the expression should be extracted from the +/// underlying document. +/// +/// An optional expression could be evaluated instead of the extracted +/// expression. /// /// @since 3.17.0 class InlineValueEvaluatableExpression implements ToJsonable { @@ -24204,11 +26833,13 @@ InlineValueEvaluatableExpression.fromJson, ); - /// If specified the expression overrides the extracted expression. + /// If specified the expression could be evaluated instead. final String? expression; - /// The document range for which the inline value applies. The range is used - /// to extract the evaluatable expression from the underlying document. + /// The document range for which the inline value applies. + /// + /// The range could be used to extract the evaluatable expression from the + /// underlying document. final Range range; InlineValueEvaluatableExpression({ @@ -24337,11 +26968,11 @@ InlineValueParams.fromJson, ); - /// Additional information about the context in which inline values were - /// requested. + /// Additional information about the context in which inline values + /// information was requested. final InlineValueContext context; - /// The document range for which inline values should be computed. + /// The document range for which inline values information will be returned. final Range range; /// The text document. @@ -24533,7 +27164,7 @@ } } -/// Provide inline value as text. +/// Returns inline value information as the complete text to be shown. /// /// @since 3.17.0 class InlineValueText implements ToJsonable { @@ -24603,9 +27234,13 @@ } } -/// 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. +/// To compute inline value through a variable lookup. +/// +/// If only a range is specified, the variable name should be extracted from the +/// underlying document. +/// +/// An optional variable name could be used to lookup instead of the extracted +/// name. /// /// @since 3.17.0 class InlineValueVariableLookup implements ToJsonable { @@ -24617,8 +27252,10 @@ /// How to perform the lookup. final bool caseSensitiveLookup; - /// The document range for which the inline value applies. The range is used - /// to extract the variable name from the underlying document. + /// The document range for which the inline value applies. + /// + /// The range could be used to extract the variable name from the underlying + /// document. final Range range; /// If specified the name of the variable to look up. @@ -24921,6 +27558,98 @@ static bool canParse(Object? obj, LspJsonReporter reporter) => obj is int; } +/// Predefined Language kinds +/// @since 3.18.0 +class LanguageKind implements ToJsonable { + static const ABAP = LanguageKind('abap'); + static const BibTeX = LanguageKind('bibtex'); + + static const C = LanguageKind('c'); + + static const Clojure = LanguageKind('clojure'); + static const Coffeescript = LanguageKind('coffeescript'); + static const CPP = LanguageKind('cpp'); + static const CSharp = LanguageKind('csharp'); + static const CSS = LanguageKind('css'); + + /// @since 3.18.0 + static const D = LanguageKind('d'); + static const Dart = LanguageKind('dart'); + + /// @since 3.18.0 + static const Delphi = LanguageKind('pascal'); + static const Diff = LanguageKind('diff'); + static const Dockerfile = LanguageKind('dockerfile'); + static const Elixir = LanguageKind('elixir'); + static const Erlang = LanguageKind('erlang'); + static const FSharp = LanguageKind('fsharp'); + static const GitCommit = LanguageKind('git-commit'); + static const GitRebase = LanguageKind('git-rebase'); + static const Go = LanguageKind('go'); + static const Groovy = LanguageKind('groovy'); + static const Handlebars = LanguageKind('handlebars'); + static const Haskell = LanguageKind('haskell'); + static const HTML = LanguageKind('html'); + static const Ini = LanguageKind('ini'); + static const Java = LanguageKind('java'); + static const JavaScript = LanguageKind('javascript'); + static const JavaScriptReact = LanguageKind('javascriptreact'); + static const JSON = LanguageKind('json'); + static const LaTeX = LanguageKind('latex'); + static const Less = LanguageKind('less'); + static const Lua = LanguageKind('lua'); + static const Makefile = LanguageKind('makefile'); + static const Markdown = LanguageKind('markdown'); + static const ObjectiveC = LanguageKind('objective-c'); + static const ObjectiveCPP = LanguageKind('objective-cpp'); + + /// @since 3.18.0 + static const Pascal = LanguageKind('pascal'); + static const Perl = LanguageKind('perl'); + static const Perl6 = LanguageKind('perl6'); + static const PHP = LanguageKind('php'); + static const Plaintext = LanguageKind('plaintext'); + static const Powershell = LanguageKind('powershell'); + static const Pug = LanguageKind('jade'); + static const Python = LanguageKind('python'); + static const R = LanguageKind('r'); + static const Razor = LanguageKind('razor'); + static const Ruby = LanguageKind('ruby'); + static const Rust = LanguageKind('rust'); + static const SASS = LanguageKind('sass'); + static const Scala = LanguageKind('scala'); + static const SCSS = LanguageKind('scss'); + static const ShaderLab = LanguageKind('shaderlab'); + static const ShellScript = LanguageKind('shellscript'); + static const SQL = LanguageKind('sql'); + static const Swift = LanguageKind('swift'); + static const TeX = LanguageKind('tex'); + static const TypeScript = LanguageKind('typescript'); + static const TypeScriptReact = LanguageKind('typescriptreact'); + static const VisualBasic = LanguageKind('vb'); + static const WindowsBat = LanguageKind('bat'); + static const XML = LanguageKind('xml'); + static const XSL = LanguageKind('xsl'); + static const YAML = LanguageKind('yaml'); + final String _value; + const LanguageKind(this._value); + const LanguageKind.fromJson(this._value); + @override + int get hashCode => _value.hashCode; + + @override + bool operator ==(Object other) => + other is LanguageKind && other._value == _value; + + @override + String toJson() => _value; + + @override + String toString() => _value.toString(); + + static bool canParse(Object? obj, LspJsonReporter reporter) => obj is String; +} + /// Client capabilities for the linked editing range request. /// /// @since 3.16.0 @@ -25483,6 +28212,60 @@ } } +/// Location with only uri and does not include range. +/// +/// @since 3.18.0 +class LocationUriOnly implements ToJsonable { + static const jsonHandler = LspJsonHandler( + LocationUriOnly.canParse, + LocationUriOnly.fromJson, + ); + + final DocumentUri uri; + + LocationUriOnly({ + required this.uri, + }); + + @override + int get hashCode => uri.hashCode; + + @override + bool operator ==(Object other) { + return other is LocationUriOnly && + other.runtimeType == LocationUriOnly && + uri == other.uri; + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + result['uri'] = uri.toString(); + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + return _canParseUri(obj, reporter, 'uri', + allowsUndefined: false, allowsNull: false); + } else { + reporter.reportError('must be of type LocationUriOnly'); + return false; + } + } + + static LocationUriOnly fromJson(Map<String, Object?> json) { + final uriJson = json['uri']; + final uri = Uri.parse(uriJson as String); + return LocationUriOnly( + uri: uri, + ); + } +} + /// The log message parameters. class LogMessageParams implements ToJsonable { static const jsonHandler = LspJsonHandler( @@ -26065,6 +28848,10 @@ /// Constant for the 'textDocument/inlayHint' method. static const textDocument_inlayHint = Method('textDocument/inlayHint'); + /// Constant for the 'textDocument/inlineCompletion' method. + static const textDocument_inlineCompletion = + Method('textDocument/inlineCompletion'); + /// Constant for the 'textDocument/inlineValue' method. static const textDocument_inlineValue = Method('textDocument/inlineValue'); @@ -26099,6 +28886,10 @@ static const textDocument_rangeFormatting = Method('textDocument/rangeFormatting'); + /// Constant for the 'textDocument/rangesFormatting' method. + static const textDocument_rangesFormatting = + Method('textDocument/rangesFormatting'); + /// Constant for the 'textDocument/references' method. static const textDocument_references = Method('textDocument/references'); @@ -26203,6 +28994,10 @@ /// Constant for the 'workspace/executeCommand' method. static const workspace_executeCommand = Method('workspace/executeCommand'); + /// Constant for the 'workspace/foldingRange/refresh' method. + static const workspace_foldingRange_refresh = + Method('workspace/foldingRange/refresh'); + /// Constant for the 'workspace/inlayHint/refresh' method. static const workspace_inlayHint_refresh = Method('workspace/inlayHint/refresh'); @@ -26218,6 +29013,14 @@ /// Constant for the 'workspace/symbol' method. static const workspace_symbol = Method('workspace/symbol'); + /// Constant for the 'workspace/textDocumentContent' method. + static const workspace_textDocumentContent = + Method('workspace/textDocumentContent'); + + /// Constant for the 'workspace/textDocumentContent/refresh' method. + static const workspace_textDocumentContent_refresh = + Method('workspace/textDocumentContent/refresh'); + /// Constant for the 'workspace/willCreateFiles' method. static const workspace_willCreateFiles = Method('workspace/willCreateFiles'); @@ -26917,6 +29720,58 @@ static bool canParse(Object? obj, LspJsonReporter reporter) => obj is int; } +/// @since 3.18.0 +class NotebookCellLanguage implements ToJsonable { + static const jsonHandler = LspJsonHandler( + NotebookCellLanguage.canParse, + NotebookCellLanguage.fromJson, + ); + + final String language; + + NotebookCellLanguage({ + required this.language, + }); + + @override + int get hashCode => language.hashCode; + + @override + bool operator ==(Object other) { + return other is NotebookCellLanguage && + other.runtimeType == NotebookCellLanguage && + language == other.language; + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + result['language'] = language; + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + return _canParseString(obj, reporter, 'language', + allowsUndefined: false, allowsNull: false); + } else { + reporter.reportError('must be of type NotebookCellLanguage'); + return false; + } + } + + static NotebookCellLanguage fromJson(Map<String, Object?> json) { + final languageJson = json['language']; + final language = languageJson as String; + return NotebookCellLanguage( + language: language, + ); + } +} + /// A notebook cell text document filter denotes a cell text document by /// different properties. /// @@ -26975,7 +29830,7 @@ allowsUndefined: true, allowsNull: false)) { return false; } - return _canParseNotebookDocumentFilter1NotebookDocumentFilter2NotebookDocumentFilter3String( + return _canParseNotebookDocumentFilterNotebookTypeNotebookDocumentFilterPatternNotebookDocumentFilterSchemeString( obj, reporter, 'notebook', allowsUndefined: false, allowsNull: false); } else { @@ -26989,7 +29844,7 @@ final language = languageJson as String?; final notebookJson = json['notebook']; final notebook = - _eitherNotebookDocumentFilter1NotebookDocumentFilter2NotebookDocumentFilter3String( + _eitherNotebookDocumentFilterNotebookTypeNotebookDocumentFilterPatternNotebookDocumentFilterSchemeString( notebookJson); return NotebookCellTextDocumentFilter( language: language, @@ -27116,6 +29971,278 @@ } } +/// Cell changes to a notebook document. +/// +/// @since 3.18.0 +class NotebookDocumentCellChanges implements ToJsonable { + static const jsonHandler = LspJsonHandler( + NotebookDocumentCellChanges.canParse, + NotebookDocumentCellChanges.fromJson, + ); + + /// Changes to notebook cells properties like its kind, execution summary or + /// metadata. + final List<NotebookCell>? data; + + /// Changes to the cell structure to add or remove cells. + final NotebookDocumentCellChangeStructure? structure; + + /// Changes to the text content of notebook cells. + final List<NotebookDocumentCellContentChanges>? textContent; + NotebookDocumentCellChanges({ + this.data, + this.structure, + this.textContent, + }); + @override + int get hashCode => Object.hash( + lspHashCode(data), + structure, + lspHashCode(textContent), + ); + + @override + bool operator ==(Object other) { + return other is NotebookDocumentCellChanges && + other.runtimeType == NotebookDocumentCellChanges && + const DeepCollectionEquality().equals(data, other.data) && + structure == other.structure && + const DeepCollectionEquality().equals(textContent, other.textContent); + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + if (data != null) { + result['data'] = data?.map((item) => item.toJson()).toList(); + } + if (structure != null) { + result['structure'] = structure?.toJson(); + } + if (textContent != null) { + result['textContent'] = + textContent?.map((item) => item.toJson()).toList(); + } + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + if (!_canParseListNotebookCell(obj, reporter, 'data', + allowsUndefined: true, allowsNull: false)) { + return false; + } + if (!_canParseNotebookDocumentCellChangeStructure( + obj, reporter, 'structure', + allowsUndefined: true, allowsNull: false)) { + return false; + } + return _canParseListNotebookDocumentCellContentChanges( + obj, reporter, 'textContent', + allowsUndefined: true, allowsNull: false); + } else { + reporter.reportError('must be of type NotebookDocumentCellChanges'); + return false; + } + } + + static NotebookDocumentCellChanges fromJson(Map<String, Object?> json) { + final dataJson = json['data']; + final data = (dataJson as List<Object?>?) + ?.map((item) => NotebookCell.fromJson(item as Map<String, Object?>)) + .toList(); + final structureJson = json['structure']; + final structure = structureJson != null + ? NotebookDocumentCellChangeStructure.fromJson( + structureJson as Map<String, Object?>) + : null; + final textContentJson = json['textContent']; + final textContent = (textContentJson as List<Object?>?) + ?.map((item) => NotebookDocumentCellContentChanges.fromJson( + item as Map<String, Object?>)) + .toList(); + return NotebookDocumentCellChanges( + data: data, + structure: structure, + textContent: textContent, + ); + } +} + +/// Structural changes to cells in a notebook document. +/// +/// @since 3.18.0 +class NotebookDocumentCellChangeStructure implements ToJsonable { + static const jsonHandler = LspJsonHandler( + NotebookDocumentCellChangeStructure.canParse, + NotebookDocumentCellChangeStructure.fromJson, + ); + + /// The change to the cell array. + final NotebookCellArrayChange array; + + /// Additional closed cell text documents. + final List<TextDocumentIdentifier>? didClose; + + /// Additional opened cell text documents. + final List<TextDocumentItem>? didOpen; + NotebookDocumentCellChangeStructure({ + required this.array, + this.didClose, + this.didOpen, + }); + @override + int get hashCode => Object.hash( + array, + lspHashCode(didClose), + lspHashCode(didOpen), + ); + + @override + bool operator ==(Object other) { + return other is NotebookDocumentCellChangeStructure && + other.runtimeType == NotebookDocumentCellChangeStructure && + array == other.array && + const DeepCollectionEquality().equals(didClose, other.didClose) && + const DeepCollectionEquality().equals(didOpen, other.didOpen); + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + result['array'] = array.toJson(); + if (didClose != null) { + result['didClose'] = didClose?.map((item) => item.toJson()).toList(); + } + if (didOpen != null) { + result['didOpen'] = didOpen?.map((item) => item.toJson()).toList(); + } + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + if (!_canParseNotebookCellArrayChange(obj, reporter, 'array', + allowsUndefined: false, allowsNull: false)) { + return false; + } + if (!_canParseListTextDocumentIdentifier(obj, reporter, 'didClose', + allowsUndefined: true, allowsNull: false)) { + return false; + } + return _canParseListTextDocumentItem(obj, reporter, 'didOpen', + allowsUndefined: true, allowsNull: false); + } else { + reporter + .reportError('must be of type NotebookDocumentCellChangeStructure'); + return false; + } + } + + static NotebookDocumentCellChangeStructure fromJson( + Map<String, Object?> json) { + final arrayJson = json['array']; + final array = + NotebookCellArrayChange.fromJson(arrayJson as Map<String, Object?>); + final didCloseJson = json['didClose']; + final didClose = (didCloseJson as List<Object?>?) + ?.map((item) => + TextDocumentIdentifier.fromJson(item as Map<String, Object?>)) + .toList(); + final didOpenJson = json['didOpen']; + final didOpen = (didOpenJson as List<Object?>?) + ?.map((item) => TextDocumentItem.fromJson(item as Map<String, Object?>)) + .toList(); + return NotebookDocumentCellChangeStructure( + array: array, + didClose: didClose, + didOpen: didOpen, + ); + } +} + +/// Content changes to a cell in a notebook document. +/// +/// @since 3.18.0 +class NotebookDocumentCellContentChanges implements ToJsonable { + static const jsonHandler = LspJsonHandler( + NotebookDocumentCellContentChanges.canParse, + NotebookDocumentCellContentChanges.fromJson, + ); + + final List<TextDocumentContentChangeEvent> changes; + + final VersionedTextDocumentIdentifier document; + + NotebookDocumentCellContentChanges({ + required this.changes, + required this.document, + }); + @override + int get hashCode => Object.hash( + lspHashCode(changes), + document, + ); + + @override + bool operator ==(Object other) { + return other is NotebookDocumentCellContentChanges && + other.runtimeType == NotebookDocumentCellContentChanges && + const DeepCollectionEquality().equals(changes, other.changes) && + document == other.document; + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + result['changes'] = changes; + result['document'] = document.toJson(); + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + if (!_canParseListTextDocumentContentChangePartialTextDocumentContentChangeWholeDocument( + obj, reporter, 'changes', + allowsUndefined: false, allowsNull: false)) { + return false; + } + return _canParseVersionedTextDocumentIdentifier(obj, reporter, 'document', + allowsUndefined: false, allowsNull: false); + } else { + reporter + .reportError('must be of type NotebookDocumentCellContentChanges'); + return false; + } + } + + static NotebookDocumentCellContentChanges fromJson( + Map<String, Object?> json) { + final changesJson = json['changes']; + final changes = (changesJson as List<Object?>) + .map((item) => + _eitherTextDocumentContentChangePartialTextDocumentContentChangeWholeDocument( + item)) + .toList(); + final documentJson = json['document']; + final document = VersionedTextDocumentIdentifier.fromJson( + documentJson as Map<String, Object?>); + return NotebookDocumentCellContentChanges( + changes: changes, + document: document, + ); + } +} + /// A change event for a notebook document. /// /// @since 3.17.0 @@ -27126,7 +30253,7 @@ ); /// Changes to cells - final NotebookDocumentChangeEventCells? cells; + final NotebookDocumentCellChanges? cells; /// The changed meta data if any. /// @@ -27168,7 +30295,7 @@ static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map<String, Object?>) { - if (!_canParseNotebookDocumentChangeEventCells(obj, reporter, 'cells', + if (!_canParseNotebookDocumentCellChanges(obj, reporter, 'cells', allowsUndefined: true, allowsNull: false)) { return false; } @@ -27183,7 +30310,7 @@ static NotebookDocumentChangeEvent fromJson(Map<String, Object?> json) { final cellsJson = json['cells']; final cells = cellsJson != null - ? NotebookDocumentChangeEventCells.fromJson( + ? NotebookDocumentCellChanges.fromJson( cellsJson as Map<String, Object?>) : null; final metadataJson = json['metadata']; @@ -27195,269 +30322,6 @@ } } -class NotebookDocumentChangeEventCells implements ToJsonable { - static const jsonHandler = LspJsonHandler( - NotebookDocumentChangeEventCells.canParse, - NotebookDocumentChangeEventCells.fromJson, - ); - - /// Changes to notebook cells properties like its kind, execution summary or - /// metadata. - final List<NotebookCell>? data; - - /// Changes to the cell structure to add or remove cells. - final NotebookDocumentChangeEventCellsStructure? structure; - - /// Changes to the text content of notebook cells. - final List<NotebookDocumentChangeEventCellsTextContent>? textContent; - NotebookDocumentChangeEventCells({ - this.data, - this.structure, - this.textContent, - }); - @override - int get hashCode => Object.hash( - lspHashCode(data), - structure, - lspHashCode(textContent), - ); - - @override - bool operator ==(Object other) { - return other is NotebookDocumentChangeEventCells && - other.runtimeType == NotebookDocumentChangeEventCells && - const DeepCollectionEquality().equals(data, other.data) && - structure == other.structure && - const DeepCollectionEquality().equals(textContent, other.textContent); - } - - @override - Map<String, Object?> toJson() { - var result = <String, Object?>{}; - if (data != null) { - result['data'] = data?.map((item) => item.toJson()).toList(); - } - if (structure != null) { - result['structure'] = structure?.toJson(); - } - if (textContent != null) { - result['textContent'] = - textContent?.map((item) => item.toJson()).toList(); - } - return result; - } - - @override - String toString() => jsonEncoder.convert(toJson()); - - static bool canParse(Object? obj, LspJsonReporter reporter) { - if (obj is Map<String, Object?>) { - if (!_canParseListNotebookCell(obj, reporter, 'data', - allowsUndefined: true, allowsNull: false)) { - return false; - } - if (!_canParseNotebookDocumentChangeEventCellsStructure( - obj, reporter, 'structure', - allowsUndefined: true, allowsNull: false)) { - return false; - } - return _canParseListNotebookDocumentChangeEventCellsTextContent( - obj, reporter, 'textContent', - allowsUndefined: true, allowsNull: false); - } else { - reporter.reportError('must be of type NotebookDocumentChangeEventCells'); - return false; - } - } - - static NotebookDocumentChangeEventCells fromJson(Map<String, Object?> json) { - final dataJson = json['data']; - final data = (dataJson as List<Object?>?) - ?.map((item) => NotebookCell.fromJson(item as Map<String, Object?>)) - .toList(); - final structureJson = json['structure']; - final structure = structureJson != null - ? NotebookDocumentChangeEventCellsStructure.fromJson( - structureJson as Map<String, Object?>) - : null; - final textContentJson = json['textContent']; - final textContent = (textContentJson as List<Object?>?) - ?.map((item) => NotebookDocumentChangeEventCellsTextContent.fromJson( - item as Map<String, Object?>)) - .toList(); - return NotebookDocumentChangeEventCells( - data: data, - structure: structure, - textContent: textContent, - ); - } -} - -class NotebookDocumentChangeEventCellsStructure implements ToJsonable { - static const jsonHandler = LspJsonHandler( - NotebookDocumentChangeEventCellsStructure.canParse, - NotebookDocumentChangeEventCellsStructure.fromJson, - ); - - /// The change to the cell array. - final NotebookCellArrayChange array; - - /// Additional closed cell text documents. - final List<TextDocumentIdentifier>? didClose; - - /// Additional opened cell text documents. - final List<TextDocumentItem>? didOpen; - NotebookDocumentChangeEventCellsStructure({ - required this.array, - this.didClose, - this.didOpen, - }); - @override - int get hashCode => Object.hash( - array, - lspHashCode(didClose), - lspHashCode(didOpen), - ); - - @override - bool operator ==(Object other) { - return other is NotebookDocumentChangeEventCellsStructure && - other.runtimeType == NotebookDocumentChangeEventCellsStructure && - array == other.array && - const DeepCollectionEquality().equals(didClose, other.didClose) && - const DeepCollectionEquality().equals(didOpen, other.didOpen); - } - - @override - Map<String, Object?> toJson() { - var result = <String, Object?>{}; - result['array'] = array.toJson(); - if (didClose != null) { - result['didClose'] = didClose?.map((item) => item.toJson()).toList(); - } - if (didOpen != null) { - result['didOpen'] = didOpen?.map((item) => item.toJson()).toList(); - } - return result; - } - - @override - String toString() => jsonEncoder.convert(toJson()); - - static bool canParse(Object? obj, LspJsonReporter reporter) { - if (obj is Map<String, Object?>) { - if (!_canParseNotebookCellArrayChange(obj, reporter, 'array', - allowsUndefined: false, allowsNull: false)) { - return false; - } - if (!_canParseListTextDocumentIdentifier(obj, reporter, 'didClose', - allowsUndefined: true, allowsNull: false)) { - return false; - } - return _canParseListTextDocumentItem(obj, reporter, 'didOpen', - allowsUndefined: true, allowsNull: false); - } else { - reporter.reportError( - 'must be of type NotebookDocumentChangeEventCellsStructure'); - return false; - } - } - - static NotebookDocumentChangeEventCellsStructure fromJson( - Map<String, Object?> json) { - final arrayJson = json['array']; - final array = - NotebookCellArrayChange.fromJson(arrayJson as Map<String, Object?>); - final didCloseJson = json['didClose']; - final didClose = (didCloseJson as List<Object?>?) - ?.map((item) => - TextDocumentIdentifier.fromJson(item as Map<String, Object?>)) - .toList(); - final didOpenJson = json['didOpen']; - final didOpen = (didOpenJson as List<Object?>?) - ?.map((item) => TextDocumentItem.fromJson(item as Map<String, Object?>)) - .toList(); - return NotebookDocumentChangeEventCellsStructure( - array: array, - didClose: didClose, - didOpen: didOpen, - ); - } -} - -class NotebookDocumentChangeEventCellsTextContent implements ToJsonable { - static const jsonHandler = LspJsonHandler( - NotebookDocumentChangeEventCellsTextContent.canParse, - NotebookDocumentChangeEventCellsTextContent.fromJson, - ); - - final List<TextDocumentContentChangeEvent> changes; - - final VersionedTextDocumentIdentifier document; - - NotebookDocumentChangeEventCellsTextContent({ - required this.changes, - required this.document, - }); - @override - int get hashCode => Object.hash( - lspHashCode(changes), - document, - ); - - @override - bool operator ==(Object other) { - return other is NotebookDocumentChangeEventCellsTextContent && - other.runtimeType == NotebookDocumentChangeEventCellsTextContent && - const DeepCollectionEquality().equals(changes, other.changes) && - document == other.document; - } - - @override - Map<String, Object?> toJson() { - var result = <String, Object?>{}; - result['changes'] = changes; - result['document'] = document.toJson(); - return result; - } - - @override - String toString() => jsonEncoder.convert(toJson()); - - static bool canParse(Object? obj, LspJsonReporter reporter) { - if (obj is Map<String, Object?>) { - if (!_canParseListTextDocumentContentChangePartialTextDocumentContentChangeWholeDocument( - obj, reporter, 'changes', - allowsUndefined: false, allowsNull: false)) { - return false; - } - return _canParseVersionedTextDocumentIdentifier(obj, reporter, 'document', - allowsUndefined: false, allowsNull: false); - } else { - reporter.reportError( - 'must be of type NotebookDocumentChangeEventCellsTextContent'); - return false; - } - } - - static NotebookDocumentChangeEventCellsTextContent fromJson( - Map<String, Object?> json) { - final changesJson = json['changes']; - final changes = (changesJson as List<Object?>) - .map((item) => - _eitherTextDocumentContentChangePartialTextDocumentContentChangeWholeDocument( - item)) - .toList(); - final documentJson = json['document']; - final document = VersionedTextDocumentIdentifier.fromJson( - documentJson as Map<String, Object?>); - return NotebookDocumentChangeEventCellsTextContent( - changes: changes, - document: document, - ); - } -} - /// Capabilities specific to the notebook document support. /// /// @since 3.17.0 @@ -27519,21 +30383,24 @@ } } -class NotebookDocumentFilter1 implements ToJsonable { +/// A notebook document filter where `notebookType` is required field. +/// +/// @since 3.18.0 +class NotebookDocumentFilterNotebookType implements ToJsonable { static const jsonHandler = LspJsonHandler( - NotebookDocumentFilter1.canParse, - NotebookDocumentFilter1.fromJson, + NotebookDocumentFilterNotebookType.canParse, + NotebookDocumentFilterNotebookType.fromJson, ); /// The type of the enclosing notebook. final String notebookType; /// A glob pattern. - final String? pattern; + final GlobPattern? pattern; /// A Uri [Uri.scheme], like `file` or `untitled`. final String? scheme; - NotebookDocumentFilter1({ + NotebookDocumentFilterNotebookType({ required this.notebookType, this.pattern, this.scheme, @@ -27547,8 +30414,8 @@ @override bool operator ==(Object other) { - return other is NotebookDocumentFilter1 && - other.runtimeType == NotebookDocumentFilter1 && + return other is NotebookDocumentFilterNotebookType && + other.runtimeType == NotebookDocumentFilterNotebookType && notebookType == other.notebookType && pattern == other.pattern && scheme == other.scheme; @@ -27559,7 +30426,7 @@ var result = <String, Object?>{}; result['notebookType'] = notebookType; if (pattern != null) { - result['pattern'] = pattern; + result['pattern'] = pattern?.toJson(); } if (scheme != null) { result['scheme'] = scheme; @@ -27576,26 +30443,29 @@ allowsUndefined: false, allowsNull: false)) { return false; } - if (!_canParseString(obj, reporter, 'pattern', + if (!_canParseStringRelativePattern(obj, reporter, 'pattern', allowsUndefined: true, allowsNull: false)) { return false; } return _canParseString(obj, reporter, 'scheme', allowsUndefined: true, allowsNull: false); } else { - reporter.reportError('must be of type NotebookDocumentFilter1'); + reporter + .reportError('must be of type NotebookDocumentFilterNotebookType'); return false; } } - static NotebookDocumentFilter1 fromJson(Map<String, Object?> json) { + static NotebookDocumentFilterNotebookType fromJson( + Map<String, Object?> json) { final notebookTypeJson = json['notebookType']; final notebookType = notebookTypeJson as String; final patternJson = json['pattern']; - final pattern = patternJson as String?; + final pattern = + patternJson == null ? null : _eitherStringRelativePattern(patternJson); final schemeJson = json['scheme']; final scheme = schemeJson as String?; - return NotebookDocumentFilter1( + return NotebookDocumentFilterNotebookType( notebookType: notebookType, pattern: pattern, scheme: scheme, @@ -27603,21 +30473,111 @@ } } -class NotebookDocumentFilter2 implements ToJsonable { +/// A notebook document filter where `pattern` is required field. +/// +/// @since 3.18.0 +class NotebookDocumentFilterPattern implements ToJsonable { static const jsonHandler = LspJsonHandler( - NotebookDocumentFilter2.canParse, - NotebookDocumentFilter2.fromJson, + NotebookDocumentFilterPattern.canParse, + NotebookDocumentFilterPattern.fromJson, ); /// The type of the enclosing notebook. final String? notebookType; /// A glob pattern. - final String? pattern; + final GlobPattern pattern; + + /// A Uri [Uri.scheme], like `file` or `untitled`. + final String? scheme; + NotebookDocumentFilterPattern({ + this.notebookType, + required this.pattern, + this.scheme, + }); + @override + int get hashCode => Object.hash( + notebookType, + pattern, + scheme, + ); + + @override + bool operator ==(Object other) { + return other is NotebookDocumentFilterPattern && + other.runtimeType == NotebookDocumentFilterPattern && + notebookType == other.notebookType && + pattern == other.pattern && + scheme == other.scheme; + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + if (notebookType != null) { + result['notebookType'] = notebookType; + } + result['pattern'] = pattern.toJson(); + if (scheme != null) { + result['scheme'] = scheme; + } + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + if (!_canParseString(obj, reporter, 'notebookType', + allowsUndefined: true, allowsNull: false)) { + return false; + } + if (!_canParseStringRelativePattern(obj, reporter, 'pattern', + allowsUndefined: false, allowsNull: false)) { + return false; + } + return _canParseString(obj, reporter, 'scheme', + allowsUndefined: true, allowsNull: false); + } else { + reporter.reportError('must be of type NotebookDocumentFilterPattern'); + return false; + } + } + + static NotebookDocumentFilterPattern fromJson(Map<String, Object?> json) { + final notebookTypeJson = json['notebookType']; + final notebookType = notebookTypeJson as String?; + final patternJson = json['pattern']; + final pattern = _eitherStringRelativePattern(patternJson); + final schemeJson = json['scheme']; + final scheme = schemeJson as String?; + return NotebookDocumentFilterPattern( + notebookType: notebookType, + pattern: pattern, + scheme: scheme, + ); + } +} + +/// A notebook document filter where `scheme` is required field. +/// +/// @since 3.18.0 +class NotebookDocumentFilterScheme implements ToJsonable { + static const jsonHandler = LspJsonHandler( + NotebookDocumentFilterScheme.canParse, + NotebookDocumentFilterScheme.fromJson, + ); + + /// The type of the enclosing notebook. + final String? notebookType; + + /// A glob pattern. + final GlobPattern? pattern; /// A Uri [Uri.scheme], like `file` or `untitled`. final String scheme; - NotebookDocumentFilter2({ + NotebookDocumentFilterScheme({ this.notebookType, this.pattern, required this.scheme, @@ -27631,8 +30591,8 @@ @override bool operator ==(Object other) { - return other is NotebookDocumentFilter2 && - other.runtimeType == NotebookDocumentFilter2 && + return other is NotebookDocumentFilterScheme && + other.runtimeType == NotebookDocumentFilterScheme && notebookType == other.notebookType && pattern == other.pattern && scheme == other.scheme; @@ -27645,7 +30605,7 @@ result['notebookType'] = notebookType; } if (pattern != null) { - result['pattern'] = pattern; + result['pattern'] = pattern?.toJson(); } result['scheme'] = scheme; return result; @@ -27660,26 +30620,27 @@ allowsUndefined: true, allowsNull: false)) { return false; } - if (!_canParseString(obj, reporter, 'pattern', + if (!_canParseStringRelativePattern(obj, reporter, 'pattern', allowsUndefined: true, allowsNull: false)) { return false; } return _canParseString(obj, reporter, 'scheme', allowsUndefined: false, allowsNull: false); } else { - reporter.reportError('must be of type NotebookDocumentFilter2'); + reporter.reportError('must be of type NotebookDocumentFilterScheme'); return false; } } - static NotebookDocumentFilter2 fromJson(Map<String, Object?> json) { + static NotebookDocumentFilterScheme fromJson(Map<String, Object?> json) { final notebookTypeJson = json['notebookType']; final notebookType = notebookTypeJson as String?; final patternJson = json['pattern']; - final pattern = patternJson as String?; + final pattern = + patternJson == null ? null : _eitherStringRelativePattern(patternJson); final schemeJson = json['scheme']; final scheme = schemeJson as String; - return NotebookDocumentFilter2( + return NotebookDocumentFilterScheme( notebookType: notebookType, pattern: pattern, scheme: scheme, @@ -27687,50 +30648,44 @@ } } -class NotebookDocumentFilter3 implements ToJsonable { +/// @since 3.18.0 +class NotebookDocumentFilterWithCells implements ToJsonable { static const jsonHandler = LspJsonHandler( - NotebookDocumentFilter3.canParse, - NotebookDocumentFilter3.fromJson, + NotebookDocumentFilterWithCells.canParse, + NotebookDocumentFilterWithCells.fromJson, ); - /// The type of the enclosing notebook. - final String? notebookType; + /// The cells of the matching notebook to be synced. + final List<NotebookCellLanguage> cells; - /// A glob pattern. - final String pattern; + /// The notebook to be synced If a string value is provided it matches against + /// the notebook type. '*' matches every notebook. + final Either2<NotebookDocumentFilter, String>? notebook; - /// A Uri [Uri.scheme], like `file` or `untitled`. - final String? scheme; - NotebookDocumentFilter3({ - this.notebookType, - required this.pattern, - this.scheme, + NotebookDocumentFilterWithCells({ + required this.cells, + this.notebook, }); @override int get hashCode => Object.hash( - notebookType, - pattern, - scheme, + lspHashCode(cells), + notebook, ); @override bool operator ==(Object other) { - return other is NotebookDocumentFilter3 && - other.runtimeType == NotebookDocumentFilter3 && - notebookType == other.notebookType && - pattern == other.pattern && - scheme == other.scheme; + return other is NotebookDocumentFilterWithCells && + other.runtimeType == NotebookDocumentFilterWithCells && + const DeepCollectionEquality().equals(cells, other.cells) && + notebook == other.notebook; } @override Map<String, Object?> toJson() { var result = <String, Object?>{}; - if (notebookType != null) { - result['notebookType'] = notebookType; - } - result['pattern'] = pattern; - if (scheme != null) { - result['scheme'] = scheme; + result['cells'] = cells.map((item) => item.toJson()).toList(); + if (notebook != null) { + result['notebook'] = notebook?.toJson(); } return result; } @@ -27740,33 +30695,112 @@ static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map<String, Object?>) { - if (!_canParseString(obj, reporter, 'notebookType', - allowsUndefined: true, allowsNull: false)) { - return false; - } - if (!_canParseString(obj, reporter, 'pattern', + if (!_canParseListNotebookCellLanguage(obj, reporter, 'cells', allowsUndefined: false, allowsNull: false)) { return false; } - return _canParseString(obj, reporter, 'scheme', + return _canParseNotebookDocumentFilterNotebookTypeNotebookDocumentFilterPatternNotebookDocumentFilterSchemeString( + obj, reporter, 'notebook', allowsUndefined: true, allowsNull: false); } else { - reporter.reportError('must be of type NotebookDocumentFilter3'); + reporter.reportError('must be of type NotebookDocumentFilterWithCells'); return false; } } - static NotebookDocumentFilter3 fromJson(Map<String, Object?> json) { - final notebookTypeJson = json['notebookType']; - final notebookType = notebookTypeJson as String?; - final patternJson = json['pattern']; - final pattern = patternJson as String; - final schemeJson = json['scheme']; - final scheme = schemeJson as String?; - return NotebookDocumentFilter3( - notebookType: notebookType, - pattern: pattern, - scheme: scheme, + static NotebookDocumentFilterWithCells fromJson(Map<String, Object?> json) { + final cellsJson = json['cells']; + final cells = (cellsJson as List<Object?>) + .map((item) => + NotebookCellLanguage.fromJson(item as Map<String, Object?>)) + .toList(); + final notebookJson = json['notebook']; + final notebook = notebookJson == null + ? null + : _eitherNotebookDocumentFilterNotebookTypeNotebookDocumentFilterPatternNotebookDocumentFilterSchemeString( + notebookJson); + return NotebookDocumentFilterWithCells( + cells: cells, + notebook: notebook, + ); + } +} + +/// @since 3.18.0 +class NotebookDocumentFilterWithNotebook implements ToJsonable { + static const jsonHandler = LspJsonHandler( + NotebookDocumentFilterWithNotebook.canParse, + NotebookDocumentFilterWithNotebook.fromJson, + ); + + /// The cells of the matching notebook to be synced. + final List<NotebookCellLanguage>? cells; + + /// The notebook to be synced If a string value is provided it matches against + /// the notebook type. '*' matches every notebook. + final Either2<NotebookDocumentFilter, String> notebook; + + NotebookDocumentFilterWithNotebook({ + this.cells, + required this.notebook, + }); + @override + int get hashCode => Object.hash( + lspHashCode(cells), + notebook, + ); + + @override + bool operator ==(Object other) { + return other is NotebookDocumentFilterWithNotebook && + other.runtimeType == NotebookDocumentFilterWithNotebook && + const DeepCollectionEquality().equals(cells, other.cells) && + notebook == other.notebook; + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + if (cells != null) { + result['cells'] = cells?.map((item) => item.toJson()).toList(); + } + result['notebook'] = notebook.toJson(); + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + if (!_canParseListNotebookCellLanguage(obj, reporter, 'cells', + allowsUndefined: true, allowsNull: false)) { + return false; + } + return _canParseNotebookDocumentFilterNotebookTypeNotebookDocumentFilterPatternNotebookDocumentFilterSchemeString( + obj, reporter, 'notebook', + allowsUndefined: false, allowsNull: false); + } else { + reporter + .reportError('must be of type NotebookDocumentFilterWithNotebook'); + return false; + } + } + + static NotebookDocumentFilterWithNotebook fromJson( + Map<String, Object?> json) { + final cellsJson = json['cells']; + final cells = (cellsJson as List<Object?>?) + ?.map((item) => + NotebookCellLanguage.fromJson(item as Map<String, Object?>)) + .toList(); + final notebookJson = json['notebook']; + final notebook = + _eitherNotebookDocumentFilterNotebookTypeNotebookDocumentFilterPatternNotebookDocumentFilterSchemeString( + notebookJson); + return NotebookDocumentFilterWithNotebook( + cells: cells, + notebook: notebook, ); } } @@ -27923,8 +30957,8 @@ /// The notebooks to be synced final List< - Either2<NotebookDocumentSyncOptionsNotebookSelector, - NotebookDocumentSyncOptionsNotebookSelector2>> notebookSelector; + Either2<NotebookDocumentFilterWithCells, + NotebookDocumentFilterWithNotebook>> notebookSelector; /// Whether save notification should be forwarded to the server. Will only be /// honored if mode === `notebook`. @@ -27964,7 +30998,7 @@ static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map<String, Object?>) { - if (!_canParseListNotebookDocumentSyncOptionsNotebookSelectorNotebookDocumentSyncOptionsNotebookSelector2( + if (!_canParseListNotebookDocumentFilterWithCellsNotebookDocumentFilterWithNotebook( obj, reporter, 'notebookSelector', allowsUndefined: false, allowsNull: false)) { return false; @@ -27985,7 +31019,7 @@ final notebookSelectorJson = json['notebookSelector']; final notebookSelector = (notebookSelectorJson as List<Object?>) .map((item) => - _eitherNotebookDocumentSyncOptionsNotebookSelectorNotebookDocumentSyncOptionsNotebookSelector2( + _eitherNotebookDocumentFilterWithCellsNotebookDocumentFilterWithNotebook( item)) .toList(); final saveJson = json['save']; @@ -27997,274 +31031,6 @@ } } -class NotebookDocumentSyncOptionsNotebookSelector implements ToJsonable { - static const jsonHandler = LspJsonHandler( - NotebookDocumentSyncOptionsNotebookSelector.canParse, - NotebookDocumentSyncOptionsNotebookSelector.fromJson, - ); - - /// The cells of the matching notebook to be synced. - final List<NotebookDocumentSyncOptionsNotebookSelectorCells>? cells; - - /// The notebook to be synced If a string value is provided it matches against - /// the notebook type. '*' matches every notebook. - final Either2<NotebookDocumentFilter, String> notebook; - - NotebookDocumentSyncOptionsNotebookSelector({ - this.cells, - required this.notebook, - }); - @override - int get hashCode => Object.hash( - lspHashCode(cells), - notebook, - ); - - @override - bool operator ==(Object other) { - return other is NotebookDocumentSyncOptionsNotebookSelector && - other.runtimeType == NotebookDocumentSyncOptionsNotebookSelector && - const DeepCollectionEquality().equals(cells, other.cells) && - notebook == other.notebook; - } - - @override - Map<String, Object?> toJson() { - var result = <String, Object?>{}; - if (cells != null) { - result['cells'] = cells?.map((item) => item.toJson()).toList(); - } - result['notebook'] = notebook.toJson(); - return result; - } - - @override - String toString() => jsonEncoder.convert(toJson()); - - static bool canParse(Object? obj, LspJsonReporter reporter) { - if (obj is Map<String, Object?>) { - if (!_canParseListNotebookDocumentSyncOptionsNotebookSelectorCells( - obj, reporter, 'cells', - allowsUndefined: true, allowsNull: false)) { - return false; - } - return _canParseNotebookDocumentFilter1NotebookDocumentFilter2NotebookDocumentFilter3String( - obj, reporter, 'notebook', - allowsUndefined: false, allowsNull: false); - } else { - reporter.reportError( - 'must be of type NotebookDocumentSyncOptionsNotebookSelector'); - return false; - } - } - - static NotebookDocumentSyncOptionsNotebookSelector fromJson( - Map<String, Object?> json) { - final cellsJson = json['cells']; - final cells = (cellsJson as List<Object?>?) - ?.map((item) => - NotebookDocumentSyncOptionsNotebookSelectorCells.fromJson( - item as Map<String, Object?>)) - .toList(); - final notebookJson = json['notebook']; - final notebook = - _eitherNotebookDocumentFilter1NotebookDocumentFilter2NotebookDocumentFilter3String( - notebookJson); - return NotebookDocumentSyncOptionsNotebookSelector( - cells: cells, - notebook: notebook, - ); - } -} - -class NotebookDocumentSyncOptionsNotebookSelector2 implements ToJsonable { - static const jsonHandler = LspJsonHandler( - NotebookDocumentSyncOptionsNotebookSelector2.canParse, - NotebookDocumentSyncOptionsNotebookSelector2.fromJson, - ); - - /// The cells of the matching notebook to be synced. - final List<NotebookDocumentSyncOptionsNotebookSelector2Cells> cells; - - /// The notebook to be synced If a string value is provided it matches against - /// the notebook type. '*' matches every notebook. - final Either2<NotebookDocumentFilter, String>? notebook; - - NotebookDocumentSyncOptionsNotebookSelector2({ - required this.cells, - this.notebook, - }); - @override - int get hashCode => Object.hash( - lspHashCode(cells), - notebook, - ); - - @override - bool operator ==(Object other) { - return other is NotebookDocumentSyncOptionsNotebookSelector2 && - other.runtimeType == NotebookDocumentSyncOptionsNotebookSelector2 && - const DeepCollectionEquality().equals(cells, other.cells) && - notebook == other.notebook; - } - - @override - Map<String, Object?> toJson() { - var result = <String, Object?>{}; - result['cells'] = cells.map((item) => item.toJson()).toList(); - if (notebook != null) { - result['notebook'] = notebook?.toJson(); - } - return result; - } - - @override - String toString() => jsonEncoder.convert(toJson()); - - static bool canParse(Object? obj, LspJsonReporter reporter) { - if (obj is Map<String, Object?>) { - if (!_canParseListNotebookDocumentSyncOptionsNotebookSelector2Cells( - obj, reporter, 'cells', - allowsUndefined: false, allowsNull: false)) { - return false; - } - return _canParseNotebookDocumentFilter1NotebookDocumentFilter2NotebookDocumentFilter3String( - obj, reporter, 'notebook', - allowsUndefined: true, allowsNull: false); - } else { - reporter.reportError( - 'must be of type NotebookDocumentSyncOptionsNotebookSelector2'); - return false; - } - } - - static NotebookDocumentSyncOptionsNotebookSelector2 fromJson( - Map<String, Object?> json) { - final cellsJson = json['cells']; - final cells = (cellsJson as List<Object?>) - .map((item) => - NotebookDocumentSyncOptionsNotebookSelector2Cells.fromJson( - item as Map<String, Object?>)) - .toList(); - final notebookJson = json['notebook']; - final notebook = notebookJson == null - ? null - : _eitherNotebookDocumentFilter1NotebookDocumentFilter2NotebookDocumentFilter3String( - notebookJson); - return NotebookDocumentSyncOptionsNotebookSelector2( - cells: cells, - notebook: notebook, - ); - } -} - -class NotebookDocumentSyncOptionsNotebookSelector2Cells implements ToJsonable { - static const jsonHandler = LspJsonHandler( - NotebookDocumentSyncOptionsNotebookSelector2Cells.canParse, - NotebookDocumentSyncOptionsNotebookSelector2Cells.fromJson, - ); - - final String language; - - NotebookDocumentSyncOptionsNotebookSelector2Cells({ - required this.language, - }); - - @override - int get hashCode => language.hashCode; - - @override - bool operator ==(Object other) { - return other is NotebookDocumentSyncOptionsNotebookSelector2Cells && - other.runtimeType == - NotebookDocumentSyncOptionsNotebookSelector2Cells && - language == other.language; - } - - @override - Map<String, Object?> toJson() { - var result = <String, Object?>{}; - result['language'] = language; - return result; - } - - @override - String toString() => jsonEncoder.convert(toJson()); - - static bool canParse(Object? obj, LspJsonReporter reporter) { - if (obj is Map<String, Object?>) { - return _canParseString(obj, reporter, 'language', - allowsUndefined: false, allowsNull: false); - } else { - reporter.reportError( - 'must be of type NotebookDocumentSyncOptionsNotebookSelector2Cells'); - return false; - } - } - - static NotebookDocumentSyncOptionsNotebookSelector2Cells fromJson( - Map<String, Object?> json) { - final languageJson = json['language']; - final language = languageJson as String; - return NotebookDocumentSyncOptionsNotebookSelector2Cells( - language: language, - ); - } -} - -class NotebookDocumentSyncOptionsNotebookSelectorCells implements ToJsonable { - static const jsonHandler = LspJsonHandler( - NotebookDocumentSyncOptionsNotebookSelectorCells.canParse, - NotebookDocumentSyncOptionsNotebookSelectorCells.fromJson, - ); - - final String language; - - NotebookDocumentSyncOptionsNotebookSelectorCells({ - required this.language, - }); - - @override - int get hashCode => language.hashCode; - - @override - bool operator ==(Object other) { - return other is NotebookDocumentSyncOptionsNotebookSelectorCells && - other.runtimeType == NotebookDocumentSyncOptionsNotebookSelectorCells && - language == other.language; - } - - @override - Map<String, Object?> toJson() { - var result = <String, Object?>{}; - result['language'] = language; - return result; - } - - @override - String toString() => jsonEncoder.convert(toJson()); - - static bool canParse(Object? obj, LspJsonReporter reporter) { - if (obj is Map<String, Object?>) { - return _canParseString(obj, reporter, 'language', - allowsUndefined: false, allowsNull: false); - } else { - reporter.reportError( - 'must be of type NotebookDocumentSyncOptionsNotebookSelectorCells'); - return false; - } - } - - static NotebookDocumentSyncOptionsNotebookSelectorCells fromJson( - Map<String, Object?> json) { - final languageJson = json['language']; - final language = languageJson as String; - return NotebookDocumentSyncOptionsNotebookSelectorCells( - language: language, - ); - } -} - /// Registration options specific to a notebook. /// /// @since 3.17.0 @@ -28286,8 +31052,8 @@ /// The notebooks to be synced @override final List< - Either2<NotebookDocumentSyncOptionsNotebookSelector, - NotebookDocumentSyncOptionsNotebookSelector2>> notebookSelector; + Either2<NotebookDocumentFilterWithCells, + NotebookDocumentFilterWithNotebook>> notebookSelector; /// Whether save notification should be forwarded to the server. Will only be /// honored if mode === `notebook`. @@ -28337,7 +31103,7 @@ allowsUndefined: true, allowsNull: false)) { return false; } - if (!_canParseListNotebookDocumentSyncOptionsNotebookSelectorNotebookDocumentSyncOptionsNotebookSelector2( + if (!_canParseListNotebookDocumentFilterWithCellsNotebookDocumentFilterWithNotebook( obj, reporter, 'notebookSelector', allowsUndefined: false, allowsNull: false)) { return false; @@ -28358,7 +31124,7 @@ final notebookSelectorJson = json['notebookSelector']; final notebookSelector = (notebookSelectorJson as List<Object?>) .map((item) => - _eitherNotebookDocumentSyncOptionsNotebookSelectorNotebookDocumentSyncOptionsNotebookSelector2( + _eitherNotebookDocumentFilterWithCellsNotebookDocumentFilterWithNotebook( item)) .toList(); final saveJson = json['save']; @@ -28468,6 +31234,10 @@ /// are based on a UTF-16 string representation as `Position` and `Range` /// does. /// + /// To avoid ambiguities a server should use the [start, end] offset value + /// instead of using a substring. Whether a client support this is controlled + /// via `labelOffsetSupport` client capability. + /// /// *Note*: a label of type string should be a substring of its containing /// signature label. Its intended use case is to highlight the parameter label /// part in the `SignatureInformation.label`. @@ -28705,16 +31475,9 @@ /// /// 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; Position({ @@ -28810,6 +31573,58 @@ static bool canParse(Object? obj, LspJsonReporter reporter) => obj is String; } +/// @since 3.18.0 +class PrepareRenameDefaultBehavior implements ToJsonable { + static const jsonHandler = LspJsonHandler( + PrepareRenameDefaultBehavior.canParse, + PrepareRenameDefaultBehavior.fromJson, + ); + + final bool defaultBehavior; + + PrepareRenameDefaultBehavior({ + required this.defaultBehavior, + }); + + @override + int get hashCode => defaultBehavior.hashCode; + + @override + bool operator ==(Object other) { + return other is PrepareRenameDefaultBehavior && + other.runtimeType == PrepareRenameDefaultBehavior && + defaultBehavior == other.defaultBehavior; + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + result['defaultBehavior'] = defaultBehavior; + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + return _canParseBool(obj, reporter, 'defaultBehavior', + allowsUndefined: false, allowsNull: false); + } else { + reporter.reportError('must be of type PrepareRenameDefaultBehavior'); + return false; + } + } + + static PrepareRenameDefaultBehavior fromJson(Map<String, Object?> json) { + final defaultBehaviorJson = json['defaultBehavior']; + final defaultBehavior = defaultBehaviorJson as bool; + return PrepareRenameDefaultBehavior( + defaultBehavior: defaultBehavior, + ); + } +} + class PrepareRenameParams implements TextDocumentPositionParams, WorkDoneProgressParams, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -28898,6 +31713,7 @@ } } +/// @since 3.18.0 class PrepareRenamePlaceholder implements ToJsonable { static const jsonHandler = LspJsonHandler( PrepareRenamePlaceholder.canParse, @@ -28963,57 +31779,6 @@ } } -class PrepareRenameResult2 implements ToJsonable { - static const jsonHandler = LspJsonHandler( - PrepareRenameResult2.canParse, - PrepareRenameResult2.fromJson, - ); - - final bool defaultBehavior; - - PrepareRenameResult2({ - required this.defaultBehavior, - }); - - @override - int get hashCode => defaultBehavior.hashCode; - - @override - bool operator ==(Object other) { - return other is PrepareRenameResult2 && - other.runtimeType == PrepareRenameResult2 && - defaultBehavior == other.defaultBehavior; - } - - @override - Map<String, Object?> toJson() { - var result = <String, Object?>{}; - result['defaultBehavior'] = defaultBehavior; - return result; - } - - @override - String toString() => jsonEncoder.convert(toJson()); - - static bool canParse(Object? obj, LspJsonReporter reporter) { - if (obj is Map<String, Object?>) { - return _canParseBool(obj, reporter, 'defaultBehavior', - allowsUndefined: false, allowsNull: false); - } else { - reporter.reportError('must be of type PrepareRenameResult2'); - return false; - } - } - - static PrepareRenameResult2 fromJson(Map<String, Object?> json) { - final defaultBehaviorJson = json['defaultBehavior']; - final defaultBehavior = defaultBehaviorJson as bool; - return PrepareRenameResult2( - defaultBehavior: defaultBehavior, - ); - } -} - class PrepareSupportDefaultBehavior implements ToJsonable { /// The client's default behavior is to select the identifier according the to /// language's syntax rule. @@ -29173,7 +31938,8 @@ } /// The publish diagnostic client capabilities. -class PublishDiagnosticsClientCapabilities implements ToJsonable { +class PublishDiagnosticsClientCapabilities + implements DiagnosticsCapabilities, ToJsonable { static const jsonHandler = LspJsonHandler( PublishDiagnosticsClientCapabilities.canParse, PublishDiagnosticsClientCapabilities.fromJson, @@ -29182,6 +31948,7 @@ /// Client supports a codeDescription property /// /// @since 3.16.0 + @override final bool? codeDescriptionSupport; /// Whether code action supports the `data` property which is preserved @@ -29189,16 +31956,19 @@ /// request. /// /// @since 3.16.0 + @override final bool? dataSupport; /// Whether the clients accepts diagnostics with related information. + @override final bool? relatedInformation; /// 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 - final PublishDiagnosticsClientCapabilitiesTagSupport? tagSupport; + @override + final ClientDiagnosticsTagOptions? tagSupport; /// Whether the client interprets the version property of the /// `textDocument/publishDiagnostics` notification's parameter. @@ -29270,8 +32040,7 @@ allowsUndefined: true, allowsNull: false)) { return false; } - if (!_canParsePublishDiagnosticsClientCapabilitiesTagSupport( - obj, reporter, 'tagSupport', + if (!_canParseClientDiagnosticsTagOptions(obj, reporter, 'tagSupport', allowsUndefined: true, allowsNull: false)) { return false; } @@ -29294,7 +32063,7 @@ final relatedInformation = relatedInformationJson as bool?; final tagSupportJson = json['tagSupport']; final tagSupport = tagSupportJson != null - ? PublishDiagnosticsClientCapabilitiesTagSupport.fromJson( + ? ClientDiagnosticsTagOptions.fromJson( tagSupportJson as Map<String, Object?>) : null; final versionSupportJson = json['versionSupport']; @@ -29309,62 +32078,6 @@ } } -class PublishDiagnosticsClientCapabilitiesTagSupport implements ToJsonable { - static const jsonHandler = LspJsonHandler( - PublishDiagnosticsClientCapabilitiesTagSupport.canParse, - PublishDiagnosticsClientCapabilitiesTagSupport.fromJson, - ); - - /// The tags supported by the client. - final List<DiagnosticTag> valueSet; - - PublishDiagnosticsClientCapabilitiesTagSupport({ - required this.valueSet, - }); - - @override - int get hashCode => lspHashCode(valueSet); - - @override - bool operator ==(Object other) { - return other is PublishDiagnosticsClientCapabilitiesTagSupport && - other.runtimeType == PublishDiagnosticsClientCapabilitiesTagSupport && - const DeepCollectionEquality().equals(valueSet, other.valueSet); - } - - @override - Map<String, Object?> toJson() { - var result = <String, Object?>{}; - result['valueSet'] = valueSet.map((item) => item.toJson()).toList(); - return result; - } - - @override - String toString() => jsonEncoder.convert(toJson()); - - static bool canParse(Object? obj, LspJsonReporter reporter) { - if (obj is Map<String, Object?>) { - return _canParseListDiagnosticTag(obj, reporter, 'valueSet', - allowsUndefined: false, allowsNull: false); - } else { - reporter.reportError( - 'must be of type PublishDiagnosticsClientCapabilitiesTagSupport'); - return false; - } - } - - static PublishDiagnosticsClientCapabilitiesTagSupport fromJson( - Map<String, Object?> json) { - final valueSetJson = json['valueSet']; - final valueSet = (valueSetJson as List<Object?>) - .map((item) => DiagnosticTag.fromJson(item as int)) - .toList(); - return PublishDiagnosticsClientCapabilitiesTagSupport( - valueSet: valueSet, - ); - } -} - /// The publish diagnostic notification's parameters. class PublishDiagnosticsParams implements ToJsonable { static const jsonHandler = LspJsonHandler( @@ -30049,7 +32762,7 @@ ); /// The engine's name. - final String engine; + final RegularExpressionEngineKind engine; /// The engine's version. final String? version; @@ -30881,7 +33594,8 @@ } /// The parameters of a [RenameRequest]. -class RenameParams implements WorkDoneProgressParams, ToJsonable { +class RenameParams + implements TextDocumentPositionParams, WorkDoneProgressParams, ToJsonable { static const jsonHandler = LspJsonHandler( RenameParams.canParse, RenameParams.fromJson, @@ -30891,10 +33605,12 @@ /// must return a [ResponseError] with an appropriate message set. final String newName; - /// The position at which this request was sent. + /// The position inside the text document. + @override final Position position; - /// The document to rename. + /// The text document. + @override final TextDocumentIdentifier textDocument; /// An optional token that a server can use to report work done progress. @@ -31254,6 +33970,76 @@ } } +/// Describes the currently selected completion item. +/// +/// @since 3.18.0 +class SelectedCompletionInfo implements ToJsonable { + static const jsonHandler = LspJsonHandler( + SelectedCompletionInfo.canParse, + SelectedCompletionInfo.fromJson, + ); + + /// The range that will be replaced if this completion item is accepted. + final Range range; + + /// The text the range will be replaced with if this completion is accepted. + final String text; + + SelectedCompletionInfo({ + required this.range, + required this.text, + }); + @override + int get hashCode => Object.hash( + range, + text, + ); + + @override + bool operator ==(Object other) { + return other is SelectedCompletionInfo && + other.runtimeType == SelectedCompletionInfo && + range == other.range && + text == other.text; + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + result['range'] = range.toJson(); + result['text'] = text; + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + if (!_canParseRange(obj, reporter, 'range', + allowsUndefined: false, allowsNull: false)) { + return false; + } + return _canParseString(obj, reporter, 'text', + allowsUndefined: false, allowsNull: false); + } else { + reporter.reportError('must be of type SelectedCompletionInfo'); + return false; + } + } + + static SelectedCompletionInfo fromJson(Map<String, Object?> json) { + final rangeJson = json['range']; + final range = Range.fromJson(rangeJson as Map<String, Object?>); + final textJson = json['text']; + final text = textJson as String; + return SelectedCompletionInfo( + range: range, + text: text, + ); + } +} + /// 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 { @@ -31964,100 +34750,6 @@ } } -class SemanticTokensClientCapabilitiesRequestsFull implements ToJsonable { - static const jsonHandler = LspJsonHandler( - SemanticTokensClientCapabilitiesRequestsFull.canParse, - SemanticTokensClientCapabilitiesRequestsFull.fromJson, - ); - - /// The client will send the `textDocument/semanticTokens/full/delta` request - /// if the server provides a corresponding handler. - final bool? delta; - - SemanticTokensClientCapabilitiesRequestsFull({ - this.delta, - }); - - @override - int get hashCode => delta.hashCode; - - @override - bool operator ==(Object other) { - return other is SemanticTokensClientCapabilitiesRequestsFull && - other.runtimeType == SemanticTokensClientCapabilitiesRequestsFull && - delta == other.delta; - } - - @override - Map<String, Object?> toJson() { - var result = <String, Object?>{}; - if (delta != null) { - result['delta'] = delta; - } - return result; - } - - @override - String toString() => jsonEncoder.convert(toJson()); - - static bool canParse(Object? obj, LspJsonReporter reporter) { - if (obj is Map<String, Object?>) { - return _canParseBool(obj, reporter, 'delta', - allowsUndefined: true, allowsNull: false); - } else { - reporter.reportError( - 'must be of type SemanticTokensClientCapabilitiesRequestsFull'); - return false; - } - } - - static SemanticTokensClientCapabilitiesRequestsFull fromJson( - Map<String, Object?> json) { - final deltaJson = json['delta']; - final delta = deltaJson as bool?; - return SemanticTokensClientCapabilitiesRequestsFull( - delta: delta, - ); - } -} - -class SemanticTokensClientCapabilitiesRequestsRange implements ToJsonable { - static const jsonHandler = LspJsonHandler( - SemanticTokensClientCapabilitiesRequestsRange.canParse, - SemanticTokensClientCapabilitiesRequestsRange.fromJson, - ); - - @override - int get hashCode => 42; - - @override - bool operator ==(Object other) { - return other is SemanticTokensClientCapabilitiesRequestsRange && - other.runtimeType == SemanticTokensClientCapabilitiesRequestsRange; - } - - @override - Map<String, Object?> toJson() => {}; - - @override - String toString() => jsonEncoder.convert(toJson()); - - static bool canParse(Object? obj, LspJsonReporter reporter) { - if (obj is Map<String, Object?>) { - return true; - } else { - reporter.reportError( - 'must be of type SemanticTokensClientCapabilitiesRequestsRange'); - return false; - } - } - - static SemanticTokensClientCapabilitiesRequestsRange fromJson( - Map<String, Object?> json) { - return SemanticTokensClientCapabilitiesRequestsRange(); - } -} - /// @since 3.16.0 class SemanticTokensDelta implements ToJsonable { static const jsonHandler = LspJsonHandler( @@ -32377,6 +35069,9 @@ } } +/// Semantic tokens options to support deltas for full documents +/// +/// @since 3.18.0 class SemanticTokensFullDelta implements ToJsonable { static const jsonHandler = LspJsonHandler( SemanticTokensFullDelta.canParse, @@ -33132,6 +35827,9 @@ static const function = SemanticTokenTypes('function'); static const interface = SemanticTokenTypes('interface'); static const keyword = SemanticTokenTypes('keyword'); + + /// @since 3.18.0 + static const label = SemanticTokenTypes('label'); static const macro = SemanticTokenTypes('macro'); static const method = SemanticTokenTypes('method'); static const modifier = SemanticTokenTypes('modifier'); @@ -33251,6 +35949,11 @@ final Either3<bool, InlayHintOptions, InlayHintRegistrationOptions>? inlayHintProvider; + /// Inline completion options used during static registration. + /// + /// @since 3.18.0 + final Either2<bool, InlineCompletionOptions>? inlineCompletionProvider; + /// The server provides inline values. /// /// @since 3.17.0 @@ -33349,6 +36052,7 @@ this.hoverProvider, this.implementationProvider, this.inlayHintProvider, + this.inlineCompletionProvider, this.inlineValueProvider, this.linkedEditingRangeProvider, this.monikerProvider, @@ -33387,6 +36091,7 @@ hoverProvider, implementationProvider, inlayHintProvider, + inlineCompletionProvider, inlineValueProvider, linkedEditingRangeProvider, monikerProvider, @@ -33430,6 +36135,7 @@ hoverProvider == other.hoverProvider && implementationProvider == other.implementationProvider && inlayHintProvider == other.inlayHintProvider && + inlineCompletionProvider == other.inlineCompletionProvider && inlineValueProvider == other.inlineValueProvider && linkedEditingRangeProvider == other.linkedEditingRangeProvider && monikerProvider == other.monikerProvider && @@ -33513,6 +36219,9 @@ if (inlayHintProvider != null) { result['inlayHintProvider'] = inlayHintProvider?.toJson(); } + if (inlineCompletionProvider != null) { + result['inlineCompletionProvider'] = inlineCompletionProvider?.toJson(); + } if (inlineValueProvider != null) { result['inlineValueProvider'] = inlineValueProvider?.toJson(); } @@ -33656,6 +36365,11 @@ allowsUndefined: true, allowsNull: false)) { return false; } + if (!_canParseBoolInlineCompletionOptions( + obj, reporter, 'inlineCompletionProvider', + allowsUndefined: true, allowsNull: false)) { + return false; + } if (!_canParseBoolInlineValueOptionsInlineValueRegistrationOptions( obj, reporter, 'inlineValueProvider', allowsUndefined: true, allowsNull: false)) { @@ -33825,6 +36539,10 @@ ? null : _eitherBoolInlayHintOptionsInlayHintRegistrationOptions( inlayHintProviderJson); + final inlineCompletionProviderJson = json['inlineCompletionProvider']; + final inlineCompletionProvider = inlineCompletionProviderJson == null + ? null + : _eitherBoolInlineCompletionOptions(inlineCompletionProviderJson); final inlineValueProviderJson = json['inlineValueProvider']; final inlineValueProvider = inlineValueProviderJson == null ? null @@ -33916,6 +36634,7 @@ hoverProvider: hoverProvider, implementationProvider: implementationProvider, inlayHintProvider: inlayHintProvider, + inlineCompletionProvider: inlineCompletionProvider, inlineValueProvider: inlineValueProvider, linkedEditingRangeProvider: linkedEditingRangeProvider, monikerProvider: monikerProvider, @@ -33935,6 +36654,7 @@ } } +/// @since 3.18.0 class ServerCompletionItemOptions implements ToJsonable { static const jsonHandler = LspJsonHandler( ServerCompletionItemOptions.canParse, @@ -33993,6 +36713,10 @@ } } +/// Information about the server +/// +/// @since 3.15.0 +/// @since 3.18.0 ServerInfo type name added. class ServerInfo implements ToJsonable { static const jsonHandler = LspJsonHandler( ServerInfo.canParse, @@ -34410,8 +37134,7 @@ ); /// Capabilities specific to the `MessageActionItem` type. - final ShowMessageRequestClientCapabilitiesMessageActionItem? - messageActionItem; + final ClientShowMessageActionItemOptions? messageActionItem; ShowMessageRequestClientCapabilities({ this.messageActionItem, @@ -34441,7 +37164,7 @@ static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map<String, Object?>) { - return _canParseShowMessageRequestClientCapabilitiesMessageActionItem( + return _canParseClientShowMessageActionItemOptions( obj, reporter, 'messageActionItem', allowsUndefined: true, allowsNull: false); } else { @@ -34455,7 +37178,7 @@ Map<String, Object?> json) { final messageActionItemJson = json['messageActionItem']; final messageActionItem = messageActionItemJson != null - ? ShowMessageRequestClientCapabilitiesMessageActionItem.fromJson( + ? ClientShowMessageActionItemOptions.fromJson( messageActionItemJson as Map<String, Object?>) : null; return ShowMessageRequestClientCapabilities( @@ -34464,66 +37187,6 @@ } } -class ShowMessageRequestClientCapabilitiesMessageActionItem - implements ToJsonable { - static const jsonHandler = LspJsonHandler( - ShowMessageRequestClientCapabilitiesMessageActionItem.canParse, - ShowMessageRequestClientCapabilitiesMessageActionItem.fromJson, - ); - - /// Whether the client supports additional attributes which are preserved and - /// send back to the server in the request's response. - final bool? additionalPropertiesSupport; - - ShowMessageRequestClientCapabilitiesMessageActionItem({ - this.additionalPropertiesSupport, - }); - - @override - int get hashCode => additionalPropertiesSupport.hashCode; - - @override - bool operator ==(Object other) { - return other is ShowMessageRequestClientCapabilitiesMessageActionItem && - other.runtimeType == - ShowMessageRequestClientCapabilitiesMessageActionItem && - additionalPropertiesSupport == other.additionalPropertiesSupport; - } - - @override - Map<String, Object?> toJson() { - var result = <String, Object?>{}; - if (additionalPropertiesSupport != null) { - result['additionalPropertiesSupport'] = additionalPropertiesSupport; - } - return result; - } - - @override - String toString() => jsonEncoder.convert(toJson()); - - static bool canParse(Object? obj, LspJsonReporter reporter) { - if (obj is Map<String, Object?>) { - return _canParseBool(obj, reporter, 'additionalPropertiesSupport', - allowsUndefined: true, allowsNull: false); - } else { - reporter.reportError( - 'must be of type ShowMessageRequestClientCapabilitiesMessageActionItem'); - return false; - } - } - - static ShowMessageRequestClientCapabilitiesMessageActionItem fromJson( - Map<String, Object?> json) { - final additionalPropertiesSupportJson = json['additionalPropertiesSupport']; - final additionalPropertiesSupport = - additionalPropertiesSupportJson as bool?; - return ShowMessageRequestClientCapabilitiesMessageActionItem( - additionalPropertiesSupport: additionalPropertiesSupport, - ); - } -} - class ShowMessageRequestParams implements ToJsonable { static const jsonHandler = LspJsonHandler( ShowMessageRequestParams.canParse, @@ -34617,12 +37280,25 @@ SignatureHelp.fromJson, ); - /// The active parameter of the active signature. If omitted or the value lies - /// outside the range of `signatures[activeSignature].parameters` defaults to - /// 0 if the active signature has parameters. If the active signature has no - /// parameters it is ignored. In future version of the protocol this property - /// might become mandatory to better express the active parameter if the - /// active signature does have any. + /// The active parameter of the active signature. + /// + /// If `null`, no parameter of the signature is active (for example a named + /// argument that does not match any declared parameters). This is only valid + /// if the client specifies the client capability + /// `textDocument.signatureHelp.noActiveParameterSupport === true` + /// + /// If omitted or the value lies outside the range of + /// `signatures[activeSignature].parameters` defaults to 0 if the active + /// signature has parameters. + /// + /// If the active signature has no parameters it is ignored. + /// + /// In future version of the protocol this property might become mandatory + /// (but still nullable) to better express the active parameter if the active + /// signature does have any. + /// + /// Since version 3.16.0 the `SignatureInformation` itself provides a + /// `activeParameter` property and it should be used instead of this one. final int? activeParameter; /// The active signature. If omitted or the value lies outside the range of @@ -34678,7 +37354,7 @@ static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map<String, Object?>) { if (!_canParseInt(obj, reporter, 'activeParameter', - allowsUndefined: true, allowsNull: false)) { + allowsUndefined: true, allowsNull: true)) { return false; } if (!_canParseInt(obj, reporter, 'activeSignature', @@ -34731,8 +37407,7 @@ /// The client supports the following `SignatureInformation` specific /// properties. - final SignatureHelpClientCapabilitiesSignatureInformation? - signatureInformation; + final ClientSignatureInformationOptions? signatureInformation; SignatureHelpClientCapabilities({ this.contextSupport, this.dynamicRegistration, @@ -34782,7 +37457,7 @@ allowsUndefined: true, allowsNull: false)) { return false; } - return _canParseSignatureHelpClientCapabilitiesSignatureInformation( + return _canParseClientSignatureInformationOptions( obj, reporter, 'signatureInformation', allowsUndefined: true, allowsNull: false); } else { @@ -34798,7 +37473,7 @@ final dynamicRegistration = dynamicRegistrationJson as bool?; final signatureInformationJson = json['signatureInformation']; final signatureInformation = signatureInformationJson != null - ? SignatureHelpClientCapabilitiesSignatureInformation.fromJson( + ? ClientSignatureInformationOptions.fromJson( signatureInformationJson as Map<String, Object?>) : null; return SignatureHelpClientCapabilities( @@ -34809,108 +37484,6 @@ } } -class SignatureHelpClientCapabilitiesSignatureInformation - implements ToJsonable { - static const jsonHandler = LspJsonHandler( - SignatureHelpClientCapabilitiesSignatureInformation.canParse, - SignatureHelpClientCapabilitiesSignatureInformation.fromJson, - ); - - /// The client supports the `activeParameter` property on - /// `SignatureInformation` literal. - /// - /// @since 3.16.0 - final bool? activeParameterSupport; - - /// Client supports the following content formats for the documentation - /// property. The order describes the preferred format of the client. - final List<MarkupKind>? documentationFormat; - - /// Client capabilities specific to parameter information. - final SignatureInformationParameterInformation? parameterInformation; - SignatureHelpClientCapabilitiesSignatureInformation({ - this.activeParameterSupport, - this.documentationFormat, - this.parameterInformation, - }); - @override - int get hashCode => Object.hash( - activeParameterSupport, - lspHashCode(documentationFormat), - parameterInformation, - ); - - @override - bool operator ==(Object other) { - return other is SignatureHelpClientCapabilitiesSignatureInformation && - other.runtimeType == - SignatureHelpClientCapabilitiesSignatureInformation && - activeParameterSupport == other.activeParameterSupport && - const DeepCollectionEquality() - .equals(documentationFormat, other.documentationFormat) && - parameterInformation == other.parameterInformation; - } - - @override - Map<String, Object?> toJson() { - var result = <String, Object?>{}; - if (activeParameterSupport != null) { - result['activeParameterSupport'] = activeParameterSupport; - } - if (documentationFormat != null) { - result['documentationFormat'] = - documentationFormat?.map((item) => item.toJson()).toList(); - } - if (parameterInformation != null) { - result['parameterInformation'] = parameterInformation?.toJson(); - } - return result; - } - - @override - String toString() => jsonEncoder.convert(toJson()); - - static bool canParse(Object? obj, LspJsonReporter reporter) { - if (obj is Map<String, Object?>) { - if (!_canParseBool(obj, reporter, 'activeParameterSupport', - allowsUndefined: true, allowsNull: false)) { - return false; - } - if (!_canParseListMarkupKind(obj, reporter, 'documentationFormat', - allowsUndefined: true, allowsNull: false)) { - return false; - } - return _canParseSignatureInformationParameterInformation( - obj, reporter, 'parameterInformation', - allowsUndefined: true, allowsNull: false); - } else { - reporter.reportError( - 'must be of type SignatureHelpClientCapabilitiesSignatureInformation'); - return false; - } - } - - static SignatureHelpClientCapabilitiesSignatureInformation fromJson( - Map<String, Object?> json) { - final activeParameterSupportJson = json['activeParameterSupport']; - final activeParameterSupport = activeParameterSupportJson as bool?; - final documentationFormatJson = json['documentationFormat']; - final documentationFormat = (documentationFormatJson as List<Object?>?) - ?.map((item) => MarkupKind.fromJson(item as String)) - .toList(); - final parameterInformationJson = json['parameterInformation']; - final parameterInformation = parameterInformationJson != null - ? SignatureInformationParameterInformation.fromJson( - parameterInformationJson as Map<String, Object?>) - : null; - return SignatureHelpClientCapabilitiesSignatureInformation( - activeParameterSupport: activeParameterSupport, - documentationFormat: documentationFormat, - parameterInformation: parameterInformation, - ); - } -} - /// Additional information about the context in which a signature help request /// was triggered. /// @@ -35406,7 +37979,13 @@ /// The index of the active parameter. /// - /// If provided, this is used in place of `SignatureHelp.activeParameter`. + /// If `null`, no parameter of the signature is active (for example a named + /// argument that does not match any declared parameters). This is only valid + /// if the client specifies the client capability + /// `textDocument.signatureHelp.noActiveParameterSupport === true` + /// + /// If provided (or `null`), this is used in place of + /// `SignatureHelp.activeParameter`. /// /// @since 3.16.0 final int? activeParameter; @@ -35466,7 +38045,7 @@ static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map<String, Object?>) { if (!_canParseInt(obj, reporter, 'activeParameter', - allowsUndefined: true, allowsNull: false)) { + allowsUndefined: true, allowsNull: true)) { return false; } if (!_canParseMarkupContentString(obj, reporter, 'documentation', @@ -35508,38 +38087,52 @@ } } -class SignatureInformationParameterInformation implements ToJsonable { +/// An interactive text edit. +/// +/// @since 3.18.0 +class SnippetTextEdit implements ToJsonable { static const jsonHandler = LspJsonHandler( - SignatureInformationParameterInformation.canParse, - SignatureInformationParameterInformation.fromJson, + SnippetTextEdit.canParse, + SnippetTextEdit.fromJson, ); - /// The client supports processing label offsets instead of a simple label - /// string. - /// - /// @since 3.14.0 - final bool? labelOffsetSupport; + /// The actual identifier of the snippet edit. + final ChangeAnnotationIdentifier? annotationId; - SignatureInformationParameterInformation({ - this.labelOffsetSupport, + /// The range of the text document to be manipulated. + final Range range; + + /// The snippet to be inserted. + final StringValue snippet; + SnippetTextEdit({ + this.annotationId, + required this.range, + required this.snippet, }); - @override - int get hashCode => labelOffsetSupport.hashCode; + int get hashCode => Object.hash( + annotationId, + range, + snippet, + ); @override bool operator ==(Object other) { - return other is SignatureInformationParameterInformation && - other.runtimeType == SignatureInformationParameterInformation && - labelOffsetSupport == other.labelOffsetSupport; + return other is SnippetTextEdit && + other.runtimeType == SnippetTextEdit && + annotationId == other.annotationId && + range == other.range && + snippet == other.snippet; } @override Map<String, Object?> toJson() { var result = <String, Object?>{}; - if (labelOffsetSupport != null) { - result['labelOffsetSupport'] = labelOffsetSupport; + if (annotationId != null) { + result['annotationId'] = annotationId; } + result['range'] = range.toJson(); + result['snippet'] = snippet.toJson(); return result; } @@ -35548,21 +38141,105 @@ static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map<String, Object?>) { - return _canParseBool(obj, reporter, 'labelOffsetSupport', - allowsUndefined: true, allowsNull: false); + if (!_canParseString(obj, reporter, 'annotationId', + allowsUndefined: true, allowsNull: false)) { + return false; + } + if (!_canParseRange(obj, reporter, 'range', + allowsUndefined: false, allowsNull: false)) { + return false; + } + return _canParseStringValue(obj, reporter, 'snippet', + allowsUndefined: false, allowsNull: false); } else { - reporter.reportError( - 'must be of type SignatureInformationParameterInformation'); + reporter.reportError('must be of type SnippetTextEdit'); return false; } } - static SignatureInformationParameterInformation fromJson( - Map<String, Object?> json) { - final labelOffsetSupportJson = json['labelOffsetSupport']; - final labelOffsetSupport = labelOffsetSupportJson as bool?; - return SignatureInformationParameterInformation( - labelOffsetSupport: labelOffsetSupport, + static SnippetTextEdit fromJson(Map<String, Object?> json) { + final annotationIdJson = json['annotationId']; + final annotationId = annotationIdJson as String?; + final rangeJson = json['range']; + final range = Range.fromJson(rangeJson as Map<String, Object?>); + final snippetJson = json['snippet']; + final snippet = StringValue.fromJson(snippetJson as Map<String, Object?>); + return SnippetTextEdit( + annotationId: annotationId, + range: range, + snippet: snippet, + ); + } +} + +/// @since 3.18.0 +class StaleRequestSupportOptions implements ToJsonable { + static const jsonHandler = LspJsonHandler( + StaleRequestSupportOptions.canParse, + StaleRequestSupportOptions.fromJson, + ); + + /// The client will actively cancel the request. + final bool cancel; + + /// The list of requests for which the client will retry the request if it + /// receives a response with error code `ContentModified` + final List<String> retryOnContentModified; + + StaleRequestSupportOptions({ + required this.cancel, + required this.retryOnContentModified, + }); + @override + int get hashCode => Object.hash( + cancel, + lspHashCode(retryOnContentModified), + ); + + @override + bool operator ==(Object other) { + return other is StaleRequestSupportOptions && + other.runtimeType == StaleRequestSupportOptions && + cancel == other.cancel && + const DeepCollectionEquality() + .equals(retryOnContentModified, other.retryOnContentModified); + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + result['cancel'] = cancel; + result['retryOnContentModified'] = retryOnContentModified; + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + if (!_canParseBool(obj, reporter, 'cancel', + allowsUndefined: false, allowsNull: false)) { + return false; + } + return _canParseListString(obj, reporter, 'retryOnContentModified', + allowsUndefined: false, allowsNull: false); + } else { + reporter.reportError('must be of type StaleRequestSupportOptions'); + return false; + } + } + + static StaleRequestSupportOptions fromJson(Map<String, Object?> json) { + final cancelJson = json['cancel']; + final cancel = cancelJson as bool; + final retryOnContentModifiedJson = json['retryOnContentModified']; + final retryOnContentModified = (retryOnContentModifiedJson as List<Object?>) + .map((item) => item as String) + .toList(); + return StaleRequestSupportOptions( + cancel: cancel, + retryOnContentModified: retryOnContentModified, ); } } @@ -35636,6 +38313,10 @@ if (InlayHintRegistrationOptions.canParse(json, nullLspJsonReporter)) { return InlayHintRegistrationOptions.fromJson(json); } + if (InlineCompletionRegistrationOptions.canParse( + json, nullLspJsonReporter)) { + return InlineCompletionRegistrationOptions.fromJson(json); + } if (InlineValueRegistrationOptions.canParse(json, nullLspJsonReporter)) { return InlineValueRegistrationOptions.fromJson(json); } @@ -35653,6 +38334,10 @@ if (SemanticTokensRegistrationOptions.canParse(json, nullLspJsonReporter)) { return SemanticTokensRegistrationOptions.fromJson(json); } + if (TextDocumentContentRegistrationOptions.canParse( + json, nullLspJsonReporter)) { + return TextDocumentContentRegistrationOptions.fromJson(json); + } if (TypeDefinitionRegistrationOptions.canParse(json, nullLspJsonReporter)) { return TypeDefinitionRegistrationOptions.fromJson(json); } @@ -35667,6 +38352,86 @@ } } +/// A string value used as a snippet is a template which allows to insert text +/// and to control the editor cursor when insertion happens. +/// +/// 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. Variables are defined with `$name` and +/// `${name:default value}`. +/// +/// @since 3.18.0 +class StringValue implements ToJsonable { + static const jsonHandler = LspJsonHandler( + StringValue.canParse, + StringValue.fromJson, + ); + + /// The kind of string value. + final String kind; + + /// The snippet string. + final String value; + + StringValue({ + this.kind = 'snippet', + required this.value, + }) { + if (kind != 'snippet') { + throw 'kind may only be the literal \'snippet\''; + } + } + @override + int get hashCode => Object.hash( + kind, + value, + ); + + @override + bool operator ==(Object other) { + return other is StringValue && + other.runtimeType == StringValue && + kind == other.kind && + value == other.value; + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + result['kind'] = kind; + result['value'] = value; + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + if (!_canParseLiteral(obj, reporter, 'kind', + allowsUndefined: false, allowsNull: false, literal: 'snippet')) { + return false; + } + return _canParseString(obj, reporter, 'value', + allowsUndefined: false, allowsNull: false); + } else { + reporter.reportError('must be of type StringValue'); + return false; + } + } + + static StringValue fromJson(Map<String, Object?> json) { + final kindJson = json['kind']; + final kind = kindJson as String; + final valueJson = json['value']; + final value = valueJson as String; + return StringValue( + kind: kind, + value: value, + ); + } +} + /// Represents information about programming constructs like variables, classes, /// interfaces etc. class SymbolInformation implements BaseSymbolInformation, ToJsonable { @@ -36021,6 +38786,11 @@ /// Capabilities specific to the `textDocument/documentSymbol` request. final DocumentSymbolClientCapabilities? documentSymbol; + /// Defines which filters the client supports. + /// + /// @since 3.18.0 + final TextDocumentFilterClientCapabilities? filters; + /// Capabilities specific to the `textDocument/foldingRange` request. /// /// @since 3.10.0 @@ -36042,6 +38812,11 @@ /// @since 3.17.0 final InlayHintClientCapabilities? inlayHint; + /// Client capabilities specific to inline completions. + /// + /// @since 3.18.0 + final InlineCompletionClientCapabilities? inlineCompletion; + /// Capabilities specific to the `textDocument/inlineValue` request. /// /// @since 3.17.0 @@ -36110,11 +38885,13 @@ this.documentHighlight, this.documentLink, this.documentSymbol, + this.filters, this.foldingRange, this.formatting, this.hover, this.implementation, this.inlayHint, + this.inlineCompletion, this.inlineValue, this.linkedEditingRange, this.moniker, @@ -36143,11 +38920,13 @@ documentHighlight, documentLink, documentSymbol, + filters, foldingRange, formatting, hover, implementation, inlayHint, + inlineCompletion, inlineValue, linkedEditingRange, moniker, @@ -36179,11 +38958,13 @@ documentHighlight == other.documentHighlight && documentLink == other.documentLink && documentSymbol == other.documentSymbol && + filters == other.filters && foldingRange == other.foldingRange && formatting == other.formatting && hover == other.hover && implementation == other.implementation && inlayHint == other.inlayHint && + inlineCompletion == other.inlineCompletion && inlineValue == other.inlineValue && linkedEditingRange == other.linkedEditingRange && moniker == other.moniker && @@ -36236,6 +39017,9 @@ if (documentSymbol != null) { result['documentSymbol'] = documentSymbol?.toJson(); } + if (filters != null) { + result['filters'] = filters?.toJson(); + } if (foldingRange != null) { result['foldingRange'] = foldingRange?.toJson(); } @@ -36251,6 +39035,9 @@ if (inlayHint != null) { result['inlayHint'] = inlayHint?.toJson(); } + if (inlineCompletion != null) { + result['inlineCompletion'] = inlineCompletion?.toJson(); + } if (inlineValue != null) { result['inlineValue'] = inlineValue?.toJson(); } @@ -36350,6 +39137,11 @@ allowsUndefined: true, allowsNull: false)) { return false; } + if (!_canParseTextDocumentFilterClientCapabilities( + obj, reporter, 'filters', + allowsUndefined: true, allowsNull: false)) { + return false; + } if (!_canParseFoldingRangeClientCapabilities( obj, reporter, 'foldingRange', allowsUndefined: true, allowsNull: false)) { @@ -36373,6 +39165,11 @@ allowsUndefined: true, allowsNull: false)) { return false; } + if (!_canParseInlineCompletionClientCapabilities( + obj, reporter, 'inlineCompletion', + allowsUndefined: true, allowsNull: false)) { + return false; + } if (!_canParseInlineValueClientCapabilities(obj, reporter, 'inlineValue', allowsUndefined: true, allowsNull: false)) { return false; @@ -36499,6 +39296,11 @@ ? DocumentSymbolClientCapabilities.fromJson( documentSymbolJson as Map<String, Object?>) : null; + final filtersJson = json['filters']; + final filters = filtersJson != null + ? TextDocumentFilterClientCapabilities.fromJson( + filtersJson as Map<String, Object?>) + : null; final foldingRangeJson = json['foldingRange']; final foldingRange = foldingRangeJson != null ? FoldingRangeClientCapabilities.fromJson( @@ -36523,6 +39325,11 @@ ? InlayHintClientCapabilities.fromJson( inlayHintJson as Map<String, Object?>) : null; + final inlineCompletionJson = json['inlineCompletion']; + final inlineCompletion = inlineCompletionJson != null + ? InlineCompletionClientCapabilities.fromJson( + inlineCompletionJson as Map<String, Object?>) + : null; final inlineValueJson = json['inlineValue']; final inlineValue = inlineValueJson != null ? InlineValueClientCapabilities.fromJson( @@ -36604,11 +39411,13 @@ documentHighlight: documentHighlight, documentLink: documentLink, documentSymbol: documentSymbol, + filters: filters, foldingRange: foldingRange, formatting: formatting, hover: hover, implementation: implementation, inlayHint: inlayHint, + inlineCompletion: inlineCompletion, inlineValue: inlineValue, linkedEditingRange: linkedEditingRange, moniker: moniker, @@ -36627,6 +39436,7 @@ } } +/// @since 3.18.0 class TextDocumentContentChangePartial implements ToJsonable { static const jsonHandler = LspJsonHandler( TextDocumentContentChangePartial.canParse, @@ -36711,6 +39521,7 @@ } } +/// @since 3.18.0 class TextDocumentContentChangeWholeDocument implements ToJsonable { static const jsonHandler = LspJsonHandler( TextDocumentContentChangeWholeDocument.canParse, @@ -36765,6 +39576,375 @@ } } +/// Client capabilities for a text document content provider. +/// +/// @since 3.18.0 +class TextDocumentContentClientCapabilities implements ToJsonable { + static const jsonHandler = LspJsonHandler( + TextDocumentContentClientCapabilities.canParse, + TextDocumentContentClientCapabilities.fromJson, + ); + + /// Text document content provider supports dynamic registration. + final bool? dynamicRegistration; + + TextDocumentContentClientCapabilities({ + this.dynamicRegistration, + }); + + @override + int get hashCode => dynamicRegistration.hashCode; + + @override + bool operator ==(Object other) { + return other is TextDocumentContentClientCapabilities && + other.runtimeType == TextDocumentContentClientCapabilities && + dynamicRegistration == other.dynamicRegistration; + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + if (dynamicRegistration != null) { + result['dynamicRegistration'] = dynamicRegistration; + } + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + return _canParseBool(obj, reporter, 'dynamicRegistration', + allowsUndefined: true, allowsNull: false); + } else { + reporter + .reportError('must be of type TextDocumentContentClientCapabilities'); + return false; + } + } + + static TextDocumentContentClientCapabilities fromJson( + Map<String, Object?> json) { + final dynamicRegistrationJson = json['dynamicRegistration']; + final dynamicRegistration = dynamicRegistrationJson as bool?; + return TextDocumentContentClientCapabilities( + dynamicRegistration: dynamicRegistration, + ); + } +} + +/// Text document content provider options. +/// +/// @since 3.18.0 +class TextDocumentContentOptions implements ToJsonable { + static const jsonHandler = LspJsonHandler( + TextDocumentContentOptions.canParse, + TextDocumentContentOptions.fromJson, + ); + + /// The schemes for which the server provides content. + final List<String> schemes; + + TextDocumentContentOptions({ + required this.schemes, + }); + + @override + int get hashCode => lspHashCode(schemes); + + @override + bool operator ==(Object other) { + return other is TextDocumentContentOptions && + other.runtimeType == TextDocumentContentOptions && + const DeepCollectionEquality().equals(schemes, other.schemes); + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + result['schemes'] = schemes; + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + return _canParseListString(obj, reporter, 'schemes', + allowsUndefined: false, allowsNull: false); + } else { + reporter.reportError('must be of type TextDocumentContentOptions'); + return false; + } + } + + static TextDocumentContentOptions fromJson(Map<String, Object?> json) { + if (TextDocumentContentRegistrationOptions.canParse( + json, nullLspJsonReporter)) { + return TextDocumentContentRegistrationOptions.fromJson(json); + } + final schemesJson = json['schemes']; + final schemes = + (schemesJson as List<Object?>).map((item) => item as String).toList(); + return TextDocumentContentOptions( + schemes: schemes, + ); + } +} + +/// Parameters for the `workspace/textDocumentContent` request. +/// +/// @since 3.18.0 +class TextDocumentContentParams implements ToJsonable { + static const jsonHandler = LspJsonHandler( + TextDocumentContentParams.canParse, + TextDocumentContentParams.fromJson, + ); + + /// The uri of the text document. + final DocumentUri uri; + + TextDocumentContentParams({ + required this.uri, + }); + + @override + int get hashCode => uri.hashCode; + + @override + bool operator ==(Object other) { + return other is TextDocumentContentParams && + other.runtimeType == TextDocumentContentParams && + uri == other.uri; + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + result['uri'] = uri.toString(); + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + return _canParseUri(obj, reporter, 'uri', + allowsUndefined: false, allowsNull: false); + } else { + reporter.reportError('must be of type TextDocumentContentParams'); + return false; + } + } + + static TextDocumentContentParams fromJson(Map<String, Object?> json) { + final uriJson = json['uri']; + final uri = Uri.parse(uriJson as String); + return TextDocumentContentParams( + uri: uri, + ); + } +} + +/// Parameters for the `workspace/textDocumentContent/refresh` request. +/// +/// @since 3.18.0 +class TextDocumentContentRefreshParams implements ToJsonable { + static const jsonHandler = LspJsonHandler( + TextDocumentContentRefreshParams.canParse, + TextDocumentContentRefreshParams.fromJson, + ); + + /// The uri of the text document to refresh. + final DocumentUri uri; + + TextDocumentContentRefreshParams({ + required this.uri, + }); + + @override + int get hashCode => uri.hashCode; + + @override + bool operator ==(Object other) { + return other is TextDocumentContentRefreshParams && + other.runtimeType == TextDocumentContentRefreshParams && + uri == other.uri; + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + result['uri'] = uri.toString(); + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + return _canParseUri(obj, reporter, 'uri', + allowsUndefined: false, allowsNull: false); + } else { + reporter.reportError('must be of type TextDocumentContentRefreshParams'); + return false; + } + } + + static TextDocumentContentRefreshParams fromJson(Map<String, Object?> json) { + final uriJson = json['uri']; + final uri = Uri.parse(uriJson as String); + return TextDocumentContentRefreshParams( + uri: uri, + ); + } +} + +/// Text document content provider registration options. +/// +/// @since 3.18.0 +class TextDocumentContentRegistrationOptions + implements + StaticRegistrationOptions, + TextDocumentContentOptions, + ToJsonable { + static const jsonHandler = LspJsonHandler( + TextDocumentContentRegistrationOptions.canParse, + TextDocumentContentRegistrationOptions.fromJson, + ); + + /// The id used to register the request. The id can be used to deregister the + /// request again. See also Registration#id. + @override + final String? id; + + /// The schemes for which the server provides content. + @override + final List<String> schemes; + + TextDocumentContentRegistrationOptions({ + this.id, + required this.schemes, + }); + @override + int get hashCode => Object.hash( + id, + lspHashCode(schemes), + ); + + @override + bool operator ==(Object other) { + return other is TextDocumentContentRegistrationOptions && + other.runtimeType == TextDocumentContentRegistrationOptions && + id == other.id && + const DeepCollectionEquality().equals(schemes, other.schemes); + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + if (id != null) { + result['id'] = id; + } + result['schemes'] = schemes; + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + if (!_canParseString(obj, reporter, 'id', + allowsUndefined: true, allowsNull: false)) { + return false; + } + return _canParseListString(obj, reporter, 'schemes', + allowsUndefined: false, allowsNull: false); + } else { + reporter.reportError( + 'must be of type TextDocumentContentRegistrationOptions'); + return false; + } + } + + static TextDocumentContentRegistrationOptions fromJson( + Map<String, Object?> json) { + final idJson = json['id']; + final id = idJson as String?; + final schemesJson = json['schemes']; + final schemes = + (schemesJson as List<Object?>).map((item) => item as String).toList(); + return TextDocumentContentRegistrationOptions( + id: id, + schemes: schemes, + ); + } +} + +/// Result of the `workspace/textDocumentContent` request. +/// +/// @since 3.18.0 +class TextDocumentContentResult implements ToJsonable { + static const jsonHandler = LspJsonHandler( + TextDocumentContentResult.canParse, + TextDocumentContentResult.fromJson, + ); + + /// The text content of the text document. Please note, that the content of + /// any subsequent open notifications for the text document might differ from + /// the returned content due to whitespace and line ending normalizations done + /// on the client + final String text; + + TextDocumentContentResult({ + required this.text, + }); + + @override + int get hashCode => text.hashCode; + + @override + bool operator ==(Object other) { + return other is TextDocumentContentResult && + other.runtimeType == TextDocumentContentResult && + text == other.text; + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + result['text'] = text; + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + return _canParseString(obj, reporter, 'text', + allowsUndefined: false, allowsNull: false); + } else { + reporter.reportError('must be of type TextDocumentContentResult'); + return false; + } + } + + static TextDocumentContentResult fromJson(Map<String, Object?> json) { + final textJson = json['text']; + final text = textJson as String; + return TextDocumentContentResult( + text: text, + ); + } +} + /// 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 @@ -36780,6 +39960,9 @@ /// /// @since 3.16.0 - support for AnnotatedTextEdit. This is guarded using a /// client capability. + /// + /// @since 3.18.0 - support for SnippetTextEdit. This is guarded using a + /// client capability. final TextDocumentEditEdits edits; /// The text document to change. @@ -36846,21 +40029,86 @@ } } -class TextDocumentFilter1 implements ToJsonable { +class TextDocumentFilterClientCapabilities implements ToJsonable { static const jsonHandler = LspJsonHandler( - TextDocumentFilter1.canParse, - TextDocumentFilter1.fromJson, + TextDocumentFilterClientCapabilities.canParse, + TextDocumentFilterClientCapabilities.fromJson, + ); + + /// The client supports Relative Patterns. + /// + /// @since 3.18.0 + final bool? relativePatternSupport; + + TextDocumentFilterClientCapabilities({ + this.relativePatternSupport, + }); + + @override + int get hashCode => relativePatternSupport.hashCode; + + @override + bool operator ==(Object other) { + return other is TextDocumentFilterClientCapabilities && + other.runtimeType == TextDocumentFilterClientCapabilities && + relativePatternSupport == other.relativePatternSupport; + } + + @override + Map<String, Object?> toJson() { + var result = <String, Object?>{}; + if (relativePatternSupport != null) { + result['relativePatternSupport'] = relativePatternSupport; + } + return result; + } + + @override + String toString() => jsonEncoder.convert(toJson()); + + static bool canParse(Object? obj, LspJsonReporter reporter) { + if (obj is Map<String, Object?>) { + return _canParseBool(obj, reporter, 'relativePatternSupport', + allowsUndefined: true, allowsNull: false); + } else { + reporter + .reportError('must be of type TextDocumentFilterClientCapabilities'); + return false; + } + } + + static TextDocumentFilterClientCapabilities fromJson( + Map<String, Object?> json) { + final relativePatternSupportJson = json['relativePatternSupport']; + final relativePatternSupport = relativePatternSupportJson as bool?; + return TextDocumentFilterClientCapabilities( + relativePatternSupport: relativePatternSupport, + ); + } +} + +/// A document filter where `language` is required field. +/// +/// @since 3.18.0 +class TextDocumentFilterLanguage implements ToJsonable { + static const jsonHandler = LspJsonHandler( + TextDocumentFilterLanguage.canParse, + TextDocumentFilterLanguage.fromJson, ); /// A language id, like `typescript`. final String language; /// A glob pattern, like **/*.{ts,js}. See TextDocumentFilter for examples. - final String? pattern; + /// + /// @since 3.18.0 - support for relative patterns. Whether clients support + /// relative patterns depends on the client capability + /// `textDocuments.filters.relativePatternSupport`. + final GlobPattern? pattern; /// A Uri [Uri.scheme], like `file` or `untitled`. final String? scheme; - TextDocumentFilter1({ + TextDocumentFilterLanguage({ required this.language, this.pattern, this.scheme, @@ -36874,8 +40122,8 @@ @override bool operator ==(Object other) { - return other is TextDocumentFilter1 && - other.runtimeType == TextDocumentFilter1 && + return other is TextDocumentFilterLanguage && + other.runtimeType == TextDocumentFilterLanguage && language == other.language && pattern == other.pattern && scheme == other.scheme; @@ -36886,7 +40134,7 @@ var result = <String, Object?>{}; result['language'] = language; if (pattern != null) { - result['pattern'] = pattern; + result['pattern'] = pattern?.toJson(); } if (scheme != null) { result['scheme'] = scheme; @@ -36903,26 +40151,27 @@ allowsUndefined: false, allowsNull: false)) { return false; } - if (!_canParseString(obj, reporter, 'pattern', + if (!_canParseStringRelativePattern(obj, reporter, 'pattern', allowsUndefined: true, allowsNull: false)) { return false; } return _canParseString(obj, reporter, 'scheme', allowsUndefined: true, allowsNull: false); } else { - reporter.reportError('must be of type TextDocumentFilter1'); + reporter.reportError('must be of type TextDocumentFilterLanguage'); return false; } } - static TextDocumentFilter1 fromJson(Map<String, Object?> json) { + static TextDocumentFilterLanguage fromJson(Map<String, Object?> json) { final languageJson = json['language']; final language = languageJson as String; final patternJson = json['pattern']; - final pattern = patternJson as String?; + final pattern = + patternJson == null ? null : _eitherStringRelativePattern(patternJson); final schemeJson = json['scheme']; final scheme = schemeJson as String?; - return TextDocumentFilter1( + return TextDocumentFilterLanguage( language: language, pattern: pattern, scheme: scheme, @@ -36930,21 +40179,28 @@ } } -class TextDocumentFilter3 implements ToJsonable { +/// A document filter where `pattern` is required field. +/// +/// @since 3.18.0 +class TextDocumentFilterPattern implements ToJsonable { static const jsonHandler = LspJsonHandler( - TextDocumentFilter3.canParse, - TextDocumentFilter3.fromJson, + TextDocumentFilterPattern.canParse, + TextDocumentFilterPattern.fromJson, ); /// A language id, like `typescript`. final String? language; /// A glob pattern, like **/*.{ts,js}. See TextDocumentFilter for examples. - final String pattern; + /// + /// @since 3.18.0 - support for relative patterns. Whether clients support + /// relative patterns depends on the client capability + /// `textDocuments.filters.relativePatternSupport`. + final GlobPattern pattern; /// A Uri [Uri.scheme], like `file` or `untitled`. final String? scheme; - TextDocumentFilter3({ + TextDocumentFilterPattern({ this.language, required this.pattern, this.scheme, @@ -36958,8 +40214,8 @@ @override bool operator ==(Object other) { - return other is TextDocumentFilter3 && - other.runtimeType == TextDocumentFilter3 && + return other is TextDocumentFilterPattern && + other.runtimeType == TextDocumentFilterPattern && language == other.language && pattern == other.pattern && scheme == other.scheme; @@ -36971,7 +40227,7 @@ if (language != null) { result['language'] = language; } - result['pattern'] = pattern; + result['pattern'] = pattern.toJson(); if (scheme != null) { result['scheme'] = scheme; } @@ -36987,26 +40243,26 @@ allowsUndefined: true, allowsNull: false)) { return false; } - if (!_canParseString(obj, reporter, 'pattern', + if (!_canParseStringRelativePattern(obj, reporter, 'pattern', allowsUndefined: false, allowsNull: false)) { return false; } return _canParseString(obj, reporter, 'scheme', allowsUndefined: true, allowsNull: false); } else { - reporter.reportError('must be of type TextDocumentFilter3'); + reporter.reportError('must be of type TextDocumentFilterPattern'); return false; } } - static TextDocumentFilter3 fromJson(Map<String, Object?> json) { + static TextDocumentFilterPattern fromJson(Map<String, Object?> json) { final languageJson = json['language']; final language = languageJson as String?; final patternJson = json['pattern']; - final pattern = patternJson as String; + final pattern = _eitherStringRelativePattern(patternJson); final schemeJson = json['scheme']; final scheme = schemeJson as String?; - return TextDocumentFilter3( + return TextDocumentFilterPattern( language: language, pattern: pattern, scheme: scheme, @@ -37014,6 +40270,9 @@ } } +/// A document filter where `scheme` is required field. +/// +/// @since 3.18.0 class TextDocumentFilterScheme implements ToJsonable { static const jsonHandler = LspJsonHandler( TextDocumentFilterScheme.canParse, @@ -37024,7 +40283,11 @@ final String? language; /// A glob pattern, like **/*.{ts,js}. See TextDocumentFilter for examples. - final String? pattern; + /// + /// @since 3.18.0 - support for relative patterns. Whether clients support + /// relative patterns depends on the client capability + /// `textDocuments.filters.relativePatternSupport`. + final GlobPattern? pattern; /// A Uri [Uri.scheme], like `file` or `untitled`. final String scheme; @@ -37056,7 +40319,7 @@ result['language'] = language; } if (pattern != null) { - result['pattern'] = pattern; + result['pattern'] = pattern?.toJson(); } result['scheme'] = scheme; return result; @@ -37071,7 +40334,7 @@ allowsUndefined: true, allowsNull: false)) { return false; } - if (!_canParseString(obj, reporter, 'pattern', + if (!_canParseStringRelativePattern(obj, reporter, 'pattern', allowsUndefined: true, allowsNull: false)) { return false; } @@ -37087,7 +40350,8 @@ final languageJson = json['language']; final language = languageJson as String?; final patternJson = json['pattern']; - final pattern = patternJson as String?; + final pattern = + patternJson == null ? null : _eitherStringRelativePattern(patternJson); final schemeJson = json['scheme']; final scheme = schemeJson as String; return TextDocumentFilterScheme( @@ -37166,7 +40430,7 @@ ); /// The text document's language identifier. - final String languageId; + final LanguageKind languageId; /// The content of the opened text document. final String text; @@ -37204,7 +40468,7 @@ @override Map<String, Object?> toJson() { var result = <String, Object?>{}; - result['languageId'] = languageId; + result['languageId'] = languageId.toJson(); result['text'] = text; result['uri'] = uri.toString(); result['version'] = version; @@ -37216,7 +40480,7 @@ static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map<String, Object?>) { - if (!_canParseString(obj, reporter, 'languageId', + if (!_canParseLanguageKind(obj, reporter, 'languageId', allowsUndefined: false, allowsNull: false)) { return false; } @@ -37238,7 +40502,7 @@ static TextDocumentItem fromJson(Map<String, Object?> json) { final languageIdJson = json['languageId']; - final languageId = languageIdJson as String; + final languageId = LanguageKind.fromJson(languageIdJson as String); final textJson = json['text']; final text = textJson as String; final uriJson = json['uri']; @@ -37312,9 +40576,15 @@ } static TextDocumentPositionParams fromJson(Map<String, Object?> json) { + if (InlineCompletionParams.canParse(json, nullLspJsonReporter)) { + return InlineCompletionParams.fromJson(json); + } 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); } @@ -37476,6 +40746,10 @@ if (InlayHintRegistrationOptions.canParse(json, nullLspJsonReporter)) { return InlayHintRegistrationOptions.fromJson(json); } + if (InlineCompletionRegistrationOptions.canParse( + json, nullLspJsonReporter)) { + return InlineCompletionRegistrationOptions.fromJson(json); + } if (InlineValueRegistrationOptions.canParse(json, nullLspJsonReporter)) { return InlineValueRegistrationOptions.fromJson(json); } @@ -40009,6 +43283,9 @@ if (DocumentLinkOptions.canParse(json, nullLspJsonReporter)) { return DocumentLinkOptions.fromJson(json); } + if (DocumentRangeFormattingOptions.canParse(json, nullLspJsonReporter)) { + return DocumentRangeFormattingOptions.fromJson(json); + } if (DocumentSymbolOptions.canParse(json, nullLspJsonReporter)) { return DocumentSymbolOptions.fromJson(json); } @@ -40039,9 +43316,6 @@ if (DocumentHighlightOptions.canParse(json, nullLspJsonReporter)) { return DocumentHighlightOptions.fromJson(json); } - if (DocumentRangeFormattingOptions.canParse(json, nullLspJsonReporter)) { - return DocumentRangeFormattingOptions.fromJson(json); - } if (FoldingRangeOptions.canParse(json, nullLspJsonReporter)) { return FoldingRangeOptions.fromJson(json); } @@ -40051,6 +43325,9 @@ if (ImplementationOptions.canParse(json, nullLspJsonReporter)) { return ImplementationOptions.fromJson(json); } + if (InlineCompletionOptions.canParse(json, nullLspJsonReporter)) { + return InlineCompletionOptions.fromJson(json); + } if (InlineValueOptions.canParse(json, nullLspJsonReporter)) { return InlineValueOptions.fromJson(json); } @@ -40135,12 +43412,12 @@ if (DocumentRangeFormattingParams.canParse(json, nullLspJsonReporter)) { return DocumentRangeFormattingParams.fromJson(json); } + if (DocumentRangesFormattingParams.canParse(json, nullLspJsonReporter)) { + return DocumentRangesFormattingParams.fromJson(json); + } 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); } @@ -40189,9 +43466,15 @@ if (FoldingRangeParams.canParse(json, nullLspJsonReporter)) { return FoldingRangeParams.fromJson(json); } + if (InlineCompletionParams.canParse(json, nullLspJsonReporter)) { + return InlineCompletionParams.fromJson(json); + } 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); } @@ -40411,6 +43694,12 @@ /// Since 3.16.0 final FileOperationClientCapabilities? fileOperations; + /// Capabilities specific to the folding range requests scoped to the + /// workspace. + /// + /// @since 3.18.0 + final FoldingRangeWorkspaceClientCapabilities? foldingRange; + /// Capabilities specific to the inlay hint requests scoped to the workspace. /// /// @since 3.17.0. @@ -40431,6 +43720,11 @@ /// Capabilities specific to the `workspace/symbol` request. final WorkspaceSymbolClientCapabilities? symbol; + /// Capabilities specific to the `workspace/textDocumentContent` request. + /// + /// @since 3.18.0 + final TextDocumentContentClientCapabilities? textDocumentContent; + /// Capabilities specific to `WorkspaceEdit`s. final WorkspaceEditClientCapabilities? workspaceEdit; @@ -40447,10 +43741,12 @@ this.didChangeWatchedFiles, this.executeCommand, this.fileOperations, + this.foldingRange, this.inlayHint, this.inlineValue, this.semanticTokens, this.symbol, + this.textDocumentContent, this.workspaceEdit, this.workspaceFolders, }); @@ -40464,10 +43760,12 @@ didChangeWatchedFiles, executeCommand, fileOperations, + foldingRange, inlayHint, inlineValue, semanticTokens, symbol, + textDocumentContent, workspaceEdit, workspaceFolders, ); @@ -40484,10 +43782,12 @@ didChangeWatchedFiles == other.didChangeWatchedFiles && executeCommand == other.executeCommand && fileOperations == other.fileOperations && + foldingRange == other.foldingRange && inlayHint == other.inlayHint && inlineValue == other.inlineValue && semanticTokens == other.semanticTokens && symbol == other.symbol && + textDocumentContent == other.textDocumentContent && workspaceEdit == other.workspaceEdit && workspaceFolders == other.workspaceFolders; } @@ -40519,6 +43819,9 @@ if (fileOperations != null) { result['fileOperations'] = fileOperations?.toJson(); } + if (foldingRange != null) { + result['foldingRange'] = foldingRange?.toJson(); + } if (inlayHint != null) { result['inlayHint'] = inlayHint?.toJson(); } @@ -40531,6 +43834,9 @@ if (symbol != null) { result['symbol'] = symbol?.toJson(); } + if (textDocumentContent != null) { + result['textDocumentContent'] = textDocumentContent?.toJson(); + } if (workspaceEdit != null) { result['workspaceEdit'] = workspaceEdit?.toJson(); } @@ -40583,6 +43889,11 @@ allowsUndefined: true, allowsNull: false)) { return false; } + if (!_canParseFoldingRangeWorkspaceClientCapabilities( + obj, reporter, 'foldingRange', + allowsUndefined: true, allowsNull: false)) { + return false; + } if (!_canParseInlayHintWorkspaceClientCapabilities( obj, reporter, 'inlayHint', allowsUndefined: true, allowsNull: false)) { @@ -40602,6 +43913,11 @@ allowsUndefined: true, allowsNull: false)) { return false; } + if (!_canParseTextDocumentContentClientCapabilities( + obj, reporter, 'textDocumentContent', + allowsUndefined: true, allowsNull: false)) { + return false; + } if (!_canParseWorkspaceEditClientCapabilities( obj, reporter, 'workspaceEdit', allowsUndefined: true, allowsNull: false)) { @@ -40650,6 +43966,11 @@ ? FileOperationClientCapabilities.fromJson( fileOperationsJson as Map<String, Object?>) : null; + final foldingRangeJson = json['foldingRange']; + final foldingRange = foldingRangeJson != null + ? FoldingRangeWorkspaceClientCapabilities.fromJson( + foldingRangeJson as Map<String, Object?>) + : null; final inlayHintJson = json['inlayHint']; final inlayHint = inlayHintJson != null ? InlayHintWorkspaceClientCapabilities.fromJson( @@ -40670,6 +43991,11 @@ ? WorkspaceSymbolClientCapabilities.fromJson( symbolJson as Map<String, Object?>) : null; + final textDocumentContentJson = json['textDocumentContent']; + final textDocumentContent = textDocumentContentJson != null + ? TextDocumentContentClientCapabilities.fromJson( + textDocumentContentJson as Map<String, Object?>) + : null; final workspaceEditJson = json['workspaceEdit']; final workspaceEdit = workspaceEditJson != null ? WorkspaceEditClientCapabilities.fromJson( @@ -40686,10 +44012,12 @@ didChangeWatchedFiles: didChangeWatchedFiles, executeCommand: executeCommand, fileOperations: fileOperations, + foldingRange: foldingRange, inlayHint: inlayHint, inlineValue: inlineValue, semanticTokens: semanticTokens, symbol: symbol, + textDocumentContent: textDocumentContent, workspaceEdit: workspaceEdit, workspaceFolders: workspaceFolders, ); @@ -41076,8 +44404,7 @@ /// create file, rename file and delete file changes. /// /// @since 3.16.0 - final WorkspaceEditClientCapabilitiesChangeAnnotationSupport? - changeAnnotationSupport; + final ChangeAnnotationsSupportOptions? changeAnnotationSupport; /// The client supports versioned document changes in `WorkspaceEdit`s final bool? documentChanges; @@ -41088,6 +44415,11 @@ /// @since 3.13.0 final FailureHandlingKind? failureHandling; + /// Whether the client supports `WorkspaceEditMetadata` in `WorkspaceEdit`s. + /// + /// @since 3.18.0 + final bool? metadataSupport; + /// Whether the client normalizes line endings to the client specific setting. /// If set to `true` the client will normalize line ending characters in a /// workspace edit to the client-specified new line character. @@ -41100,20 +44432,29 @@ /// /// @since 3.13.0 final List<ResourceOperationKind>? resourceOperations; + + /// Whether the client supports snippets as text edits. + /// + /// @since 3.18.0 + final bool? snippetEditSupport; WorkspaceEditClientCapabilities({ this.changeAnnotationSupport, this.documentChanges, this.failureHandling, + this.metadataSupport, this.normalizesLineEndings, this.resourceOperations, + this.snippetEditSupport, }); @override int get hashCode => Object.hash( changeAnnotationSupport, documentChanges, failureHandling, + metadataSupport, normalizesLineEndings, lspHashCode(resourceOperations), + snippetEditSupport, ); @override @@ -41123,9 +44464,11 @@ changeAnnotationSupport == other.changeAnnotationSupport && documentChanges == other.documentChanges && failureHandling == other.failureHandling && + metadataSupport == other.metadataSupport && normalizesLineEndings == other.normalizesLineEndings && const DeepCollectionEquality() - .equals(resourceOperations, other.resourceOperations); + .equals(resourceOperations, other.resourceOperations) && + snippetEditSupport == other.snippetEditSupport; } @override @@ -41140,6 +44483,9 @@ if (failureHandling != null) { result['failureHandling'] = failureHandling?.toJson(); } + if (metadataSupport != null) { + result['metadataSupport'] = metadataSupport; + } if (normalizesLineEndings != null) { result['normalizesLineEndings'] = normalizesLineEndings; } @@ -41147,6 +44493,9 @@ result['resourceOperations'] = resourceOperations?.map((item) => item.toJson()).toList(); } + if (snippetEditSupport != null) { + result['snippetEditSupport'] = snippetEditSupport; + } return result; } @@ -41155,7 +44504,7 @@ static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map<String, Object?>) { - if (!_canParseWorkspaceEditClientCapabilitiesChangeAnnotationSupport( + if (!_canParseChangeAnnotationsSupportOptions( obj, reporter, 'changeAnnotationSupport', allowsUndefined: true, allowsNull: false)) { return false; @@ -41168,12 +44517,20 @@ allowsUndefined: true, allowsNull: false)) { return false; } + if (!_canParseBool(obj, reporter, 'metadataSupport', + allowsUndefined: true, allowsNull: false)) { + return false; + } if (!_canParseBool(obj, reporter, 'normalizesLineEndings', allowsUndefined: true, allowsNull: false)) { return false; } - return _canParseListResourceOperationKind( + if (!_canParseListResourceOperationKind( obj, reporter, 'resourceOperations', + allowsUndefined: true, allowsNull: false)) { + return false; + } + return _canParseBool(obj, reporter, 'snippetEditSupport', allowsUndefined: true, allowsNull: false); } else { reporter.reportError('must be of type WorkspaceEditClientCapabilities'); @@ -41184,7 +44541,7 @@ static WorkspaceEditClientCapabilities fromJson(Map<String, Object?> json) { final changeAnnotationSupportJson = json['changeAnnotationSupport']; final changeAnnotationSupport = changeAnnotationSupportJson != null - ? WorkspaceEditClientCapabilitiesChangeAnnotationSupport.fromJson( + ? ChangeAnnotationsSupportOptions.fromJson( changeAnnotationSupportJson as Map<String, Object?>) : null; final documentChangesJson = json['documentChanges']; @@ -41193,54 +44550,59 @@ final failureHandling = failureHandlingJson != null ? FailureHandlingKind.fromJson(failureHandlingJson as String) : null; + final metadataSupportJson = json['metadataSupport']; + final metadataSupport = metadataSupportJson as bool?; final normalizesLineEndingsJson = json['normalizesLineEndings']; final normalizesLineEndings = normalizesLineEndingsJson as bool?; final resourceOperationsJson = json['resourceOperations']; final resourceOperations = (resourceOperationsJson as List<Object?>?) ?.map((item) => ResourceOperationKind.fromJson(item as String)) .toList(); + final snippetEditSupportJson = json['snippetEditSupport']; + final snippetEditSupport = snippetEditSupportJson as bool?; return WorkspaceEditClientCapabilities( changeAnnotationSupport: changeAnnotationSupport, documentChanges: documentChanges, failureHandling: failureHandling, + metadataSupport: metadataSupport, normalizesLineEndings: normalizesLineEndings, resourceOperations: resourceOperations, + snippetEditSupport: snippetEditSupport, ); } } -class WorkspaceEditClientCapabilitiesChangeAnnotationSupport - implements ToJsonable { +/// Additional data about a workspace edit. +/// +/// @since 3.18.0 +class WorkspaceEditMetadata implements ToJsonable { static const jsonHandler = LspJsonHandler( - WorkspaceEditClientCapabilitiesChangeAnnotationSupport.canParse, - WorkspaceEditClientCapabilitiesChangeAnnotationSupport.fromJson, + WorkspaceEditMetadata.canParse, + WorkspaceEditMetadata.fromJson, ); - /// 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; + /// Signal to the editor that this edit is a refactoring. + final bool? isRefactoring; - WorkspaceEditClientCapabilitiesChangeAnnotationSupport({ - this.groupsOnLabel, + WorkspaceEditMetadata({ + this.isRefactoring, }); @override - int get hashCode => groupsOnLabel.hashCode; + int get hashCode => isRefactoring.hashCode; @override bool operator ==(Object other) { - return other is WorkspaceEditClientCapabilitiesChangeAnnotationSupport && - other.runtimeType == - WorkspaceEditClientCapabilitiesChangeAnnotationSupport && - groupsOnLabel == other.groupsOnLabel; + return other is WorkspaceEditMetadata && + other.runtimeType == WorkspaceEditMetadata && + isRefactoring == other.isRefactoring; } @override Map<String, Object?> toJson() { var result = <String, Object?>{}; - if (groupsOnLabel != null) { - result['groupsOnLabel'] = groupsOnLabel; + if (isRefactoring != null) { + result['isRefactoring'] = isRefactoring; } return result; } @@ -41250,21 +44612,19 @@ static bool canParse(Object? obj, LspJsonReporter reporter) { if (obj is Map<String, Object?>) { - return _canParseBool(obj, reporter, 'groupsOnLabel', + return _canParseBool(obj, reporter, 'isRefactoring', allowsUndefined: true, allowsNull: false); } else { - reporter.reportError( - 'must be of type WorkspaceEditClientCapabilitiesChangeAnnotationSupport'); + reporter.reportError('must be of type WorkspaceEditMetadata'); return false; } } - static WorkspaceEditClientCapabilitiesChangeAnnotationSupport fromJson( - Map<String, Object?> json) { - final groupsOnLabelJson = json['groupsOnLabel']; - final groupsOnLabel = groupsOnLabelJson as bool?; - return WorkspaceEditClientCapabilitiesChangeAnnotationSupport( - groupsOnLabel: groupsOnLabel, + static WorkspaceEditMetadata fromJson(Map<String, Object?> json) { + final isRefactoringJson = json['isRefactoring']; + final isRefactoring = isRefactoringJson as bool?; + return WorkspaceEditMetadata( + isRefactoring: isRefactoring, ); } } @@ -41617,6 +44977,9 @@ } } +/// Defines workspace specific capabilities of the server. +/// +/// @since 3.18.0 class WorkspaceOptions implements ToJsonable { static const jsonHandler = LspJsonHandler( WorkspaceOptions.canParse, @@ -41629,18 +44992,25 @@ /// @since 3.16.0 final FileOperationOptions? fileOperations; + /// The server supports the `workspace/textDocumentContent` request. + /// + /// @since 3.18.0 + final Either2<TextDocumentContentOptions, + TextDocumentContentRegistrationOptions>? textDocumentContent; + /// The server supports workspace folder. /// /// @since 3.6.0 final WorkspaceFoldersServerCapabilities? workspaceFolders; - WorkspaceOptions({ this.fileOperations, + this.textDocumentContent, this.workspaceFolders, }); @override int get hashCode => Object.hash( fileOperations, + textDocumentContent, workspaceFolders, ); @@ -41649,6 +45019,7 @@ return other is WorkspaceOptions && other.runtimeType == WorkspaceOptions && fileOperations == other.fileOperations && + textDocumentContent == other.textDocumentContent && workspaceFolders == other.workspaceFolders; } @@ -41658,6 +45029,9 @@ if (fileOperations != null) { result['fileOperations'] = fileOperations?.toJson(); } + if (textDocumentContent != null) { + result['textDocumentContent'] = textDocumentContent?.toJson(); + } if (workspaceFolders != null) { result['workspaceFolders'] = workspaceFolders?.toJson(); } @@ -41673,6 +45047,11 @@ allowsUndefined: true, allowsNull: false)) { return false; } + if (!_canParseTextDocumentContentOptionsTextDocumentContentRegistrationOptions( + obj, reporter, 'textDocumentContent', + allowsUndefined: true, allowsNull: false)) { + return false; + } return _canParseWorkspaceFoldersServerCapabilities( obj, reporter, 'workspaceFolders', allowsUndefined: true, allowsNull: false); @@ -41688,6 +45067,11 @@ ? FileOperationOptions.fromJson( fileOperationsJson as Map<String, Object?>) : null; + final textDocumentContentJson = json['textDocumentContent']; + final textDocumentContent = textDocumentContentJson == null + ? null + : _eitherTextDocumentContentOptionsTextDocumentContentRegistrationOptions( + textDocumentContentJson); final workspaceFoldersJson = json['workspaceFolders']; final workspaceFolders = workspaceFoldersJson != null ? WorkspaceFoldersServerCapabilities.fromJson( @@ -41695,6 +45079,7 @@ : null; return WorkspaceOptions( fileOperations: fileOperations, + textDocumentContent: textDocumentContent, workspaceFolders: workspaceFolders, ); } @@ -41731,7 +45116,7 @@ /// `workspace.symbol.resolveSupport`. /// /// See SymbolInformation#location for more details. - final Either2<Location, WorkspaceSymbolLocation> location; + final Either2<Location, LocationUriOnly> location; /// The name of this symbol. @override @@ -41803,7 +45188,7 @@ allowsUndefined: false, allowsNull: false)) { return false; } - if (!_canParseLocationWorkspaceSymbolLocation(obj, reporter, 'location', + if (!_canParseLocationLocationUriOnly(obj, reporter, 'location', allowsUndefined: false, allowsNull: false)) { return false; } @@ -41827,7 +45212,7 @@ final kindJson = json['kind']; final kind = SymbolKind.fromJson(kindJson as int); final locationJson = json['location']; - final location = _eitherLocationWorkspaceSymbolLocation(locationJson); + final location = _eitherLocationLocationUriOnly(locationJson); final nameJson = json['name']; final name = nameJson as String; final tagsJson = json['tags']; @@ -41860,17 +45245,17 @@ /// properties. /// /// @since 3.17.0 - final WorkspaceSymbolClientCapabilitiesResolveSupport? resolveSupport; + final ClientSymbolResolveOptions? resolveSupport; /// Specific capabilities for the `SymbolKind` in the `workspace/symbol` /// request. - final WorkspaceSymbolClientCapabilitiesSymbolKind? symbolKind; + final ClientSymbolKindOptions? symbolKind; /// The client supports tags on `SymbolInformation`. Clients supporting tags /// have to handle unknown tags gracefully. /// /// @since 3.16.0 - final WorkspaceSymbolClientCapabilitiesTagSupport? tagSupport; + final ClientSymbolTagOptions? tagSupport; WorkspaceSymbolClientCapabilities({ this.dynamicRegistration, this.resolveSupport, @@ -41922,18 +45307,15 @@ allowsUndefined: true, allowsNull: false)) { return false; } - if (!_canParseWorkspaceSymbolClientCapabilitiesResolveSupport( - obj, reporter, 'resolveSupport', + if (!_canParseClientSymbolResolveOptions(obj, reporter, 'resolveSupport', allowsUndefined: true, allowsNull: false)) { return false; } - if (!_canParseWorkspaceSymbolClientCapabilitiesSymbolKind( - obj, reporter, 'symbolKind', + if (!_canParseClientSymbolKindOptions(obj, reporter, 'symbolKind', allowsUndefined: true, allowsNull: false)) { return false; } - return _canParseWorkspaceSymbolClientCapabilitiesTagSupport( - obj, reporter, 'tagSupport', + return _canParseClientSymbolTagOptions(obj, reporter, 'tagSupport', allowsUndefined: true, allowsNull: false); } else { reporter.reportError('must be of type WorkspaceSymbolClientCapabilities'); @@ -41946,17 +45328,17 @@ final dynamicRegistration = dynamicRegistrationJson as bool?; final resolveSupportJson = json['resolveSupport']; final resolveSupport = resolveSupportJson != null - ? WorkspaceSymbolClientCapabilitiesResolveSupport.fromJson( + ? ClientSymbolResolveOptions.fromJson( resolveSupportJson as Map<String, Object?>) : null; final symbolKindJson = json['symbolKind']; final symbolKind = symbolKindJson != null - ? WorkspaceSymbolClientCapabilitiesSymbolKind.fromJson( + ? ClientSymbolKindOptions.fromJson( symbolKindJson as Map<String, Object?>) : null; final tagSupportJson = json['tagSupport']; final tagSupport = tagSupportJson != null - ? WorkspaceSymbolClientCapabilitiesTagSupport.fromJson( + ? ClientSymbolTagOptions.fromJson( tagSupportJson as Map<String, Object?>) : null; return WorkspaceSymbolClientCapabilities( @@ -41968,232 +45350,6 @@ } } -class WorkspaceSymbolClientCapabilitiesResolveSupport implements ToJsonable { - static const jsonHandler = LspJsonHandler( - WorkspaceSymbolClientCapabilitiesResolveSupport.canParse, - WorkspaceSymbolClientCapabilitiesResolveSupport.fromJson, - ); - - /// The properties that a client can resolve lazily. Usually `location.range` - final List<String> properties; - - WorkspaceSymbolClientCapabilitiesResolveSupport({ - required this.properties, - }); - - @override - int get hashCode => lspHashCode(properties); - - @override - bool operator ==(Object other) { - return other is WorkspaceSymbolClientCapabilitiesResolveSupport && - other.runtimeType == WorkspaceSymbolClientCapabilitiesResolveSupport && - const DeepCollectionEquality().equals(properties, other.properties); - } - - @override - Map<String, Object?> toJson() { - var result = <String, Object?>{}; - result['properties'] = properties; - return result; - } - - @override - String toString() => jsonEncoder.convert(toJson()); - - static bool canParse(Object? obj, LspJsonReporter reporter) { - if (obj is Map<String, Object?>) { - return _canParseListString(obj, reporter, 'properties', - allowsUndefined: false, allowsNull: false); - } else { - reporter.reportError( - 'must be of type WorkspaceSymbolClientCapabilitiesResolveSupport'); - return false; - } - } - - static WorkspaceSymbolClientCapabilitiesResolveSupport fromJson( - Map<String, Object?> json) { - final propertiesJson = json['properties']; - final properties = (propertiesJson as List<Object?>) - .map((item) => item as String) - .toList(); - return WorkspaceSymbolClientCapabilitiesResolveSupport( - properties: properties, - ); - } -} - -class WorkspaceSymbolClientCapabilitiesSymbolKind implements ToJsonable { - static const jsonHandler = LspJsonHandler( - WorkspaceSymbolClientCapabilitiesSymbolKind.canParse, - WorkspaceSymbolClientCapabilitiesSymbolKind.fromJson, - ); - - /// The symbol kind values the client supports. When this property exists the - /// client also guarantees that it will handle values outside its set - /// gracefully and falls back to a default value when unknown. - /// - /// If this property is not present the client only supports the symbol kinds - /// from `File` to `Array` as defined in the initial version of the protocol. - final List<SymbolKind>? valueSet; - - WorkspaceSymbolClientCapabilitiesSymbolKind({ - this.valueSet, - }); - - @override - int get hashCode => lspHashCode(valueSet); - - @override - bool operator ==(Object other) { - return other is WorkspaceSymbolClientCapabilitiesSymbolKind && - other.runtimeType == WorkspaceSymbolClientCapabilitiesSymbolKind && - const DeepCollectionEquality().equals(valueSet, other.valueSet); - } - - @override - Map<String, Object?> toJson() { - var result = <String, Object?>{}; - if (valueSet != null) { - result['valueSet'] = valueSet?.map((item) => item.toJson()).toList(); - } - return result; - } - - @override - String toString() => jsonEncoder.convert(toJson()); - - static bool canParse(Object? obj, LspJsonReporter reporter) { - if (obj is Map<String, Object?>) { - return _canParseListSymbolKind(obj, reporter, 'valueSet', - allowsUndefined: true, allowsNull: false); - } else { - reporter.reportError( - 'must be of type WorkspaceSymbolClientCapabilitiesSymbolKind'); - return false; - } - } - - static WorkspaceSymbolClientCapabilitiesSymbolKind fromJson( - Map<String, Object?> json) { - final valueSetJson = json['valueSet']; - final valueSet = (valueSetJson as List<Object?>?) - ?.map((item) => SymbolKind.fromJson(item as int)) - .toList(); - return WorkspaceSymbolClientCapabilitiesSymbolKind( - valueSet: valueSet, - ); - } -} - -class WorkspaceSymbolClientCapabilitiesTagSupport implements ToJsonable { - static const jsonHandler = LspJsonHandler( - WorkspaceSymbolClientCapabilitiesTagSupport.canParse, - WorkspaceSymbolClientCapabilitiesTagSupport.fromJson, - ); - - /// The tags supported by the client. - final List<SymbolTag> valueSet; - - WorkspaceSymbolClientCapabilitiesTagSupport({ - required this.valueSet, - }); - - @override - int get hashCode => lspHashCode(valueSet); - - @override - bool operator ==(Object other) { - return other is WorkspaceSymbolClientCapabilitiesTagSupport && - other.runtimeType == WorkspaceSymbolClientCapabilitiesTagSupport && - const DeepCollectionEquality().equals(valueSet, other.valueSet); - } - - @override - Map<String, Object?> toJson() { - var result = <String, Object?>{}; - result['valueSet'] = valueSet.map((item) => item.toJson()).toList(); - return result; - } - - @override - String toString() => jsonEncoder.convert(toJson()); - - static bool canParse(Object? obj, LspJsonReporter reporter) { - if (obj is Map<String, Object?>) { - return _canParseListSymbolTag(obj, reporter, 'valueSet', - allowsUndefined: false, allowsNull: false); - } else { - reporter.reportError( - 'must be of type WorkspaceSymbolClientCapabilitiesTagSupport'); - return false; - } - } - - static WorkspaceSymbolClientCapabilitiesTagSupport fromJson( - Map<String, Object?> json) { - final valueSetJson = json['valueSet']; - final valueSet = (valueSetJson as List<Object?>) - .map((item) => SymbolTag.fromJson(item as int)) - .toList(); - return WorkspaceSymbolClientCapabilitiesTagSupport( - valueSet: valueSet, - ); - } -} - -class WorkspaceSymbolLocation implements ToJsonable { - static const jsonHandler = LspJsonHandler( - WorkspaceSymbolLocation.canParse, - WorkspaceSymbolLocation.fromJson, - ); - - final DocumentUri uri; - - WorkspaceSymbolLocation({ - required this.uri, - }); - - @override - int get hashCode => uri.hashCode; - - @override - bool operator ==(Object other) { - return other is WorkspaceSymbolLocation && - other.runtimeType == WorkspaceSymbolLocation && - uri == other.uri; - } - - @override - Map<String, Object?> toJson() { - var result = <String, Object?>{}; - result['uri'] = uri.toString(); - return result; - } - - @override - String toString() => jsonEncoder.convert(toJson()); - - static bool canParse(Object? obj, LspJsonReporter reporter) { - if (obj is Map<String, Object?>) { - return _canParseUri(obj, reporter, 'uri', - allowsUndefined: false, allowsNull: false); - } else { - reporter.reportError('must be of type WorkspaceSymbolLocation'); - return false; - } - } - - static WorkspaceSymbolLocation fromJson(Map<String, Object?> json) { - final uriJson = json['uri']; - final uri = Uri.parse(uriJson as String); - return WorkspaceSymbolLocation( - uri: uri, - ); - } -} - /// Server capabilities for a [WorkspaceSymbolRequest]. class WorkspaceSymbolOptions implements WorkDoneProgressOptions, ToJsonable { static const jsonHandler = LspJsonHandler( @@ -42288,6 +45444,12 @@ /// A query string to filter symbols by. Clients may send an empty string here /// to request all symbols. + /// + /// The `query`-parameter should be interpreted in a *relaxed way* as editors + /// will apply their own highlighting and scoring on the results. A good rule + /// of thumb is to match case-insensitive and to simply check that the + /// characters of *query* appear in their order in a candidate symbol. Servers + /// shouldn't use prefix, substring, or similar strict matching. final String query; /// An optional token that a server can use to report work done progress.
diff --git a/third_party/pkg/language_server_protocol/lsp_meta_model.json b/third_party/pkg/language_server_protocol/lsp_meta_model.json index 90a1126..ea5aed8 100644 --- a/third_party/pkg/language_server_protocol/lsp_meta_model.json +++ b/third_party/pkg/language_server_protocol/lsp_meta_model.json
@@ -1,10 +1,11 @@ { "metaData": { - "version": "3.17.0" + "version": "3.18.0" }, "requests": [ { "method": "textDocument/implementation", + "typeName": "ImplementationRequest", "result": { "kind": "or", "items": [ @@ -26,6 +27,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.implementation", + "serverCapability": "implementationProvider", "params": { "kind": "reference", "name": "ImplementationParams" @@ -57,6 +60,7 @@ }, { "method": "textDocument/typeDefinition", + "typeName": "TypeDefinitionRequest", "result": { "kind": "or", "items": [ @@ -78,6 +82,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.typeDefinition", + "serverCapability": "typeDefinitionProvider", "params": { "kind": "reference", "name": "TypeDefinitionParams" @@ -109,6 +115,7 @@ }, { "method": "workspace/workspaceFolders", + "typeName": "WorkspaceFoldersRequest", "result": { "kind": "or", "items": [ @@ -126,10 +133,13 @@ ] }, "messageDirection": "serverToClient", + "clientCapability": "workspace.workspaceFolders", + "serverCapability": "workspace.workspaceFolders", "documentation": "The `workspace/workspaceFolders` is sent from the server to the client to fetch the open workspace folders." }, { "method": "workspace/configuration", + "typeName": "ConfigurationRequest", "result": { "kind": "array", "element": { @@ -138,6 +148,7 @@ } }, "messageDirection": "serverToClient", + "clientCapability": "workspace.configuration", "params": { "kind": "reference", "name": "ConfigurationParams" @@ -146,6 +157,7 @@ }, { "method": "textDocument/documentColor", + "typeName": "DocumentColorRequest", "result": { "kind": "array", "element": { @@ -154,6 +166,8 @@ } }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.colorProvider", + "serverCapability": "colorProvider", "params": { "kind": "reference", "name": "DocumentColorParams" @@ -173,6 +187,7 @@ }, { "method": "textDocument/colorPresentation", + "typeName": "ColorPresentationRequest", "result": { "kind": "array", "element": { @@ -181,6 +196,8 @@ } }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.colorProvider", + "serverCapability": "colorProvider", "params": { "kind": "reference", "name": "ColorPresentationParams" @@ -205,10 +222,11 @@ } ] }, - "documentation": "A request to list all presentation for a color. The request's\nparameter is of type {@link ColorPresentationParams} the\nresponse is of type {@link ColorInformation ColorInformation[]} or a Thenable\nthat resolves to such." + "documentation": "A request to list all presentation for a color. The request's\nparameter is of type {@link ColorPresentationParams} the\nresponse is of type {@link ColorPresentation ColorPresentation[]} or a Thenable\nthat resolves to such." }, { "method": "textDocument/foldingRange", + "typeName": "FoldingRangeRequest", "result": { "kind": "or", "items": [ @@ -226,6 +244,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.foldingRange", + "serverCapability": "foldingRangeProvider", "params": { "kind": "reference", "name": "FoldingRangeParams" @@ -245,17 +265,19 @@ }, { "method": "workspace/foldingRange/refresh", + "typeName": "FoldingRangeRefreshRequest", "result": { "kind": "base", "name": "null" }, "messageDirection": "serverToClient", - "documentation": "@since 3.18.0\n@proposed", - "since": "3.18.0", - "proposed": true + "clientCapability": "workspace.foldingRange.refreshSupport", + "documentation": "A request to refresh the folding ranges in a document.\n\n@since 3.18.0", + "since": "3.18.0" }, { "method": "textDocument/declaration", + "typeName": "DeclarationRequest", "result": { "kind": "or", "items": [ @@ -277,6 +299,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.declaration", + "serverCapability": "declarationProvider", "params": { "kind": "reference", "name": "DeclarationParams" @@ -308,6 +332,7 @@ }, { "method": "textDocument/selectionRange", + "typeName": "SelectionRangeRequest", "result": { "kind": "or", "items": [ @@ -325,6 +350,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.selectionRange", + "serverCapability": "selectionRangeProvider", "params": { "kind": "reference", "name": "SelectionRangeParams" @@ -344,11 +371,13 @@ }, { "method": "window/workDoneProgress/create", + "typeName": "WorkDoneProgressCreateRequest", "result": { "kind": "base", "name": "null" }, "messageDirection": "serverToClient", + "clientCapability": "window.workDoneProgress", "params": { "kind": "reference", "name": "WorkDoneProgressCreateParams" @@ -357,6 +386,7 @@ }, { "method": "textDocument/prepareCallHierarchy", + "typeName": "CallHierarchyPrepareRequest", "result": { "kind": "or", "items": [ @@ -374,6 +404,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.callHierarchy", + "serverCapability": "callHierarchyProvider", "params": { "kind": "reference", "name": "CallHierarchyPrepareParams" @@ -387,6 +419,7 @@ }, { "method": "callHierarchy/incomingCalls", + "typeName": "CallHierarchyIncomingCallsRequest", "result": { "kind": "or", "items": [ @@ -404,6 +437,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.callHierarchy", + "serverCapability": "callHierarchyProvider", "params": { "kind": "reference", "name": "CallHierarchyIncomingCallsParams" @@ -420,6 +455,7 @@ }, { "method": "callHierarchy/outgoingCalls", + "typeName": "CallHierarchyOutgoingCallsRequest", "result": { "kind": "or", "items": [ @@ -437,6 +473,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.callHierarchy", + "serverCapability": "callHierarchyProvider", "params": { "kind": "reference", "name": "CallHierarchyOutgoingCallsParams" @@ -453,6 +491,7 @@ }, { "method": "textDocument/semanticTokens/full", + "typeName": "SemanticTokensRequest", "result": { "kind": "or", "items": [ @@ -467,6 +506,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.semanticTokens", + "serverCapability": "semanticTokensProvider", "params": { "kind": "reference", "name": "SemanticTokensParams" @@ -485,6 +526,7 @@ }, { "method": "textDocument/semanticTokens/full/delta", + "typeName": "SemanticTokensDeltaRequest", "result": { "kind": "or", "items": [ @@ -503,6 +545,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.semanticTokens.requests.full.delta", + "serverCapability": "semanticTokensProvider.full.delta", "params": { "kind": "reference", "name": "SemanticTokensDeltaParams" @@ -530,6 +574,7 @@ }, { "method": "textDocument/semanticTokens/range", + "typeName": "SemanticTokensRangeRequest", "result": { "kind": "or", "items": [ @@ -544,6 +589,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.semanticTokens.requests.range", + "serverCapability": "semanticTokensProvider.range", "params": { "kind": "reference", "name": "SemanticTokensRangeParams" @@ -558,21 +605,25 @@ }, { "method": "workspace/semanticTokens/refresh", + "typeName": "SemanticTokensRefreshRequest", "result": { "kind": "base", "name": "null" }, "messageDirection": "serverToClient", + "clientCapability": "workspace.semanticTokens.refreshSupport", "documentation": "@since 3.16.0", "since": "3.16.0" }, { "method": "window/showDocument", + "typeName": "ShowDocumentRequest", "result": { "kind": "reference", "name": "ShowDocumentResult" }, "messageDirection": "serverToClient", + "clientCapability": "window.showDocument.support", "params": { "kind": "reference", "name": "ShowDocumentParams" @@ -582,6 +633,7 @@ }, { "method": "textDocument/linkedEditingRange", + "typeName": "LinkedEditingRangeRequest", "result": { "kind": "or", "items": [ @@ -596,6 +648,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.linkedEditingRange", + "serverCapability": "linkedEditingRangeProvider", "params": { "kind": "reference", "name": "LinkedEditingRangeParams" @@ -609,6 +663,7 @@ }, { "method": "workspace/willCreateFiles", + "typeName": "WillCreateFilesRequest", "result": { "kind": "or", "items": [ @@ -623,6 +678,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "workspace.fileOperations.willCreate", + "serverCapability": "workspace.fileOperations.willCreate", "params": { "kind": "reference", "name": "CreateFilesParams" @@ -636,6 +693,7 @@ }, { "method": "workspace/willRenameFiles", + "typeName": "WillRenameFilesRequest", "result": { "kind": "or", "items": [ @@ -650,6 +708,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "workspace.fileOperations.willRename", + "serverCapability": "workspace.fileOperations.willRename", "params": { "kind": "reference", "name": "RenameFilesParams" @@ -663,6 +723,7 @@ }, { "method": "workspace/willDeleteFiles", + "typeName": "WillDeleteFilesRequest", "result": { "kind": "or", "items": [ @@ -677,6 +738,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "workspace.fileOperations.willDelete", + "serverCapability": "workspace.fileOperations.willDelete", "params": { "kind": "reference", "name": "DeleteFilesParams" @@ -690,6 +753,7 @@ }, { "method": "textDocument/moniker", + "typeName": "MonikerRequest", "result": { "kind": "or", "items": [ @@ -707,6 +771,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.moniker", + "serverCapability": "monikerProvider", "params": { "kind": "reference", "name": "MonikerParams" @@ -726,6 +792,7 @@ }, { "method": "textDocument/prepareTypeHierarchy", + "typeName": "TypeHierarchyPrepareRequest", "result": { "kind": "or", "items": [ @@ -743,6 +810,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.typeHierarchy", + "serverCapability": "typeHierarchyProvider", "params": { "kind": "reference", "name": "TypeHierarchyPrepareParams" @@ -756,6 +825,7 @@ }, { "method": "typeHierarchy/supertypes", + "typeName": "TypeHierarchySupertypesRequest", "result": { "kind": "or", "items": [ @@ -789,6 +859,7 @@ }, { "method": "typeHierarchy/subtypes", + "typeName": "TypeHierarchySubtypesRequest", "result": { "kind": "or", "items": [ @@ -822,6 +893,7 @@ }, { "method": "textDocument/inlineValue", + "typeName": "InlineValueRequest", "result": { "kind": "or", "items": [ @@ -839,6 +911,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.inlineValue", + "serverCapability": "inlineValueProvider", "params": { "kind": "reference", "name": "InlineValueParams" @@ -859,16 +933,19 @@ }, { "method": "workspace/inlineValue/refresh", + "typeName": "InlineValueRefreshRequest", "result": { "kind": "base", "name": "null" }, "messageDirection": "serverToClient", + "clientCapability": "workspace.inlineValue.refreshSupport", "documentation": "@since 3.17.0", "since": "3.17.0" }, { "method": "textDocument/inlayHint", + "typeName": "InlayHintRequest", "result": { "kind": "or", "items": [ @@ -886,6 +963,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.inlayHint", + "serverCapability": "inlayHintProvider", "params": { "kind": "reference", "name": "InlayHintParams" @@ -906,11 +985,14 @@ }, { "method": "inlayHint/resolve", + "typeName": "InlayHintResolveRequest", "result": { "kind": "reference", "name": "InlayHint" }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.inlayHint.resolveSupport", + "serverCapability": "inlayHintProvider.resolveProvider", "params": { "kind": "reference", "name": "InlayHint" @@ -920,21 +1002,26 @@ }, { "method": "workspace/inlayHint/refresh", + "typeName": "InlayHintRefreshRequest", "result": { "kind": "base", "name": "null" }, "messageDirection": "serverToClient", + "clientCapability": "workspace.inlayHint.refreshSupport", "documentation": "@since 3.17.0", "since": "3.17.0" }, { "method": "textDocument/diagnostic", + "typeName": "DocumentDiagnosticRequest", "result": { "kind": "reference", "name": "DocumentDiagnosticReport" }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.diagnostic", + "serverCapability": "diagnosticProvider", "params": { "kind": "reference", "name": "DocumentDiagnosticParams" @@ -956,11 +1043,14 @@ }, { "method": "workspace/diagnostic", + "typeName": "WorkspaceDiagnosticRequest", "result": { "kind": "reference", "name": "WorkspaceDiagnosticReport" }, "messageDirection": "clientToServer", + "clientCapability": "workspace.diagnostics", + "serverCapability": "diagnosticProvider.workspaceDiagnostics", "params": { "kind": "reference", "name": "WorkspaceDiagnosticParams" @@ -978,16 +1068,19 @@ }, { "method": "workspace/diagnostic/refresh", + "typeName": "DiagnosticRefreshRequest", "result": { "kind": "base", "name": "null" }, "messageDirection": "serverToClient", + "clientCapability": "workspace.diagnostics.refreshSupport", "documentation": "The diagnostic refresh request definition.\n\n@since 3.17.0", "since": "3.17.0" }, { "method": "textDocument/inlineCompletion", + "typeName": "InlineCompletionRequest", "result": { "kind": "or", "items": [ @@ -1009,6 +1102,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.inlineCompletion", + "serverCapability": "inlineCompletionProvider", "params": { "kind": "reference", "name": "InlineCompletionParams" @@ -1024,12 +1119,48 @@ "kind": "reference", "name": "InlineCompletionRegistrationOptions" }, - "documentation": "A request to provide inline completions in a document. The request's parameter is of\ntype {@link InlineCompletionParams}, the response is of type\n{@link InlineCompletion InlineCompletion[]} or a Thenable that resolves to such.\n\n@since 3.18.0\n@proposed", - "since": "3.18.0", - "proposed": true + "documentation": "A request to provide inline completions in a document. The request's parameter is of\ntype {@link InlineCompletionParams}, the response is of type\n{@link InlineCompletion InlineCompletion[]} or a Thenable that resolves to such.\n\n@since 3.18.0", + "since": "3.18.0" + }, + { + "method": "workspace/textDocumentContent", + "typeName": "TextDocumentContentRequest", + "result": { + "kind": "reference", + "name": "TextDocumentContentResult" + }, + "messageDirection": "clientToServer", + "clientCapability": "workspace.textDocumentContent", + "serverCapability": "workspace.textDocumentContent", + "params": { + "kind": "reference", + "name": "TextDocumentContentParams" + }, + "registrationOptions": { + "kind": "reference", + "name": "TextDocumentContentRegistrationOptions" + }, + "documentation": "The `workspace/textDocumentContent` request is sent from the client to the\nserver to request the content of a text document.\n\n@since 3.18.0", + "since": "3.18.0" + }, + { + "method": "workspace/textDocumentContent/refresh", + "typeName": "TextDocumentContentRefreshRequest", + "result": { + "kind": "base", + "name": "null" + }, + "messageDirection": "serverToClient", + "params": { + "kind": "reference", + "name": "TextDocumentContentRefreshParams" + }, + "documentation": "The `workspace/textDocumentContent` request is sent from the server to the client to refresh\nthe content of a specific text document.\n\n@since 3.18.0", + "since": "3.18.0" }, { "method": "client/registerCapability", + "typeName": "RegistrationRequest", "result": { "kind": "base", "name": "null" @@ -1043,6 +1174,7 @@ }, { "method": "client/unregisterCapability", + "typeName": "UnregistrationRequest", "result": { "kind": "base", "name": "null" @@ -1056,6 +1188,7 @@ }, { "method": "initialize", + "typeName": "InitializeRequest", "result": { "kind": "reference", "name": "InitializeResult" @@ -1073,6 +1206,7 @@ }, { "method": "shutdown", + "typeName": "ShutdownRequest", "result": { "kind": "base", "name": "null" @@ -1082,6 +1216,7 @@ }, { "method": "window/showMessageRequest", + "typeName": "ShowMessageRequest", "result": { "kind": "or", "items": [ @@ -1096,6 +1231,7 @@ ] }, "messageDirection": "serverToClient", + "clientCapability": "window.showMessage", "params": { "kind": "reference", "name": "ShowMessageRequestParams" @@ -1104,6 +1240,7 @@ }, { "method": "textDocument/willSaveWaitUntil", + "typeName": "WillSaveTextDocumentWaitUntilRequest", "result": { "kind": "or", "items": [ @@ -1121,6 +1258,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.synchronization.willSaveWaitUntil", + "serverCapability": "textDocumentSync.willSaveWaitUntil", "params": { "kind": "reference", "name": "WillSaveTextDocumentParams" @@ -1133,6 +1272,7 @@ }, { "method": "textDocument/completion", + "typeName": "CompletionRequest", "result": { "kind": "or", "items": [ @@ -1154,6 +1294,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.completion", + "serverCapability": "completionProvider", "params": { "kind": "reference", "name": "CompletionParams" @@ -1173,11 +1315,14 @@ }, { "method": "completionItem/resolve", + "typeName": "CompletionResolveRequest", "result": { "kind": "reference", "name": "CompletionItem" }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.completion.completionItem.resolveSupport", + "serverCapability": "completionProvider.resolveProvider", "params": { "kind": "reference", "name": "CompletionItem" @@ -1186,6 +1331,7 @@ }, { "method": "textDocument/hover", + "typeName": "HoverRequest", "result": { "kind": "or", "items": [ @@ -1200,6 +1346,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.hover", + "serverCapability": "hoverProvider", "params": { "kind": "reference", "name": "HoverParams" @@ -1212,6 +1360,7 @@ }, { "method": "textDocument/signatureHelp", + "typeName": "SignatureHelpRequest", "result": { "kind": "or", "items": [ @@ -1226,6 +1375,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.signatureHelp", + "serverCapability": "signatureHelpProvider", "params": { "kind": "reference", "name": "SignatureHelpParams" @@ -1237,6 +1388,7 @@ }, { "method": "textDocument/definition", + "typeName": "DefinitionRequest", "result": { "kind": "or", "items": [ @@ -1258,6 +1410,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.definition", + "serverCapability": "definitionProvider", "params": { "kind": "reference", "name": "DefinitionParams" @@ -1289,6 +1443,7 @@ }, { "method": "textDocument/references", + "typeName": "ReferencesRequest", "result": { "kind": "or", "items": [ @@ -1306,6 +1461,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.references", + "serverCapability": "referencesProvider", "params": { "kind": "reference", "name": "ReferenceParams" @@ -1325,6 +1482,7 @@ }, { "method": "textDocument/documentHighlight", + "typeName": "DocumentHighlightRequest", "result": { "kind": "or", "items": [ @@ -1342,6 +1500,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.documentHighlight", + "serverCapability": "documentHighlightProvider", "params": { "kind": "reference", "name": "DocumentHighlightParams" @@ -1361,6 +1521,7 @@ }, { "method": "textDocument/documentSymbol", + "typeName": "DocumentSymbolRequest", "result": { "kind": "or", "items": [ @@ -1385,6 +1546,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.documentSymbol", + "serverCapability": "documentSymbolProvider", "params": { "kind": "reference", "name": "DocumentSymbolParams" @@ -1416,6 +1579,7 @@ }, { "method": "textDocument/codeAction", + "typeName": "CodeActionRequest", "result": { "kind": "or", "items": [ @@ -1442,6 +1606,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.codeAction", + "serverCapability": "codeActionProvider", "params": { "kind": "reference", "name": "CodeActionParams" @@ -1470,11 +1636,14 @@ }, { "method": "codeAction/resolve", + "typeName": "CodeActionResolveRequest", "result": { "kind": "reference", "name": "CodeAction" }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.codeAction.resolveSupport", + "serverCapability": "codeActionProvider.resolveProvider", "params": { "kind": "reference", "name": "CodeAction" @@ -1483,6 +1652,7 @@ }, { "method": "workspace/symbol", + "typeName": "WorkspaceSymbolRequest", "result": { "kind": "or", "items": [ @@ -1507,6 +1677,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "workspace.symbol", + "serverCapability": "workspaceSymbolProvider", "params": { "kind": "reference", "name": "WorkspaceSymbolParams" @@ -1539,11 +1711,14 @@ }, { "method": "workspaceSymbol/resolve", + "typeName": "WorkspaceSymbolResolveRequest", "result": { "kind": "reference", "name": "WorkspaceSymbol" }, "messageDirection": "clientToServer", + "clientCapability": "workspace.symbol.resolveSupport", + "serverCapability": "workspaceSymbolProvider.resolveProvider", "params": { "kind": "reference", "name": "WorkspaceSymbol" @@ -1553,6 +1728,7 @@ }, { "method": "textDocument/codeLens", + "typeName": "CodeLensRequest", "result": { "kind": "or", "items": [ @@ -1570,6 +1746,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.codeLens", + "serverCapability": "codeLensProvider", "params": { "kind": "reference", "name": "CodeLensParams" @@ -1589,11 +1767,14 @@ }, { "method": "codeLens/resolve", + "typeName": "CodeLensResolveRequest", "result": { "kind": "reference", "name": "CodeLens" }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.codeLens.resolveSupport", + "serverCapability": "codeLensProvider.resolveProvider", "params": { "kind": "reference", "name": "CodeLens" @@ -1602,16 +1783,19 @@ }, { "method": "workspace/codeLens/refresh", + "typeName": "CodeLensRefreshRequest", "result": { "kind": "base", "name": "null" }, "messageDirection": "serverToClient", + "clientCapability": "workspace.codeLens", "documentation": "A request to refresh all code actions\n\n@since 3.16.0", "since": "3.16.0" }, { "method": "textDocument/documentLink", + "typeName": "DocumentLinkRequest", "result": { "kind": "or", "items": [ @@ -1629,6 +1813,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.documentLink", + "serverCapability": "documentLinkProvider", "params": { "kind": "reference", "name": "DocumentLinkParams" @@ -1648,11 +1834,14 @@ }, { "method": "documentLink/resolve", + "typeName": "DocumentLinkResolveRequest", "result": { "kind": "reference", "name": "DocumentLink" }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.documentLink", + "serverCapability": "documentLinkProvider.resolveProvider", "params": { "kind": "reference", "name": "DocumentLink" @@ -1661,6 +1850,7 @@ }, { "method": "textDocument/formatting", + "typeName": "DocumentFormattingRequest", "result": { "kind": "or", "items": [ @@ -1678,6 +1868,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.formatting", + "serverCapability": "documentFormattingProvider", "params": { "kind": "reference", "name": "DocumentFormattingParams" @@ -1690,6 +1882,7 @@ }, { "method": "textDocument/rangeFormatting", + "typeName": "DocumentRangeFormattingRequest", "result": { "kind": "or", "items": [ @@ -1707,6 +1900,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.rangeFormatting", + "serverCapability": "documentRangeFormattingProvider", "params": { "kind": "reference", "name": "DocumentRangeFormattingParams" @@ -1719,6 +1914,7 @@ }, { "method": "textDocument/rangesFormatting", + "typeName": "DocumentRangesFormattingRequest", "result": { "kind": "or", "items": [ @@ -1736,6 +1932,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.rangeFormatting.rangesSupport", + "serverCapability": "documentRangeFormattingProvider.rangesSupport", "params": { "kind": "reference", "name": "DocumentRangesFormattingParams" @@ -1744,12 +1942,12 @@ "kind": "reference", "name": "DocumentRangeFormattingRegistrationOptions" }, - "documentation": "A request to format ranges in a document.\n\n@since 3.18.0\n@proposed", - "since": "3.18.0", - "proposed": true + "documentation": "A request to format ranges in a document.\n\n@since 3.18.0", + "since": "3.18.0" }, { "method": "textDocument/onTypeFormatting", + "typeName": "DocumentOnTypeFormattingRequest", "result": { "kind": "or", "items": [ @@ -1767,6 +1965,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.onTypeFormatting", + "serverCapability": "documentOnTypeFormattingProvider", "params": { "kind": "reference", "name": "DocumentOnTypeFormattingParams" @@ -1779,6 +1979,7 @@ }, { "method": "textDocument/rename", + "typeName": "RenameRequest", "result": { "kind": "or", "items": [ @@ -1793,6 +1994,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.rename", + "serverCapability": "renameProvider", "params": { "kind": "reference", "name": "RenameParams" @@ -1805,6 +2008,7 @@ }, { "method": "textDocument/prepareRename", + "typeName": "PrepareRenameRequest", "result": { "kind": "or", "items": [ @@ -1819,6 +2023,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "textDocument.rename.prepareSupport", + "serverCapability": "renameProvider.prepareProvider", "params": { "kind": "reference", "name": "PrepareRenameParams" @@ -1828,6 +2034,7 @@ }, { "method": "workspace/executeCommand", + "typeName": "ExecuteCommandRequest", "result": { "kind": "or", "items": [ @@ -1842,6 +2049,8 @@ ] }, "messageDirection": "clientToServer", + "clientCapability": "workspace.executeCommand", + "serverCapability": "executeCommandProvider", "params": { "kind": "reference", "name": "ExecuteCommandParams" @@ -1854,11 +2063,13 @@ }, { "method": "workspace/applyEdit", + "typeName": "ApplyWorkspaceEditRequest", "result": { "kind": "reference", "name": "ApplyWorkspaceEditResult" }, "messageDirection": "serverToClient", + "clientCapability": "workspace.applyEdit", "params": { "kind": "reference", "name": "ApplyWorkspaceEditParams" @@ -1869,7 +2080,9 @@ "notifications": [ { "method": "workspace/didChangeWorkspaceFolders", + "typeName": "DidChangeWorkspaceFoldersNotification", "messageDirection": "clientToServer", + "serverCapability": "workspace.workspaceFolders.changeNotifications", "params": { "kind": "reference", "name": "DidChangeWorkspaceFoldersParams" @@ -1878,6 +2091,7 @@ }, { "method": "window/workDoneProgress/cancel", + "typeName": "WorkDoneProgressCancelNotification", "messageDirection": "clientToServer", "params": { "kind": "reference", @@ -1887,7 +2101,10 @@ }, { "method": "workspace/didCreateFiles", + "typeName": "DidCreateFilesNotification", "messageDirection": "clientToServer", + "clientCapability": "workspace.fileOperations.didCreate", + "serverCapability": "workspace.fileOperations.didCreate", "params": { "kind": "reference", "name": "CreateFilesParams" @@ -1901,7 +2118,10 @@ }, { "method": "workspace/didRenameFiles", + "typeName": "DidRenameFilesNotification", "messageDirection": "clientToServer", + "clientCapability": "workspace.fileOperations.didRename", + "serverCapability": "workspace.fileOperations.didRename", "params": { "kind": "reference", "name": "RenameFilesParams" @@ -1915,7 +2135,10 @@ }, { "method": "workspace/didDeleteFiles", + "typeName": "DidDeleteFilesNotification", "messageDirection": "clientToServer", + "clientCapability": "workspace.fileOperations.didDelete", + "serverCapability": "workspace.fileOperations.didDelete", "params": { "kind": "reference", "name": "DeleteFilesParams" @@ -1929,48 +2152,69 @@ }, { "method": "notebookDocument/didOpen", + "typeName": "DidOpenNotebookDocumentNotification", "messageDirection": "clientToServer", "params": { "kind": "reference", "name": "DidOpenNotebookDocumentParams" }, "registrationMethod": "notebookDocument/sync", + "registrationOptions": { + "kind": "reference", + "name": "NotebookDocumentSyncRegistrationOptions" + }, "documentation": "A notification sent when a notebook opens.\n\n@since 3.17.0", "since": "3.17.0" }, { "method": "notebookDocument/didChange", + "typeName": "DidChangeNotebookDocumentNotification", "messageDirection": "clientToServer", "params": { "kind": "reference", "name": "DidChangeNotebookDocumentParams" }, - "registrationMethod": "notebookDocument/sync" + "registrationMethod": "notebookDocument/sync", + "registrationOptions": { + "kind": "reference", + "name": "NotebookDocumentSyncRegistrationOptions" + } }, { "method": "notebookDocument/didSave", + "typeName": "DidSaveNotebookDocumentNotification", "messageDirection": "clientToServer", "params": { "kind": "reference", "name": "DidSaveNotebookDocumentParams" }, "registrationMethod": "notebookDocument/sync", + "registrationOptions": { + "kind": "reference", + "name": "NotebookDocumentSyncRegistrationOptions" + }, "documentation": "A notification sent when a notebook document is saved.\n\n@since 3.17.0", "since": "3.17.0" }, { "method": "notebookDocument/didClose", + "typeName": "DidCloseNotebookDocumentNotification", "messageDirection": "clientToServer", "params": { "kind": "reference", "name": "DidCloseNotebookDocumentParams" }, "registrationMethod": "notebookDocument/sync", + "registrationOptions": { + "kind": "reference", + "name": "NotebookDocumentSyncRegistrationOptions" + }, "documentation": "A notification sent when a notebook closes.\n\n@since 3.17.0", "since": "3.17.0" }, { "method": "initialized", + "typeName": "InitializedNotification", "messageDirection": "clientToServer", "params": { "kind": "reference", @@ -1980,12 +2224,15 @@ }, { "method": "exit", + "typeName": "ExitNotification", "messageDirection": "clientToServer", "documentation": "The exit event is sent from the client to the server to\nask the server to exit its process." }, { "method": "workspace/didChangeConfiguration", + "typeName": "DidChangeConfigurationNotification", "messageDirection": "clientToServer", + "clientCapability": "workspace.didChangeConfiguration", "params": { "kind": "reference", "name": "DidChangeConfigurationParams" @@ -1998,7 +2245,9 @@ }, { "method": "window/showMessage", + "typeName": "ShowMessageNotification", "messageDirection": "serverToClient", + "clientCapability": "window.showMessage", "params": { "kind": "reference", "name": "ShowMessageParams" @@ -2007,6 +2256,7 @@ }, { "method": "window/logMessage", + "typeName": "LogMessageNotification", "messageDirection": "serverToClient", "params": { "kind": "reference", @@ -2016,6 +2266,7 @@ }, { "method": "telemetry/event", + "typeName": "TelemetryEventNotification", "messageDirection": "serverToClient", "params": { "kind": "reference", @@ -2025,7 +2276,10 @@ }, { "method": "textDocument/didOpen", + "typeName": "DidOpenTextDocumentNotification", "messageDirection": "clientToServer", + "clientCapability": "textDocument.synchronization", + "serverCapability": "textDocumentSync.openClose", "params": { "kind": "reference", "name": "DidOpenTextDocumentParams" @@ -2038,7 +2292,10 @@ }, { "method": "textDocument/didChange", + "typeName": "DidChangeTextDocumentNotification", "messageDirection": "clientToServer", + "clientCapability": "textDocument.synchronization", + "serverCapability": "textDocumentSync", "params": { "kind": "reference", "name": "DidChangeTextDocumentParams" @@ -2051,7 +2308,10 @@ }, { "method": "textDocument/didClose", + "typeName": "DidCloseTextDocumentNotification", "messageDirection": "clientToServer", + "clientCapability": "textDocument.synchronization", + "serverCapability": "textDocumentSync.openClose", "params": { "kind": "reference", "name": "DidCloseTextDocumentParams" @@ -2064,7 +2324,10 @@ }, { "method": "textDocument/didSave", + "typeName": "DidSaveTextDocumentNotification", "messageDirection": "clientToServer", + "clientCapability": "textDocument.synchronization.didSave", + "serverCapability": "textDocumentSync.save", "params": { "kind": "reference", "name": "DidSaveTextDocumentParams" @@ -2077,7 +2340,10 @@ }, { "method": "textDocument/willSave", + "typeName": "WillSaveTextDocumentNotification", "messageDirection": "clientToServer", + "clientCapability": "textDocument.synchronization.willSave", + "serverCapability": "textDocumentSync.willSave", "params": { "kind": "reference", "name": "WillSaveTextDocumentParams" @@ -2090,7 +2356,9 @@ }, { "method": "workspace/didChangeWatchedFiles", + "typeName": "DidChangeWatchedFilesNotification", "messageDirection": "clientToServer", + "clientCapability": "workspace.didChangeWatchedFiles", "params": { "kind": "reference", "name": "DidChangeWatchedFilesParams" @@ -2103,7 +2371,9 @@ }, { "method": "textDocument/publishDiagnostics", + "typeName": "PublishDiagnosticsNotification", "messageDirection": "serverToClient", + "clientCapability": "textDocument.publishDiagnostics", "params": { "kind": "reference", "name": "PublishDiagnosticsParams" @@ -2112,6 +2382,7 @@ }, { "method": "$/setTrace", + "typeName": "SetTraceNotification", "messageDirection": "clientToServer", "params": { "kind": "reference", @@ -2120,6 +2391,7 @@ }, { "method": "$/logTrace", + "typeName": "LogTraceNotification", "messageDirection": "serverToClient", "params": { "kind": "reference", @@ -2128,6 +2400,7 @@ }, { "method": "$/cancelRequest", + "typeName": "CancelNotification", "messageDirection": "both", "params": { "kind": "reference", @@ -2136,6 +2409,7 @@ }, { "method": "$/progress", + "typeName": "ProgressNotification", "messageDirection": "both", "params": { "kind": "reference", @@ -3655,7 +3929,7 @@ "kind": "reference", "name": "Range" }, - "documentation": "The document range for which inline values should be computed." + "documentation": "The document range for which inline values information will be returned." }, { "name": "context", @@ -3663,7 +3937,7 @@ "kind": "reference", "name": "InlineValueContext" }, - "documentation": "Additional information about the context in which inline values were\nrequested." + "documentation": "Additional information about the context in which inline values information was\nrequested." } ], "mixins": [ @@ -3735,7 +4009,7 @@ "kind": "reference", "name": "Position" }, - "documentation": "The position of this hint." + "documentation": "The position of this hint.\n\nIf multiple hints have the same position, they will be shown in the order\nthey appear in the response." }, { "name": "label", @@ -4056,6 +4330,24 @@ "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": "DidChangeNotebookDocumentParams", "properties": [ { @@ -4143,9 +4435,8 @@ "name": "WorkDoneProgressParams" } ], - "documentation": "A parameter literal used in inline completion requests.\n\n@since 3.18.0\n@proposed", - "since": "3.18.0", - "proposed": true + "documentation": "A parameter literal used in inline completion requests.\n\n@since 3.18.0", + "since": "3.18.0" }, { "name": "InlineCompletionList", @@ -4162,9 +4453,8 @@ "documentation": "The inline completion items" } ], - "documentation": "Represents a collection of {@link InlineCompletionItem inline completion items} to be presented in the editor.\n\n@since 3.18.0\n@proposed", - "since": "3.18.0", - "proposed": true + "documentation": "Represents a collection of {@link InlineCompletionItem inline completion items} to be presented in the editor.\n\n@since 3.18.0", + "since": "3.18.0" }, { "name": "InlineCompletionItem", @@ -4214,9 +4504,8 @@ "documentation": "An optional {@link Command} that is executed *after* inserting this completion." } ], - "documentation": "An inline completion item represents a text snippet that is proposed inline to complete text that is being typed.\n\n@since 3.18.0\n@proposed", - "since": "3.18.0", - "proposed": true + "documentation": "An inline completion item represents a text snippet that is proposed inline to complete text that is being typed.\n\n@since 3.18.0", + "since": "3.18.0" }, { "name": "InlineCompletionRegistrationOptions", @@ -4237,9 +4526,71 @@ "name": "StaticRegistrationOptions" } ], - "documentation": "Inline completion options used during static or dynamic registration.\n\n@since 3.18.0\n@proposed", - "since": "3.18.0", - "proposed": true + "documentation": "Inline completion options used during static or dynamic registration.\n\n@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "TextDocumentContentParams", + "properties": [ + { + "name": "uri", + "type": { + "kind": "base", + "name": "DocumentUri" + }, + "documentation": "The uri of the text document." + } + ], + "documentation": "Parameters for the `workspace/textDocumentContent` request.\n\n@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "TextDocumentContentResult", + "properties": [ + { + "name": "text", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The text content of the text document. Please note, that the content of\nany subsequent open notifications for the text document might differ\nfrom the returned content due to whitespace and line ending\nnormalizations done on the client" + } + ], + "documentation": "Result of the `workspace/textDocumentContent` request.\n\n@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "TextDocumentContentRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentContentOptions" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "StaticRegistrationOptions" + } + ], + "documentation": "Text document content provider registration options.\n\n@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "TextDocumentContentRefreshParams", + "properties": [ + { + "name": "uri", + "type": { + "kind": "base", + "name": "DocumentUri" + }, + "documentation": "The uri of the text document to refresh." + } + ], + "documentation": "Parameters for the `workspace/textDocumentContent/refresh` request.\n\n@since 3.18.0", + "since": "3.18.0" }, { "name": "RegistrationParams", @@ -4299,28 +4650,8 @@ { "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." - } - ] - } + "kind": "reference", + "name": "ServerInfo" }, "optional": true, "documentation": "Information about the server.\n\n@since 3.15.0", @@ -4954,96 +5285,24 @@ { "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" - } - ] - } + "kind": "reference", + "name": "CompletionItemDefaults" }, "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", + "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 rules for combining these are\ndefined by `applyKinds` (if the client supports it), defaulting to\nApplyKind.Replace.\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": "applyKind", + "type": { + "kind": "reference", + "name": "CompletionItemApplyKinds" + }, + "optional": true, + "documentation": "Specifies how fields from a completion item should be combined with those\nfrom `completionList.itemDefaults`.\n\nIf unspecified, all fields will be treated as ApplyKind.Replace.\n\nIf a field's value is ApplyKind.Replace, the value from a completion item\n(if provided and not `null`) will always be used instead of the value\nfrom `completionItem.itemDefaults`.\n\nIf a field's value is ApplyKind.Merge, the values will be merged using\nthe rules defined against each field below.\n\nServers are only allowed to return `applyKind` if the client\nsignals support for this via the `completionList.applyKindSupport`\ncapability.\n\n@since 3.18.0", + "since": "3.18.0" + }, + { "name": "items", "type": { "kind": "array", @@ -5197,11 +5456,20 @@ { "name": "activeParameter", "type": { - "kind": "base", - "name": "uinteger" + "kind": "or", + "items": [ + { + "kind": "base", + "name": "uinteger" + }, + { + "kind": "base", + "name": "null" + } + ] }, "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": "The active parameter of the active signature.\n\nIf `null`, no parameter of the signature is active (for example a named\nargument that does not match any declared parameters). This is only valid\nif the client specifies the client capability\n`textDocument.signatureHelp.noActiveParameterSupport === true`\n\nIf omitted or the value lies outside the range of\n`signatures[activeSignature].parameters` defaults to 0 if the active\nsignature has parameters.\n\nIf the active signature has no parameters it is ignored.\n\nIn future version of the protocol this property might become\nmandatory (but still nullable) to better express the active parameter if\nthe active signature does have any.\n\nSince version 3.16.0 the `SignatureInformation` itself provides a\n`activeParameter` property and it should be used instead of this one." } ], "documentation": "Signature help represents the signature of something\ncallable. There can be multiple signature but only one\nactive and only one active parameter." @@ -5563,6 +5831,16 @@ "documentation": "Title of the command, like `save`." }, { + "name": "tooltip", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "An optional tooltip.\n\n@since 3.18.0", + "since": "3.18.0" + }, + { "name": "command", "type": { "kind": "base", @@ -5630,19 +5908,8 @@ { "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." - } - ] - } + "kind": "reference", + "name": "CodeActionDisabled" }, "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", @@ -5675,6 +5942,19 @@ "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" + }, + { + "name": "tags", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "CodeActionTag" + } + }, + "optional": true, + "documentation": "Tags for this code action.\n\n@since 3.18.0 - proposed", + "since": "3.18.0 - proposed" } ], "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." @@ -5703,7 +5983,7 @@ "kind": "base", "name": "string" }, - "documentation": "A query string to filter symbols by. Clients may send an empty\nstring here to request all symbols." + "documentation": "A query string to filter symbols by. Clients may send an empty\nstring here to request all symbols.\n\nThe `query`-parameter should be interpreted in a *relaxed way* as editors\nwill apply their own highlighting and scoring on the results. A good rule\nof thumb is to match case-insensitive and to simply check that the\ncharacters of *query* appear in their order in a candidate symbol.\nServers shouldn't use prefix, substring, or similar strict matching." } ], "mixins": [ @@ -5731,18 +6011,8 @@ "name": "Location" }, { - "kind": "literal", - "value": { - "properties": [ - { - "name": "uri", - "type": { - "kind": "base", - "name": "DocumentUri" - } - } - ] - } + "kind": "reference", + "name": "LocationUriOnly" } ] }, @@ -6061,9 +6331,8 @@ "name": "WorkDoneProgressParams" } ], - "documentation": "The parameters of a {@link DocumentRangesFormattingRequest}.\n\n@since 3.18.0\n@proposed", - "since": "3.18.0", - "proposed": true + "documentation": "The parameters of a {@link DocumentRangesFormattingRequest}.\n\n@since 3.18.0", + "since": "3.18.0" }, { "name": "DocumentOnTypeFormattingParams", @@ -6122,22 +6391,6 @@ "name": "RenameParams", "properties": [ { - "name": "textDocument", - "type": { - "kind": "reference", - "name": "TextDocumentIdentifier" - }, - "documentation": "The document to rename." - }, - { - "name": "position", - "type": { - "kind": "reference", - "name": "Position" - }, - "documentation": "The position at which this request was sent." - }, - { "name": "newName", "type": { "kind": "base", @@ -6146,6 +6399,12 @@ "documentation": "The new name of the symbol. If the given name is not valid the\nrequest must return a {@link ResponseError} with an\nappropriate message set." } ], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentPositionParams" + } + ], "mixins": [ { "kind": "reference", @@ -6247,6 +6506,16 @@ "name": "WorkspaceEdit" }, "documentation": "The edits to apply." + }, + { + "name": "metadata", + "type": { + "kind": "reference", + "name": "WorkspaceEditMetadata" + }, + "optional": true, + "documentation": "Additional data about the edit.\n\n@since 3.18.0", + "since": "3.18.0" } ], "documentation": "The parameters passed via an apply workspace edit request." @@ -6398,7 +6667,7 @@ "name": "value", "type": { "kind": "reference", - "name": "TraceValues" + "name": "TraceValue" } } ] @@ -6754,7 +7023,7 @@ "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." + "documentation": "Line position in a document (zero-based)." }, { "name": "character", @@ -6762,7 +7031,7 @@ "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": "Character offset on a line in a document (zero-based).\n\nThe meaning of this offset is determined by the negotiated\n`PositionEncodingKind`." } ], "documentation": "Position in a text document expressed as zero-based line and character\noffset. Prior to 3.17 the offsets were always based on a UTF-16 string\nrepresentation. So a string of the form `a𐐀b` the character offset of the\ncharacter `a` is 0, the character offset of `𐐀` is 1 and the character\noffset of b is 3 since `𐐀` is represented using two code units in UTF-16.\nSince 3.17 clients and servers can agree on a different string encoding\nrepresentation (e.g. UTF-8). The client announces it's supported encoding\nvia the client capability [`general.positionEncodings`](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#clientCapabilities).\nThe value is an array of position encodings the client supports, with\ndecreasing preference (e.g. the encoding at index `0` is the most preferred\none). To stay backwards compatible the only mandatory encoding is UTF-16\nrepresented via the string `utf-16`. The server can pick one of the\nencodings offered by the client and signals that encoding back to the\nclient via the initialize result's property\n[`capabilities.positionEncoding`](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#serverCapabilities). If the string value\n`utf-16` is missing from the client's capability `general.positionEncodings`\nservers can safely assume that the client supports UTF-16. If the server\nomits the position encoding in its initialize result the encoding defaults\nto the string value `utf-16`. Implementation considerations: since the\nconversion from one encoding into another requires the content of the\nfile / line the conversion is best done where the file is read which is\nusually on the server side.\n\nPositions are line end character agnostic. So you can not specify a position\nthat denotes `\\r|\\n` or `\\n|` where `|` represents the character offset.\n\n@since 3.17.0 - support for negotiated position encoding.", @@ -6831,20 +7100,8 @@ "name": "boolean" }, { - "kind": "literal", - "value": { - "properties": [ - { - "name": "delta", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The server supports deltas for full documents." - } - ] - } + "kind": "reference", + "name": "SemanticTokensFullDelta" } ] }, @@ -6946,12 +7203,20 @@ { "kind": "reference", "name": "AnnotatedTextEdit" + }, + { + "kind": "reference", + "name": "SnippetTextEdit" } ] } }, - "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": "The edits to be applied.\n\n@since 3.16.0 - support for AnnotatedTextEdit. This is guarded using a\nclient capability.\n\n@since 3.18.0 - support for SnippetTextEdit. This is guarded using a\nclient capability.", + "since": "3.18.0 - support for SnippetTextEdit. This is guarded using a\nclient capability.", + "sinceTags": [ + "3.16.0 - support for AnnotatedTextEdit. This is guarded using a\nclient capability.", + "3.18.0 - support for SnippetTextEdit. 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." @@ -7235,7 +7500,7 @@ "documentation": "The text of the inline value." } ], - "documentation": "Provide inline value as text.\n\n@since 3.17.0", + "documentation": "Returns inline value information as the complete text to be shown.\n\n@since 3.17.0", "since": "3.17.0" }, { @@ -7247,7 +7512,7 @@ "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." + "documentation": "The document range for which the inline value applies.\n\nThe range could be used to extract the variable name\nfrom the underlying document." }, { "name": "variableName", @@ -7267,7 +7532,7 @@ "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", + "documentation": "To compute inline value through a variable lookup.\n\nIf only a range is specified, the variable name should\nbe extracted from the underlying document.\n\nAn optional variable name could be used to lookup instead\nof the extracted name.\n\n@since 3.17.0", "since": "3.17.0" }, { @@ -7279,7 +7544,7 @@ "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." + "documentation": "The document range for which the inline value applies.\n\nThe range could be used to extract the evaluatable expression\nfrom the underlying document." }, { "name": "expression", @@ -7288,10 +7553,10 @@ "name": "string" }, "optional": true, - "documentation": "If specified the expression overrides the extracted expression." + "documentation": "If specified the expression could be evaluated instead." } ], - "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", + "documentation": "To compute an inline value through an expression evaluation.\n\nIf only a range is specified, the expression should be\nextracted from the underlying document.\n\nAn optional expression could be evaluated instead of\nthe extracted expression.\n\n@since 3.17.0", "since": "3.17.0" }, { @@ -7663,8 +7928,8 @@ { "name": "languageId", "type": { - "kind": "base", - "name": "string" + "kind": "reference", + "name": "LanguageKind" }, "documentation": "The text document's language identifier." }, @@ -7688,6 +7953,42 @@ "documentation": "An item to transfer a text document from the client to the\nserver." }, { + "name": "NotebookDocumentSyncOptions", + "properties": [ + { + "name": "notebookSelector", + "type": { + "kind": "array", + "element": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "NotebookDocumentFilterWithNotebook" + }, + { + "kind": "reference", + "name": "NotebookDocumentFilterWithCells" + } + ] + } + }, + "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": "VersionedNotebookDocumentIdentifier", "properties": [ { @@ -7725,99 +8026,8 @@ { "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." - } - ] - } + "kind": "reference", + "name": "NotebookDocumentCellChanges" }, "optional": true, "documentation": "Changes to cells" @@ -7862,9 +8072,8 @@ "documentation": "Provides information about the currently selected item in the autocomplete widget if it is visible." } ], - "documentation": "Provides information about the context in which an inline completion was requested.\n\n@since 3.18.0\n@proposed", - "since": "3.18.0", - "proposed": true + "documentation": "Provides information about the context in which an inline completion was requested.\n\n@since 3.18.0", + "since": "3.18.0" }, { "name": "StringValue", @@ -7886,9 +8095,8 @@ "documentation": "The snippet string." } ], - "documentation": "A string value used as a snippet is a template which allows to insert text\nand to control the editor cursor when insertion happens.\n\nA snippet can define tab stops and placeholders with `$1`, `$2`\nand `${3:foo}`. `$0` defines the final tab stop, it defaults to\nthe end of the snippet. Variables are defined with `$name` and\n`${name:default value}`.\n\n@since 3.18.0\n@proposed", - "since": "3.18.0", - "proposed": true + "documentation": "A string value used as a snippet is a template which allows to insert text\nand to control the editor cursor when insertion happens.\n\nA snippet can define tab stops and placeholders with `$1`, `$2`\nand `${3:foo}`. `$0` defines the final tab stop, it defaults to\nthe end of the snippet. Variables are defined with `$name` and\n`${name:default value}`.\n\n@since 3.18.0", + "since": "3.18.0" }, { "name": "InlineCompletionOptions", @@ -7899,9 +8107,26 @@ } ], "properties": [], - "documentation": "Inline completion options used during static registration.\n\n@since 3.18.0\n@proposed", - "since": "3.18.0", - "proposed": true + "documentation": "Inline completion options used during static registration.\n\n@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "TextDocumentContentOptions", + "properties": [ + { + "name": "schemes", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "documentation": "The schemes for which the server provides content." + } + ], + "documentation": "Text document content provider options.\n\n@since 3.18.0", + "since": "3.18.0" }, { "name": "Registration", @@ -7979,28 +8204,8 @@ { "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." - } - ] - } + "kind": "reference", + "name": "ClientInfo" }, "optional": true, "documentation": "Information about the client\n\n@since 3.15.0", @@ -8074,7 +8279,7 @@ "name": "trace", "type": { "kind": "reference", - "name": "TraceValues" + "name": "TraceValue" }, "optional": true, "documentation": "The initial trace setting. If omitted trace is disabled ('off')." @@ -8723,38 +8928,14 @@ ] }, "optional": true, - "documentation": "Inline completion options used during static registration.\n\n@since 3.18.0\n@proposed", - "since": "3.18.0", - "proposed": true + "documentation": "Inline completion options used during static registration.\n\n@since 3.18.0", + "since": "3.18.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" - } - ] - } + "kind": "reference", + "name": "WorkspaceOptions" }, "optional": true, "documentation": "Workspace specific server capabilities." @@ -8772,6 +8953,34 @@ "documentation": "Defines the capabilities provided by a language\nserver." }, { + "name": "ServerInfo", + "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." + } + ], + "documentation": "Information about the server\n\n@since 3.15.0\n@since 3.18.0 ServerInfo type name added.", + "since": "3.18.0 ServerInfo type name added.", + "sinceTags": [ + "3.15.0", + "3.18.0 ServerInfo type name added." + ] + }, + { "name": "VersionedTextDocumentIdentifier", "properties": [ { @@ -8869,7 +9078,7 @@ "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." + "documentation": "The diagnostic's severity. To avoid interpretation mismatches when a\nserver is used with different clients it is highly recommended that servers\nalways provide a severity value." }, { "name": "code", @@ -8911,10 +9120,20 @@ { "name": "message", "type": { - "kind": "base", - "name": "string" + "kind": "or", + "items": [ + { + "kind": "base", + "name": "string" + }, + { + "kind": "reference", + "name": "MarkupContent" + } + ] }, - "documentation": "The diagnostic's message. It usually appears in the user interface" + "documentation": "The diagnostic's message. It usually appears in the user interface.\n\n@since 3.18.0 - support for MarkupContent. This is guarded by the client\ncapability `textDocument.diagnostic.markupMessageSupport`.", + "since": "3.18.0 - support for MarkupContent. This is guarded by the client\ncapability `textDocument.diagnostic.markupMessageSupport`." }, { "name": "tags", @@ -9034,6 +9253,102 @@ "since": "3.16.0" }, { + "name": "CompletionItemDefaults", + "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": "reference", + "name": "EditRangeWithInsertReplace" + } + ] + }, + "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" + } + ], + "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 rules for combining these are\ndefined by `applyKinds` (if the client supports it), defaulting to\nApplyKind.Replace.\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": "CompletionItemApplyKinds", + "properties": [ + { + "name": "commitCharacters", + "type": { + "kind": "reference", + "name": "ApplyKind" + }, + "optional": true, + "documentation": "Specifies whether commitCharacters on a completion will replace or be\nmerged with those in `completionList.itemDefaults.commitCharacters`.\n\nIf ApplyKind.Replace, the commit characters from the completion item will\nalways be used unless not provided, in which case those from\n`completionList.itemDefaults.commitCharacters` will be used. An\nempty list can be used if a completion item does not have any commit\ncharacters and also should not use those from\n`completionList.itemDefaults.commitCharacters`.\n\nIf ApplyKind.Merge the commitCharacters for the completion will be the\nunion of all values in both `completionList.itemDefaults.commitCharacters`\nand the completion's own `commitCharacters`.\n\n@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "data", + "type": { + "kind": "reference", + "name": "ApplyKind" + }, + "optional": true, + "documentation": "Specifies whether the `data` field on a completion will replace or\nbe merged with data from `completionList.itemDefaults.data`.\n\nIf ApplyKind.Replace, the data from the completion item will be used if\nprovided (and not `null`), otherwise\n`completionList.itemDefaults.data` will be used. An empty object can\nbe used if a completion item does not have any data but also should\nnot use the value from `completionList.itemDefaults.data`.\n\nIf ApplyKind.Merge, a shallow merge will be performed between\n`completionList.itemDefaults.data` and the completion's own data\nusing the following rules:\n\n- If a completion's `data` field is not provided (or `null`), the\n entire `data` field from `completionList.itemDefaults.data` will be\n used as-is.\n- If a completion's `data` field is provided, each field will\n overwrite the field of the same name in\n `completionList.itemDefaults.data` but no merging of nested fields\n within that value will occur.\n\n@since 3.18.0", + "since": "3.18.0" + } + ], + "documentation": "Specifies how fields from a completion item should be combined with those\nfrom `completionList.itemDefaults`.\n\nIf unspecified, all fields will be treated as ApplyKind.Replace.\n\nIf a field's value is ApplyKind.Replace, the value from a completion item (if\nprovided and not `null`) will always be used instead of the value from\n`completionItem.itemDefaults`.\n\nIf a field's value is ApplyKind.Merge, the values will be merged using the rules\ndefined against each field below.\n\nServers are only allowed to return `applyKind` if the client\nsignals support for this via the `completionList.applyKindSupport`\ncapability.\n\n@since 3.18.0", + "since": "3.18.0" + }, + { "name": "CompletionOptions", "properties": [ { @@ -9073,21 +9388,8 @@ { "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" - } - ] - } + "kind": "reference", + "name": "ServerCompletionItemOptions" }, "optional": true, "documentation": "The server supports the following `CompletionItem` specific\ncapabilities.\n\n@since 3.17.0", @@ -9198,11 +9500,20 @@ { "name": "activeParameter", "type": { - "kind": "base", - "name": "uinteger" + "kind": "or", + "items": [ + { + "kind": "base", + "name": "uinteger" + }, + { + "kind": "base", + "name": "null" + } + ] }, "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", + "documentation": "The index of the active parameter.\n\nIf `null`, no parameter of the signature is active (for example a named\nargument that does not match any declared parameters). This is only valid\nif the client specifies the client capability\n`textDocument.signatureHelp.noActiveParameterSupport === true`\n\nIf provided (or `null`), this is used in place of\n`SignatureHelp.activeParameter`.\n\n@since 3.16.0", "since": "3.16.0" } ], @@ -9398,6 +9709,21 @@ "documentation": "Contains additional diagnostic information about the context in which\na {@link CodeActionProvider.provideCodeActions code action} is run." }, { + "name": "CodeActionDisabled", + "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." + } + ], + "documentation": "Captures why the code action is currently disabled.\n\n@since 3.18.0", + "since": "3.18.0" + }, + { "name": "CodeActionOptions", "properties": [ { @@ -9413,6 +9739,19 @@ "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": "documentation", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "CodeActionKindDocumentation" + } + }, + "optional": true, + "documentation": "Static documentation for a class of code actions.\n\nDocumentation from the provider should be shown in the code actions menu if either:\n\n- Code actions of `kind` are requested by the editor. In this case, the editor will show the documentation that\n most closely matches the requested code action kind. For example, if a provider has documentation for\n both `Refactor` and `RefactorExtract`, when the user requests code actions for `RefactorExtract`,\n the editor will use the documentation for `RefactorExtract` instead of the documentation for `Refactor`.\n\n- Any code actions of `kind` are returned by the provider.\n\nAt most one documentation entry should be shown per provider.\n\n@since 3.18.0", + "since": "3.18.0" + }, + { "name": "resolveProvider", "type": { "kind": "base", @@ -9432,6 +9771,20 @@ "documentation": "Provider options for a {@link CodeActionRequest}." }, { + "name": "LocationUriOnly", + "properties": [ + { + "name": "uri", + "type": { + "kind": "base", + "name": "DocumentUri" + } + } + ], + "documentation": "Location with only uri and does not include range.\n\n@since 3.18.0", + "since": "3.18.0" + }, + { "name": "WorkspaceSymbolOptions", "properties": [ { @@ -9568,9 +9921,8 @@ "name": "boolean" }, "optional": true, - "documentation": "Whether the server supports formatting multiple ranges at once.\n\n@since 3.18.0\n@proposed", - "since": "3.18.0", - "proposed": true + "documentation": "Whether the server supports formatting multiple ranges at once.\n\n@since 3.18.0", + "since": "3.18.0" } ], "mixins": [ @@ -9630,6 +9982,41 @@ "documentation": "Provider options for a {@link RenameRequest}." }, { + "name": "PrepareRenamePlaceholder", + "properties": [ + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + } + }, + { + "name": "placeholder", + "type": { + "kind": "base", + "name": "string" + } + } + ], + "documentation": "@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "PrepareRenameDefaultBehavior", + "properties": [ + { + "name": "defaultBehavior", + "type": { + "kind": "base", + "name": "boolean" + } + } + ], + "documentation": "@since 3.18.0", + "since": "3.18.0" + }, + { "name": "ExecuteCommandOptions", "properties": [ { @@ -9653,6 +10040,22 @@ "documentation": "The server capabilities of a {@link ExecuteCommandRequest}." }, { + "name": "WorkspaceEditMetadata", + "properties": [ + { + "name": "isRefactoring", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Signal to the editor that this edit is a refactoring." + } + ], + "documentation": "Additional data about a workspace edit.\n\n@since 3.18.0", + "since": "3.18.0" + }, + { "name": "SemanticTokensLegend", "properties": [ { @@ -9682,6 +10085,22 @@ "since": "3.16.0" }, { + "name": "SemanticTokensFullDelta", + "properties": [ + { + "name": "delta", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The server supports deltas for full documents." + } + ], + "documentation": "Semantic tokens options to support deltas for full documents\n\n@since 3.18.0", + "since": "3.18.0" + }, + { "name": "OptionalVersionedTextDocumentIdentifier", "properties": [ { @@ -9732,6 +10151,38 @@ "since": "3.16.0." }, { + "name": "SnippetTextEdit", + "properties": [ + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range of the text document to be manipulated." + }, + { + "name": "snippet", + "type": { + "kind": "reference", + "name": "StringValue" + }, + "documentation": "The snippet to be inserted." + }, + { + "name": "annotationId", + "type": { + "kind": "reference", + "name": "ChangeAnnotationIdentifier" + }, + "optional": true, + "documentation": "The actual identifier of the snippet edit." + } + ], + "documentation": "An interactive text edit.\n\n@since 3.18.0", + "since": "3.18.0" + }, + { "name": "ResourceOperation", "properties": [ { @@ -9836,7 +10287,7 @@ "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`)" + "documentation": "The glob pattern to match. Glob patterns can have the following syntax:\n- `*` to match zero 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", @@ -9978,23 +10429,24 @@ "since": "3.17.0" }, { - "name": "NotebookCellArrayChange", + "name": "NotebookDocumentFilterWithNotebook", "properties": [ { - "name": "start", + "name": "notebook", "type": { - "kind": "base", - "name": "uinteger" + "kind": "or", + "items": [ + { + "kind": "base", + "name": "string" + }, + { + "kind": "reference", + "name": "NotebookDocumentFilter" + } + ] }, - "documentation": "The start oftest of the cell that changed." - }, - { - "name": "deleteCount", - "type": { - "kind": "base", - "name": "uinteger" - }, - "documentation": "The deleted cells" + "documentation": "The notebook to be synced If a string\nvalue is provided it matches against the\nnotebook type. '*' matches every notebook." }, { "name": "cells", @@ -10002,15 +10454,91 @@ "kind": "array", "element": { "kind": "reference", + "name": "NotebookCellLanguage" + } + }, + "optional": true, + "documentation": "The cells of the matching notebook to be synced." + } + ], + "documentation": "@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "NotebookDocumentFilterWithCells", + "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": "reference", + "name": "NotebookCellLanguage" + } + }, + "documentation": "The cells of the matching notebook to be synced." + } + ], + "documentation": "@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "NotebookDocumentCellChanges", + "properties": [ + { + "name": "structure", + "type": { + "kind": "reference", + "name": "NotebookDocumentCellChangeStructure" + }, + "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": "The new cells, if any" + "documentation": "Changes to notebook cells properties like its\nkind, execution summary or metadata." + }, + { + "name": "textContent", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "NotebookDocumentCellContentChanges" + } + }, + "optional": true, + "documentation": "Changes to the text content of notebook cells." } ], - "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" + "documentation": "Cell changes to a notebook document.\n\n@since 3.18.0", + "since": "3.18.0" }, { "name": "SelectedCompletionInfo", @@ -10032,9 +10560,36 @@ "documentation": "The text the range will be replaced with if this completion is accepted." } ], - "documentation": "Describes the currently selected completion item.\n\n@since 3.18.0\n@proposed", - "since": "3.18.0", - "proposed": true + "documentation": "Describes the currently selected completion item.\n\n@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "ClientInfo", + "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." + } + ], + "documentation": "Information about the client\n\n@since 3.15.0\n@since 3.18.0 ClientInfo type name added.", + "since": "3.18.0 ClientInfo type name added.", + "sinceTags": [ + "3.15.0", + "3.18.0 ClientInfo type name added." + ] }, { "name": "ClientCapabilities", @@ -10158,235 +10713,98 @@ ] }, { - "name": "NotebookDocumentSyncOptions", + "name": "WorkspaceOptions", "properties": [ { - "name": "notebookSelector", + "name": "workspaceFolders", "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" + "kind": "reference", + "name": "WorkspaceFoldersServerCapabilities" }, "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" + "documentation": "The server supports workspace folder.\n\n@since 3.6.0", + "since": "3.6.0" }, { - "name": "changeNotifications", + "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" + }, + { + "name": "textDocumentContent", "type": { "kind": "or", "items": [ { - "kind": "base", - "name": "string" + "kind": "reference", + "name": "TextDocumentContentOptions" }, { - "kind": "base", - "name": "boolean" + "kind": "reference", + "name": "TextDocumentContentRegistrationOptions" } ] }, "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": "The server supports the `workspace/textDocumentContent` request.\n\n@since 3.18.0", + "since": "3.18.0" } ], - "documentation": "Options for notifications/requests for user operations on files.\n\n@since 3.16.0", - "since": "3.16.0" + "documentation": "Defines workspace specific capabilities of the server.\n\n@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "TextDocumentContentChangePartial", + "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.", + "deprecated": "use range instead." + }, + { + "name": "text", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The new text for the provided range." + } + ], + "documentation": "@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "TextDocumentContentChangeWholeDocument", + "properties": [ + { + "name": "text", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The new text of the whole document." + } + ], + "documentation": "@since 3.18.0", + "since": "3.18.0" }, { "name": "CodeDescription", @@ -10426,6 +10844,66 @@ "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": "EditRangeWithInsertReplace", + "properties": [ + { + "name": "insert", + "type": { + "kind": "reference", + "name": "Range" + } + }, + { + "name": "replace", + "type": { + "kind": "reference", + "name": "Range" + } + } + ], + "documentation": "Edit range variant that includes ranges for insert and replace operations.\n\n@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "ServerCompletionItemOptions", + "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" + } + ], + "documentation": "@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "MarkedStringWithLanguage", + "properties": [ + { + "name": "language", + "type": { + "kind": "base", + "name": "string" + } + }, + { + "name": "value", + "type": { + "kind": "base", + "name": "string" + } + } + ], + "documentation": "@since 3.18.0\n@deprecated use MarkupContent instead.", + "since": "3.18.0", + "deprecated": "use MarkupContent instead." + }, + { "name": "ParameterInformation", "properties": [ { @@ -10452,7 +10930,7 @@ } ] }, - "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`." + "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\nTo avoid ambiguities a server should use the [start, end] offset value instead of using\na substring. Whether a client support this is controlled via `labelOffsetSupport` client\ncapability.\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", @@ -10476,6 +10954,29 @@ "documentation": "Represents a parameter of a callable-signature. A parameter can\nhave a label and a doc-comment." }, { + "name": "CodeActionKindDocumentation", + "properties": [ + { + "name": "kind", + "type": { + "kind": "reference", + "name": "CodeActionKind" + }, + "documentation": "The kind of the code action being documented.\n\nIf the kind is generic, such as `CodeActionKind.Refactor`, the documentation will be shown whenever any\nrefactorings are returned. If the kind if more specific, such as `CodeActionKind.RefactorExtract`, the\ndocumentation will only be shown when extract refactoring code actions are returned." + }, + { + "name": "command", + "type": { + "kind": "reference", + "name": "Command" + }, + "documentation": "Command that is ued to display the documentation to the user.\n\nThe title of this documentation code action is taken from {@linkcode Command.title}" + } + ], + "documentation": "Documentation for a class of code actions.\n\n@since 3.18.0", + "since": "3.18.0" + }, + { "name": "NotebookCellTextDocumentFilter", "properties": [ { @@ -10547,6 +11048,83 @@ ] }, { + "name": "NotebookCellLanguage", + "properties": [ + { + "name": "language", + "type": { + "kind": "base", + "name": "string" + } + } + ], + "documentation": "@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "NotebookDocumentCellChangeStructure", + "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." + } + ], + "documentation": "Structural changes to cells in a notebook document.\n\n@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "NotebookDocumentCellContentChanges", + "properties": [ + { + "name": "document", + "type": { + "kind": "reference", + "name": "VersionedTextDocumentIdentifier" + } + }, + { + "name": "changes", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "TextDocumentContentChangeEvent" + } + } + } + ], + "documentation": "Content changes to a cell in a notebook document.\n\n@since 3.18.0", + "since": "3.18.0" + }, + { "name": "WorkspaceClientCapabilities", "properties": [ { @@ -10689,9 +11267,18 @@ "name": "FoldingRangeWorkspaceClientCapabilities" }, "optional": true, - "documentation": "Capabilities specific to the folding range requests scoped to the workspace.\n\n@since 3.18.0\n@proposed", - "since": "3.18.0", - "proposed": true + "documentation": "Capabilities specific to the folding range requests scoped to the workspace.\n\n@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "textDocumentContent", + "type": { + "kind": "reference", + "name": "TextDocumentContentClientCapabilities" + }, + "optional": true, + "documentation": "Capabilities specific to the `workspace/textDocumentContent` request.\n\n@since 3.18.0", + "since": "3.18.0" } ], "documentation": "Workspace specific client capabilities." @@ -10709,6 +11296,16 @@ "documentation": "Defines which synchronization capabilities the client supports." }, { + "name": "filters", + "type": { + "kind": "reference", + "name": "TextDocumentFilterClientCapabilities" + }, + "optional": true, + "documentation": "Defines which filters the client supports.\n\n@since 3.18.0", + "since": "3.18.0" + }, + { "name": "completion", "type": { "kind": "reference", @@ -10990,9 +11587,8 @@ "name": "InlineCompletionClientCapabilities" }, "optional": true, - "documentation": "Client capabilities specific to inline completions.\n\n@since 3.18.0\n@proposed", - "since": "3.18.0", - "proposed": true + "documentation": "Client capabilities specific to inline completions.\n\n@since 3.18.0", + "since": "3.18.0" } ], "documentation": "Text document specific client capabilities." @@ -11054,30 +11650,8 @@ { "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`" - } - ] - } + "kind": "reference", + "name": "StaleRequestSupportOptions" }, "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", @@ -11121,6 +11695,99 @@ "since": "3.16.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": "RelativePattern", "properties": [ { @@ -11153,6 +11820,242 @@ "since": "3.17.0" }, { + "name": "TextDocumentFilterLanguage", + "properties": [ + { + "name": "language", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A language id, like `typescript`." + }, + { + "name": "scheme", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A Uri {@link Uri.scheme scheme}, like `file` or `untitled`." + }, + { + "name": "pattern", + "type": { + "kind": "reference", + "name": "GlobPattern" + }, + "optional": true, + "documentation": "A glob pattern, like **/*.{ts,js}. See TextDocumentFilter for examples.\n\n@since 3.18.0 - support for relative patterns. Whether clients support\nrelative patterns depends on the client capability\n`textDocuments.filters.relativePatternSupport`.", + "since": "3.18.0 - support for relative patterns. Whether clients support\nrelative patterns depends on the client capability\n`textDocuments.filters.relativePatternSupport`." + } + ], + "documentation": "A document filter where `language` is required field.\n\n@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "TextDocumentFilterScheme", + "properties": [ + { + "name": "language", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A language id, like `typescript`." + }, + { + "name": "scheme", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A Uri {@link Uri.scheme scheme}, like `file` or `untitled`." + }, + { + "name": "pattern", + "type": { + "kind": "reference", + "name": "GlobPattern" + }, + "optional": true, + "documentation": "A glob pattern, like **/*.{ts,js}. See TextDocumentFilter for examples.\n\n@since 3.18.0 - support for relative patterns. Whether clients support\nrelative patterns depends on the client capability\n`textDocuments.filters.relativePatternSupport`.", + "since": "3.18.0 - support for relative patterns. Whether clients support\nrelative patterns depends on the client capability\n`textDocuments.filters.relativePatternSupport`." + } + ], + "documentation": "A document filter where `scheme` is required field.\n\n@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "TextDocumentFilterPattern", + "properties": [ + { + "name": "language", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A language id, like `typescript`." + }, + { + "name": "scheme", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A Uri {@link Uri.scheme scheme}, like `file` or `untitled`." + }, + { + "name": "pattern", + "type": { + "kind": "reference", + "name": "GlobPattern" + }, + "documentation": "A glob pattern, like **/*.{ts,js}. See TextDocumentFilter for examples.\n\n@since 3.18.0 - support for relative patterns. Whether clients support\nrelative patterns depends on the client capability\n`textDocuments.filters.relativePatternSupport`.", + "since": "3.18.0 - support for relative patterns. Whether clients support\nrelative patterns depends on the client capability\n`textDocuments.filters.relativePatternSupport`." + } + ], + "documentation": "A document filter where `pattern` is required field.\n\n@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "NotebookDocumentFilterNotebookType", + "properties": [ + { + "name": "notebookType", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The type of the enclosing notebook." + }, + { + "name": "scheme", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A Uri {@link Uri.scheme scheme}, like `file` or `untitled`." + }, + { + "name": "pattern", + "type": { + "kind": "reference", + "name": "GlobPattern" + }, + "optional": true, + "documentation": "A glob pattern." + } + ], + "documentation": "A notebook document filter where `notebookType` is required field.\n\n@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "NotebookDocumentFilterScheme", + "properties": [ + { + "name": "notebookType", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The type of the enclosing notebook." + }, + { + "name": "scheme", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "A Uri {@link Uri.scheme scheme}, like `file` or `untitled`." + }, + { + "name": "pattern", + "type": { + "kind": "reference", + "name": "GlobPattern" + }, + "optional": true, + "documentation": "A glob pattern." + } + ], + "documentation": "A notebook document filter where `scheme` is required field.\n\n@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "NotebookDocumentFilterPattern", + "properties": [ + { + "name": "notebookType", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "The type of the enclosing notebook." + }, + { + "name": "scheme", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A Uri {@link Uri.scheme scheme}, like `file` or `untitled`." + }, + { + "name": "pattern", + "type": { + "kind": "reference", + "name": "GlobPattern" + }, + "documentation": "A glob pattern." + } + ], + "documentation": "A notebook document filter where `pattern` is required field.\n\n@since 3.18.0", + "since": "3.18.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": "WorkspaceEditClientCapabilities", "properties": [ { @@ -11200,24 +12103,32 @@ { "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." - } - ] - } + "kind": "reference", + "name": "ChangeAnnotationsSupportOptions" }, "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": "metadataSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client supports `WorkspaceEditMetadata` in `WorkspaceEdit`s.\n\n@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "snippetEditSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client supports snippets as text edits.\n\n@since 3.18.0", + "since": "3.18.0" } ] }, @@ -11274,23 +12185,8 @@ { "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." - } - ] - } + "kind": "reference", + "name": "ClientSymbolKindOptions" }, "optional": true, "documentation": "Specific capabilities for the `SymbolKind` in the `workspace/symbol` request." @@ -11298,22 +12194,8 @@ { "name": "tagSupport", "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "valueSet", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "SymbolTag" - } - }, - "documentation": "The tags supported by the client." - } - ] - } + "kind": "reference", + "name": "ClientSymbolTagOptions" }, "optional": true, "documentation": "The client supports tags on `SymbolInformation`.\nClients supporting tags have to handle unknown tags gracefully.\n\n@since 3.16.0", @@ -11322,22 +12204,8 @@ { "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`" - } - ] - } + "kind": "reference", + "name": "ClientSymbolResolveOptions" }, "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", @@ -11521,14 +12389,28 @@ "name": "boolean" }, "optional": true, - "documentation": "Whether the client implementation supports a refresh request sent from the\nserver to the client.\n\nNote that this event is global and will force the client to refresh all\nfolding ranges currently shown. It should be used with absolute care and is\nuseful for situation where a server for example detects a project wide\nchange that requires such a calculation.\n\n@since 3.18.0\n@proposed", - "since": "3.18.0", - "proposed": true + "documentation": "Whether the client implementation supports a refresh request sent from the\nserver to the client.\n\nNote that this event is global and will force the client to refresh all\nfolding ranges currently shown. It should be used with absolute care and is\nuseful for situation where a server for example detects a project wide\nchange that requires such a calculation.\n\n@since 3.18.0", + "since": "3.18.0" } ], - "documentation": "Client workspace capabilities specific to folding ranges\n\n@since 3.18.0\n@proposed", - "since": "3.18.0", - "proposed": true + "documentation": "Client workspace capabilities specific to folding ranges\n\n@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "TextDocumentContentClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Text document content provider supports dynamic registration." + } + ], + "documentation": "Client capabilities for a text document content provider.\n\n@since 3.18.0", + "since": "3.18.0" }, { "name": "TextDocumentSyncClientCapabilities", @@ -11572,6 +12454,21 @@ ] }, { + "name": "TextDocumentFilterClientCapabilities", + "properties": [ + { + "name": "relativePatternSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports Relative Patterns.\n\n@since 3.18.0", + "since": "3.18.0" + } + ] + }, + { "name": "CompletionClientCapabilities", "properties": [ { @@ -11586,150 +12483,8 @@ { "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" - } - ] - } + "kind": "reference", + "name": "ClientCompletionItemOptions" }, "optional": true, "documentation": "The client supports the following `CompletionItem` specific\ncapabilities." @@ -11737,25 +12492,11 @@ { "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." - } - ] - } + "kind": "reference", + "name": "ClientCompletionItemOptionsKind" }, - "optional": true + "optional": true, + "documentation": "The client supports the following completion item kinds." }, { "name": "insertTextMode", @@ -11779,24 +12520,8 @@ { "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" - } - ] - } + "kind": "reference", + "name": "CompletionListCapabilities" }, "optional": true, "documentation": "The client supports the following `CompletionList` specific\ncapabilities.\n\n@since 3.17.0", @@ -11846,55 +12571,8 @@ { "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" - } - ] - } + "kind": "reference", + "name": "ClientSignatureInformationOptions" }, "optional": true, "documentation": "The client supports the following `SignatureInformation`\nspecific properties." @@ -12057,23 +12735,8 @@ { "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." - } - ] - } + "kind": "reference", + "name": "ClientSymbolKindOptions" }, "optional": true, "documentation": "Specific capabilities for the `SymbolKind` in the\n`textDocument/documentSymbol` request." @@ -12090,22 +12753,8 @@ { "name": "tagSupport", "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "valueSet", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "SymbolTag" - } - }, - "documentation": "The tags supported by the client." - } - ] - } + "kind": "reference", + "name": "ClientSymbolTagOptions" }, "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", @@ -12139,33 +12788,8 @@ { "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." - } - ] - } + "kind": "reference", + "name": "ClientCodeActionLiteralOptions" }, "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", @@ -12204,22 +12828,8 @@ { "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." - } - ] - } + "kind": "reference", + "name": "ClientCodeActionResolveOptions" }, "optional": true, "documentation": "Whether the client supports resolving additional code action\nproperties via a separate `codeAction/resolve` request.\n\n@since 3.16.0", @@ -12234,6 +12844,26 @@ "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" + }, + { + "name": "documentationSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client supports documentation for a class of\ncode actions.\n\n@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "tagSupport", + "type": { + "kind": "reference", + "name": "CodeActionTagOptions" + }, + "optional": true, + "documentation": "Client supports the tag property on a code action. Clients\nsupporting tags have to handle unknown tags gracefully.\n\n@since 3.18.0 - proposed", + "since": "3.18.0 - proposed" } ], "documentation": "The Client Capabilities of a {@link CodeActionRequest}." @@ -12249,6 +12879,16 @@ }, "optional": true, "documentation": "Whether code lens supports dynamic registration." + }, + { + "name": "resolveSupport", + "type": { + "kind": "reference", + "name": "ClientCodeLensResolveOptions" + }, + "optional": true, + "documentation": "Whether the client supports resolving additional code lens\nproperties via a separate `codeLens/resolve` request.\n\n@since 3.18.0", + "since": "3.18.0" } ], "documentation": "The client capabilities of a {@link CodeLensRequest}." @@ -12326,9 +12966,8 @@ "name": "boolean" }, "optional": true, - "documentation": "Whether the client supports formatting multiple ranges at once.\n\n@since 3.18.0\n@proposed", - "since": "3.18.0", - "proposed": true + "documentation": "Whether the client supports formatting multiple ranges at once.\n\n@since 3.18.0", + "since": "3.18.0" } ], "documentation": "Client capabilities of a {@link DocumentRangeFormattingRequest}." @@ -12425,23 +13064,8 @@ { "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." - } - ] - } + "kind": "reference", + "name": "ClientFoldingRangeKindOptions" }, "optional": true, "documentation": "Specific options for the folding range kind.\n\n@since 3.17.0", @@ -12450,21 +13074,8 @@ { "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" - } - ] - } + "kind": "reference", + "name": "ClientFoldingRangeOptions" }, "optional": true, "documentation": "Specific options for the folding range.\n\n@since 3.17.0", @@ -12490,39 +13101,6 @@ "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", @@ -12531,26 +13109,12 @@ "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" - }, + } + ], + "extends": [ { - "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" + "kind": "reference", + "name": "DiagnosticsCapabilities" } ], "documentation": "The publish diagnostic client capabilities." @@ -12586,61 +13150,8 @@ { "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." - } - ] - } + "kind": "reference", + "name": "ClientSemanticTokensRequestOptions" }, "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." }, @@ -12798,22 +13309,8 @@ { "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." - } - ] - } + "kind": "reference", + "name": "ClientInlayHintResolveOptions" }, "optional": true, "documentation": "Indicates which properties a client can resolve lazily on an inlay\nhint." @@ -12842,6 +13339,22 @@ }, "optional": true, "documentation": "Whether the clients supports related documents for document diagnostic pulls." + }, + { + "name": "markupMessageSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the client supports `MarkupContent` in diagnostic messages.\n\n@since 3.18.0", + "since": "3.18.0" + } + ], + "extends": [ + { + "kind": "reference", + "name": "DiagnosticsCapabilities" } ], "documentation": "Client capabilities specific to diagnostic pull requests.\n\n@since 3.17.0", @@ -12860,9 +13373,8 @@ "documentation": "Whether implementation supports dynamic registration for inline completion providers." } ], - "documentation": "Client capabilities specific to inline completions.\n\n@since 3.18.0\n@proposed", - "since": "3.18.0", - "proposed": true + "documentation": "Client capabilities specific to inline completions.\n\n@since 3.18.0", + "since": "3.18.0" }, { "name": "NotebookDocumentSyncClientCapabilities", @@ -12895,20 +13407,8 @@ { "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." - } - ] - } + "kind": "reference", + "name": "ClientShowMessageActionItemOptions" }, "optional": true, "documentation": "Capabilities specific to the `MessageActionItem` type." @@ -12932,13 +13432,39 @@ "since": "3.16.0" }, { + "name": "StaleRequestSupportOptions", + "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`" + } + ], + "documentation": "@since 3.18.0", + "since": "3.18.0" + }, + { "name": "RegularExpressionsClientCapabilities", "properties": [ { "name": "engine", "type": { - "kind": "base", - "name": "string" + "kind": "reference", + "name": "RegularExpressionEngineKind" }, "documentation": "The engine's name." }, @@ -12991,6 +13517,630 @@ ], "documentation": "Client capabilities specific to the used markdown parser.\n\n@since 3.16.0", "since": "3.16.0" + }, + { + "name": "ChangeAnnotationsSupportOptions", + "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." + } + ], + "documentation": "@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "ClientSymbolKindOptions", + "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." + } + ], + "documentation": "@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "ClientSymbolTagOptions", + "properties": [ + { + "name": "valueSet", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "SymbolTag" + } + }, + "documentation": "The tags supported by the client." + } + ], + "documentation": "@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "ClientSymbolResolveOptions", + "properties": [ + { + "name": "properties", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "documentation": "The properties that a client can resolve lazily. Usually\n`location.range`" + } + ], + "documentation": "@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "ClientCompletionItemOptions", + "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": "reference", + "name": "CompletionItemTagOptions" + }, + "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": "reference", + "name": "ClientCompletionItemResolveOptions" + }, + "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": "reference", + "name": "ClientCompletionItemInsertTextModeOptions" + }, + "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" + } + ], + "documentation": "@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "ClientCompletionItemOptionsKind", + "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." + } + ], + "documentation": "@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "CompletionListCapabilities", + "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" + }, + { + "name": "applyKindSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Specifies whether the client supports `CompletionList.applyKind` to\nindicate how supported values from `completionList.itemDefaults`\nand `completion` will be combined.\n\nIf a client supports `applyKind` it must support it for all fields\nthat it supports that are listed in `CompletionList.applyKind`. This\nmeans when clients add support for new/future fields in completion\nitems the MUST also support merge for them if those fields are\ndefined in `CompletionList.applyKind`.\n\n@since 3.18.0", + "since": "3.18.0" + } + ], + "documentation": "The client supports the following `CompletionList` specific\ncapabilities.\n\n@since 3.17.0", + "since": "3.17.0" + }, + { + "name": "ClientSignatureInformationOptions", + "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": "reference", + "name": "ClientSignatureParameterInformationOptions" + }, + "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" + }, + { + "name": "noActiveParameterSupport", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "The client supports the `activeParameter` property on\n`SignatureHelp`/`SignatureInformation` being set to `null` to\nindicate that no parameter should be active.\n\n@since 3.18.0", + "since": "3.18.0" + } + ], + "documentation": "@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "ClientCodeActionLiteralOptions", + "properties": [ + { + "name": "codeActionKind", + "type": { + "kind": "reference", + "name": "ClientCodeActionKindOptions" + }, + "documentation": "The code action kind is support with the following value\nset." + } + ], + "documentation": "@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "ClientCodeActionResolveOptions", + "properties": [ + { + "name": "properties", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "documentation": "The properties that a client can resolve lazily." + } + ], + "documentation": "@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "CodeActionTagOptions", + "properties": [ + { + "name": "valueSet", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "CodeActionTag" + } + }, + "documentation": "The tags supported by the client." + } + ], + "documentation": "@since 3.18.0 - proposed", + "since": "3.18.0 - proposed" + }, + { + "name": "ClientCodeLensResolveOptions", + "properties": [ + { + "name": "properties", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "documentation": "The properties that a client can resolve lazily." + } + ], + "documentation": "@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "ClientFoldingRangeKindOptions", + "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." + } + ], + "documentation": "@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "ClientFoldingRangeOptions", + "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" + } + ], + "documentation": "@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "DiagnosticsCapabilities", + "properties": [ + { + "name": "relatedInformation", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether the clients accepts diagnostics with related information." + }, + { + "name": "tagSupport", + "type": { + "kind": "reference", + "name": "ClientDiagnosticsTagOptions" + }, + "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": "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": "General diagnostics capabilities for pull and push model." + }, + { + "name": "ClientSemanticTokensRequestOptions", + "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": "reference", + "name": "ClientSemanticTokensRequestFullDelta" + } + ] + }, + "optional": true, + "documentation": "The client will send the `textDocument/semanticTokens/full` request if\nthe server provides a corresponding handler." + } + ], + "documentation": "@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "ClientInlayHintResolveOptions", + "properties": [ + { + "name": "properties", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "documentation": "The properties that a client can resolve lazily." + } + ], + "documentation": "@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "ClientShowMessageActionItemOptions", + "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." + } + ], + "documentation": "@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "CompletionItemTagOptions", + "properties": [ + { + "name": "valueSet", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "CompletionItemTag" + } + }, + "documentation": "The tags supported by the client." + } + ], + "documentation": "@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "ClientCompletionItemResolveOptions", + "properties": [ + { + "name": "properties", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "documentation": "The properties that a client can resolve lazily." + } + ], + "documentation": "@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "ClientCompletionItemInsertTextModeOptions", + "properties": [ + { + "name": "valueSet", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "InsertTextMode" + } + } + } + ], + "documentation": "@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "ClientSignatureParameterInformationOptions", + "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" + } + ], + "documentation": "@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "ClientCodeActionKindOptions", + "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": "@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "ClientDiagnosticsTagOptions", + "properties": [ + { + "name": "valueSet", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "DiagnosticTag" + } + }, + "documentation": "The tags supported by the client." + } + ], + "documentation": "@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "ClientSemanticTokensRequestFullDelta", + "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." + } + ], + "documentation": "@since 3.18.0", + "since": "3.18.0" } ], "enumerations": [ @@ -13095,6 +14245,12 @@ "value": "decorator", "documentation": "@since 3.17.0", "since": "3.17.0" + }, + { + "name": "label", + "value": "label", + "documentation": "@since 3.18.0", + "since": "3.18.0" } ], "supportsCustomValues": true, @@ -13241,7 +14397,7 @@ { "name": "RequestCancelled", "value": -32800, - "documentation": "The client has canceled a request and a server as detected\nthe cancel." + "documentation": "The client has canceled a request and a server has detected\nthe cancel." } ], "supportsCustomValues": true @@ -13796,6 +14952,12 @@ "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": "RefactorMove", + "value": "refactor.move", + "documentation": "Base kind for refactoring move actions: `refactor.move`\n\nExample move actions:\n\n- Move a function to a new file\n- Move a property between classes\n- Move method to base class\n- ...\n\n@since 3.18.0", + "since": "3.18.0" + }, + { "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- ..." @@ -13815,13 +14977,35 @@ "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" + }, + { + "name": "Notebook", + "value": "notebook", + "documentation": "Base kind for all code actions applying to the entire notebook's scope. CodeActionKinds using\nthis should always begin with `notebook.`\n\n@since 3.18.0", + "since": "3.18.0" } ], "supportsCustomValues": true, "documentation": "A set of predefined code action kinds" }, { - "name": "TraceValues", + "name": "CodeActionTag", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "LLMGenerated", + "value": 1, + "documentation": "Marks the code action as LLM-generated." + } + ], + "documentation": "Code action tags are extra annotations that tweak the behavior of a code action.\n\n@since 3.18.0 - proposed", + "since": "3.18.0 - proposed" + }, + { + "name": "TraceValue", "type": { "kind": "base", "name": "string" @@ -13865,6 +15049,272 @@ "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": "LanguageKind", + "type": { + "kind": "base", + "name": "string" + }, + "values": [ + { + "name": "ABAP", + "value": "abap" + }, + { + "name": "WindowsBat", + "value": "bat" + }, + { + "name": "BibTeX", + "value": "bibtex" + }, + { + "name": "Clojure", + "value": "clojure" + }, + { + "name": "Coffeescript", + "value": "coffeescript" + }, + { + "name": "C", + "value": "c" + }, + { + "name": "CPP", + "value": "cpp" + }, + { + "name": "CSharp", + "value": "csharp" + }, + { + "name": "CSS", + "value": "css" + }, + { + "name": "D", + "value": "d", + "documentation": "@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "Delphi", + "value": "pascal", + "documentation": "@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "Diff", + "value": "diff" + }, + { + "name": "Dart", + "value": "dart" + }, + { + "name": "Dockerfile", + "value": "dockerfile" + }, + { + "name": "Elixir", + "value": "elixir" + }, + { + "name": "Erlang", + "value": "erlang" + }, + { + "name": "FSharp", + "value": "fsharp" + }, + { + "name": "GitCommit", + "value": "git-commit" + }, + { + "name": "GitRebase", + "value": "git-rebase" + }, + { + "name": "Go", + "value": "go" + }, + { + "name": "Groovy", + "value": "groovy" + }, + { + "name": "Handlebars", + "value": "handlebars" + }, + { + "name": "Haskell", + "value": "haskell" + }, + { + "name": "HTML", + "value": "html" + }, + { + "name": "Ini", + "value": "ini" + }, + { + "name": "Java", + "value": "java" + }, + { + "name": "JavaScript", + "value": "javascript" + }, + { + "name": "JavaScriptReact", + "value": "javascriptreact" + }, + { + "name": "JSON", + "value": "json" + }, + { + "name": "LaTeX", + "value": "latex" + }, + { + "name": "Less", + "value": "less" + }, + { + "name": "Lua", + "value": "lua" + }, + { + "name": "Makefile", + "value": "makefile" + }, + { + "name": "Markdown", + "value": "markdown" + }, + { + "name": "ObjectiveC", + "value": "objective-c" + }, + { + "name": "ObjectiveCPP", + "value": "objective-cpp" + }, + { + "name": "Pascal", + "value": "pascal", + "documentation": "@since 3.18.0", + "since": "3.18.0" + }, + { + "name": "Perl", + "value": "perl" + }, + { + "name": "Perl6", + "value": "perl6" + }, + { + "name": "PHP", + "value": "php" + }, + { + "name": "Plaintext", + "value": "plaintext" + }, + { + "name": "Powershell", + "value": "powershell" + }, + { + "name": "Pug", + "value": "jade" + }, + { + "name": "Python", + "value": "python" + }, + { + "name": "R", + "value": "r" + }, + { + "name": "Razor", + "value": "razor" + }, + { + "name": "Ruby", + "value": "ruby" + }, + { + "name": "Rust", + "value": "rust" + }, + { + "name": "SCSS", + "value": "scss" + }, + { + "name": "SASS", + "value": "sass" + }, + { + "name": "Scala", + "value": "scala" + }, + { + "name": "ShaderLab", + "value": "shaderlab" + }, + { + "name": "ShellScript", + "value": "shellscript" + }, + { + "name": "SQL", + "value": "sql" + }, + { + "name": "Swift", + "value": "swift" + }, + { + "name": "TypeScript", + "value": "typescript" + }, + { + "name": "TypeScriptReact", + "value": "typescriptreact" + }, + { + "name": "TeX", + "value": "tex" + }, + { + "name": "VisualBasic", + "value": "vb" + }, + { + "name": "XML", + "value": "xml" + }, + { + "name": "XSL", + "value": "xsl" + }, + { + "name": "YAML", + "value": "yaml" + } + ], + "supportsCustomValues": true, + "documentation": "Predefined Language kinds\n@since 3.18.0", + "since": "3.18.0" + }, + { "name": "InlineCompletionTriggerKind", "type": { "kind": "base", @@ -13873,18 +15323,17 @@ "values": [ { "name": "Invoked", - "value": 0, + "value": 1, "documentation": "Completion was triggered explicitly by a user gesture." }, { "name": "Automatic", - "value": 1, + "value": 2, "documentation": "Completion was triggered automatically while editing." } ], - "documentation": "Describes how an {@link InlineCompletionItemProvider inline completion provider} was triggered.\n\n@since 3.18.0\n@proposed", - "since": "3.18.0", - "proposed": true + "documentation": "Describes how an {@link InlineCompletionItemProvider inline completion provider} was triggered.\n\n@since 3.18.0", + "since": "3.18.0" }, { "name": "PositionEncodingKind", @@ -14040,6 +15489,27 @@ "documentation": "How a completion was triggered" }, { + "name": "ApplyKind", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "Replace", + "value": 1, + "documentation": "The value from the individual item (if provided and not `null`) will be\nused instead of the default." + }, + { + "name": "Merge", + "value": 2, + "documentation": "The value from the item will be merged with the default.\n\nThe specific rules for mergeing values are defined against each field\nthat supports merging." + } + ], + "documentation": "Defines how values from a set of defaults and an individual item will be\nmerged.\n\n@since 3.18.0", + "since": "3.18.0" + }, + { "name": "SignatureHelpTriggerKind", "type": { "kind": "base", @@ -14370,39 +15840,12 @@ "name": "Range" }, { - "kind": "literal", - "value": { - "properties": [ - { - "name": "range", - "type": { - "kind": "reference", - "name": "Range" - } - }, - { - "name": "placeholder", - "type": { - "kind": "base", - "name": "string" - } - } - ] - } + "kind": "reference", + "name": "PrepareRenamePlaceholder" }, { - "kind": "literal", - "value": { - "properties": [ - { - "name": "defaultBehavior", - "type": { - "kind": "base", - "name": "boolean" - } - } - ] - } + "kind": "reference", + "name": "PrepareRenameDefaultBehavior" } ] } @@ -14467,51 +15910,12 @@ "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": "reference", + "name": "TextDocumentContentChangePartial" }, { - "kind": "literal", - "value": { - "properties": [ - { - "name": "text", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The new text of the whole document." - } - ] - } + "kind": "reference", + "name": "TextDocumentContentChangeWholeDocument" } ] }, @@ -14527,25 +15931,8 @@ "name": "string" }, { - "kind": "literal", - "value": { - "properties": [ - { - "name": "language", - "type": { - "kind": "base", - "name": "string" - } - }, - { - "name": "value", - "type": { - "kind": "base", - "name": "string" - } - } - ] - } + "kind": "reference", + "name": "MarkedStringWithLanguage" } ] }, @@ -14567,8 +15954,8 @@ } ] }, - "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." + "documentation": "A document filter describes a top level text document or\na notebook cell document.\n\n@since 3.17.0 - support for NotebookCellTextDocumentFilter.", + "since": "3.17.0 - support for NotebookCellTextDocumentFilter." }, { "name": "LSPObject", @@ -14610,107 +15997,20 @@ "kind": "or", "items": [ { - "kind": "literal", - "value": { - "properties": [ - { - "name": "language", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "A language id, like `typescript`." - }, - { - "name": "scheme", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A Uri {@link Uri.scheme scheme}, like `file` or `untitled`." - }, - { - "name": "pattern", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A glob pattern, like **/*.{ts,js}. See TextDocumentFilter for examples." - } - ] - } + "kind": "reference", + "name": "TextDocumentFilterLanguage" }, { - "kind": "literal", - "value": { - "properties": [ - { - "name": "language", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A language id, like `typescript`." - }, - { - "name": "scheme", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "A Uri {@link Uri.scheme scheme}, like `file` or `untitled`." - }, - { - "name": "pattern", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A glob pattern, like **/*.{ts,js}. See TextDocumentFilter for examples." - } - ] - } + "kind": "reference", + "name": "TextDocumentFilterScheme" }, { - "kind": "literal", - "value": { - "properties": [ - { - "name": "language", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A language id, like `typescript`." - }, - { - "name": "scheme", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A Uri {@link Uri.scheme scheme}, like `file` or `untitled`." - }, - { - "name": "pattern", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "A glob pattern, like **/*.{ts,js}. See TextDocumentFilter for examples." - } - ] - } + "kind": "reference", + "name": "TextDocumentFilterPattern" } ] }, - "documentation": "A document filter denotes a document by different properties like\nthe {@link TextDocument.languageId language}, the {@link Uri.scheme scheme} of\nits resource, or a glob-pattern that is applied to the {@link TextDocument.fileName path}.\n\nGlob patterns can have the following syntax:\n- `*` to match one or more characters in a path segment\n- `?` to match on one character in a path segment\n- `**` to match any number of path segments, including none\n- `{}` to group sub patterns into an OR expression. (e.g. `**/*.{ts,js}` matches all TypeScript and JavaScript files)\n- `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)\n- `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)\n\n@sample A language filter that applies to typescript files on disk: `{ language: 'typescript', scheme: 'file' }`\n@sample A language filter that applies to all package.json paths: `{ language: 'json', pattern: '**package.json' }`\n\n@since 3.17.0", + "documentation": "A document filter denotes a document by different properties like\nthe {@link TextDocument.languageId language}, the {@link Uri.scheme scheme} of\nits resource, or a glob-pattern that is applied to the {@link TextDocument.fileName path}.\n\nGlob patterns can have the following syntax:\n- `*` to match zero 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" }, { @@ -14719,103 +16019,16 @@ "kind": "or", "items": [ { - "kind": "literal", - "value": { - "properties": [ - { - "name": "notebookType", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The type of the enclosing notebook." - }, - { - "name": "scheme", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A Uri {@link Uri.scheme scheme}, like `file` or `untitled`." - }, - { - "name": "pattern", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A glob pattern." - } - ] - } + "kind": "reference", + "name": "NotebookDocumentFilterNotebookType" }, { - "kind": "literal", - "value": { - "properties": [ - { - "name": "notebookType", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "The type of the enclosing notebook." - }, - { - "name": "scheme", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "A Uri {@link Uri.scheme scheme}, like `file` or `untitled`." - }, - { - "name": "pattern", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A glob pattern." - } - ] - } + "kind": "reference", + "name": "NotebookDocumentFilterScheme" }, { - "kind": "literal", - "value": { - "properties": [ - { - "name": "notebookType", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "The type of the enclosing notebook." - }, - { - "name": "scheme", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A Uri {@link Uri.scheme scheme}, like `file` or `untitled`." - }, - { - "name": "pattern", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "A glob pattern." - } - ] - } + "kind": "reference", + "name": "NotebookDocumentFilterPattern" } ] }, @@ -14828,8 +16041,15 @@ "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", + "documentation": "The glob pattern to watch relative to the base path. Glob patterns can have the following syntax:\n- `*` to match zero 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" + }, + { + "name": "RegularExpressionEngineKind", + "type": { + "kind": "base", + "name": "string" + } } ] }