Version 2.18.0-110.0.dev
Merge commit '1e04fe1fd0507e86d84e516fd809a9370519b1d5' into 'dev'
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 454d0ba..c44a181 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -30,6 +30,9 @@
#### Pub
+* Breaking: `dart pub get` and `dart pub upgrade` no longer creates the
+ [deprecated](https://github.com/dart-lang/sdk/issues/47431) `.packages` file.
+ It can still be created with the `--legacy-packages-file` flag.
* `dart pub outdated` now shows which of your dependencies are discontinued.
## 2.17.0
diff --git a/DEPS b/DEPS
index 3a6aaa8..d151715 100644
--- a/DEPS
+++ b/DEPS
@@ -39,7 +39,7 @@
# Checked-in SDK version. The checked-in SDK is a Dart SDK distribution in a
# cipd package used to run Dart scripts in the build and test infrastructure.
- "sdk_tag": "version:2.17.0-266.1.beta",
+ "sdk_tag": "version:2.17.0",
# co19 is a cipd package. Use update.sh in tests/co19[_2] to update these
# hashes. It requires access to the dart-build-access group, which EngProd
@@ -135,18 +135,14 @@
"path_rev": "3d41ea582f5b0b18de3d90008809b877ff3f69bc",
"platform_rev": "1ffad63428bbd1b3ecaa15926bacfb724023648c",
"ply_rev": "604b32590ffad5cbb82e4afef1d305512d06ae93",
- "pool_rev": "7abe634002a1ba8a0928eded086062f1307ccfae",
+ "pool_rev": "c40cc32eabecb9d60f1045d1403108d968805f9a",
"process_rev": "56ece43b53b64c63ae51ec184b76bd5360c28d0b",
"protobuf_rev": "c1eb6cb51af39ccbaa1a8e19349546586a5c8e31",
- "pub_rev": "1e3c17ea871e6a80c720aa998f37cbd3913bc287",
+ "pub_rev": "51435efcd574b7bc18d47a5dd620cb9759dea8f8",
"pub_semver_rev": "ea6c54019948dc03042c595ce9413e17aaf7aa38",
"root_certificates_rev": "692f6d6488af68e0121317a9c2c9eb393eb0ee50",
"rust_revision": "b7856f695d65a8ebc846754f97d15814bcb1c244",
- "shelf_packages_handler_rev": "78302e67c035047e6348e692b0c1182131f0fe35",
- "shelf_proxy_rev": "124615d0614b38814970aa9638725d9d6b435268",
- "shelf_rev": "78ac724a7944700340a3cef28c84bccbe62e9367",
- "shelf_static_rev": "202ec1a53c9a830c17cf3b718d089cf7eba568ad",
- "shelf_web_socket_rev": "24fb8a04befa75a94ac63a27047b231d1a22aab4",
+ "shelf_rev": "fadca320b04689be9ec960013843a0d9ee6c4fc4",
"source_map_stack_trace_rev": "8eabd96b1811e30a11d3c54c9b4afae4fb72e98f",
"source_maps_rev": "c07a01b8d5547ce3a47ee7a7a2b938a2bc09afe3",
"source_span_rev": "8ae724c3e67f5afaacead44e93ff145bfb8775c7",
@@ -172,7 +168,7 @@
"webkit_inspection_protocol_rev": "dd6fb5d8b536e19cedb384d0bbf1f5631923f1e8",
"yaml_edit_rev": "0b74d85fac10b4fbf7d1a347debcf16c8f7b0e9c",
"yaml_rev": "0971c06490b9670add644ed62182acd6a5536946",
- "zlib_rev": "faff052b6b6edcd6dd548513fe44ac0941427bf0",
+ "zlib_rev": "27c2f474b71d0d20764f86f60ef8b00da1a16cda",
# Windows deps
"crashpad_rev": "bf327d8ceb6a669607b0dbab5a83a275d03f99ed",
@@ -393,16 +389,6 @@
Var("dart_git") + "pub.git" + "@" + Var("pub_rev"),
Var("dart_root") + "/third_party/pkg/shelf":
Var("dart_git") + "shelf.git" + "@" + Var("shelf_rev"),
- Var("dart_root") + "/third_party/pkg/shelf_packages_handler":
- Var("dart_git") + "shelf_packages_handler.git"
- + "@" + Var("shelf_packages_handler_rev"),
- Var("dart_root") + "/third_party/pkg/shelf_proxy":
- Var("dart_git") + "shelf_proxy.git" + "@" + Var("shelf_proxy_rev"),
- Var("dart_root") + "/third_party/pkg/shelf_static":
- Var("dart_git") + "shelf_static.git" + "@" + Var("shelf_static_rev"),
- Var("dart_root") + "/third_party/pkg/shelf_web_socket":
- Var("dart_git") + "shelf_web_socket.git" +
- "@" + Var("shelf_web_socket_rev"),
Var("dart_root") + "/third_party/pkg/source_maps":
Var("dart_git") + "source_maps.git" + "@" + Var("source_maps_rev"),
Var("dart_root") + "/third_party/pkg/source_span":
diff --git a/pkg/_fe_analyzer_shared/lib/src/macros/api/introspection.dart b/pkg/_fe_analyzer_shared/lib/src/macros/api/introspection.dart
index 131c21e..037c788 100644
--- a/pkg/_fe_analyzer_shared/lib/src/macros/api/introspection.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/macros/api/introspection.dart
@@ -100,10 +100,15 @@
bool get isStatic;
}
-/// A declaration that defines a new type in the program.
+/// Marker interface for a declaration that defines a new type in the program.
+///
+/// See [ParameterizedTypeDeclaration] and [TypeParameterDeclaration].
+abstract class TypeDeclaration implements Declaration {}
+
+/// A [TypeDeclaration] which may have type parameters.
///
/// See subtypes [ClassDeclaration] and [TypeAliasDeclaration].
-abstract class TypeDeclaration implements Declaration {
+abstract class ParameterizedTypeDeclaration implements TypeDeclaration {
/// The type parameters defined for this type declaration.
Iterable<TypeParameterDeclaration> get typeParameters;
}
@@ -112,7 +117,7 @@
///
/// Information about fields, methods, and constructors must be retrieved from
/// the `builder` objects.
-abstract class ClassDeclaration implements TypeDeclaration {
+abstract class ClassDeclaration implements ParameterizedTypeDeclaration {
/// Whether this class has an `abstract` modifier.
bool get isAbstract;
@@ -133,7 +138,7 @@
}
/// Type alias introspection information.
-abstract class TypeAliasDeclaration extends TypeDeclaration {
+abstract class TypeAliasDeclaration implements ParameterizedTypeDeclaration {
/// The type annotation this is an alias for.
TypeAnnotation get aliasedType;
}
@@ -227,8 +232,8 @@
String? get name;
}
-/// Type parameter introspection information.
-abstract class TypeParameterDeclaration implements Declaration {
+/// Generic type parameter introspection information.
+abstract class TypeParameterDeclaration implements TypeDeclaration {
/// The bound for this type parameter, if it has any.
TypeAnnotation? get bound;
diff --git a/pkg/_fe_analyzer_shared/lib/src/macros/executor/executor_base.dart b/pkg/_fe_analyzer_shared/lib/src/macros/executor/executor_base.dart
index 2e3c5d2..69c0745 100644
--- a/pkg/_fe_analyzer_shared/lib/src/macros/executor/executor_base.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/macros/executor/executor_base.dart
@@ -172,8 +172,8 @@
responseType: MessageType.remoteInstance,
response: (await resolver.declarationOf(request.identifier)
// TODO: Consider refactoring to avoid the need for
- // this.
- as TypeDeclarationImpl),
+ // this cast.
+ as Serializable),
serializationZoneId: zoneId);
} on ArgumentError catch (error) {
response = new SerializableResponse(
diff --git a/pkg/_fe_analyzer_shared/lib/src/macros/executor/introspection_impls.dart b/pkg/_fe_analyzer_shared/lib/src/macros/executor/introspection_impls.dart
index 4aace85..78ce58e 100644
--- a/pkg/_fe_analyzer_shared/lib/src/macros/executor/introspection_impls.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/macros/executor/introspection_impls.dart
@@ -564,12 +564,12 @@
}
}
-abstract class TypeDeclarationImpl extends DeclarationImpl
- implements TypeDeclaration {
+abstract class ParameterizedTypeDeclarationImpl extends DeclarationImpl
+ implements ParameterizedTypeDeclaration {
@override
final List<TypeParameterDeclarationImpl> typeParameters;
- TypeDeclarationImpl({
+ ParameterizedTypeDeclarationImpl({
required int id,
required IdentifierImpl identifier,
required this.typeParameters,
@@ -588,7 +588,7 @@
}
}
-class ClassDeclarationImpl extends TypeDeclarationImpl
+class ClassDeclarationImpl extends ParameterizedTypeDeclarationImpl
implements ClassDeclaration {
@override
final List<TypeAnnotationImpl> interfaces;
@@ -645,7 +645,7 @@
}
}
-class TypeAliasDeclarationImpl extends TypeDeclarationImpl
+class TypeAliasDeclarationImpl extends ParameterizedTypeDeclarationImpl
implements TypeAliasDeclaration {
/// The type being aliased.
final TypeAnnotationImpl aliasedType;
diff --git a/pkg/analysis_server/lib/lsp_protocol/protocol_generated.dart b/pkg/analysis_server/lib/lsp_protocol/protocol_generated.dart
index 699d04e..6738b31 100644
--- a/pkg/analysis_server/lib/lsp_protocol/protocol_generated.dart
+++ b/pkg/analysis_server/lib/lsp_protocol/protocol_generated.dart
@@ -537,7 +537,7 @@
}
class CallHierarchyIncomingCallsParams
- implements WorkDoneProgressParams, PartialResultParams, ToJsonable {
+ implements PartialResultParams, WorkDoneProgressParams, ToJsonable {
static const jsonHandler = LspJsonHandler(
CallHierarchyIncomingCallsParams.canParse,
CallHierarchyIncomingCallsParams.fromJson,
@@ -1086,7 +1086,7 @@
}
class CallHierarchyOutgoingCallsParams
- implements WorkDoneProgressParams, PartialResultParams, ToJsonable {
+ implements PartialResultParams, WorkDoneProgressParams, ToJsonable {
static const jsonHandler = LspJsonHandler(
CallHierarchyOutgoingCallsParams.canParse,
CallHierarchyOutgoingCallsParams.fromJson,
@@ -1349,9 +1349,9 @@
class CallHierarchyRegistrationOptions
implements
- TextDocumentRegistrationOptions,
CallHierarchyOptions,
StaticRegistrationOptions,
+ TextDocumentRegistrationOptions,
ToJsonable {
static const jsonHandler = LspJsonHandler(
CallHierarchyRegistrationOptions.canParse,
@@ -3262,7 +3262,7 @@
}
/// A set of predefined code action kinds.
-class CodeActionKind {
+class CodeActionKind implements ToJsonable {
const CodeActionKind(this._value);
const CodeActionKind.fromJson(this._value);
@@ -3319,9 +3319,6 @@
/// Source code actions apply to the entire file.
static const Source = CodeActionKind('source');
- /// Base kind for an organize imports source action: `source.organizeImports`.
- static const SourceOrganizeImports = CodeActionKind('source.organizeImports');
-
/// Base kind for a 'fix all' source action: `source.fixAll`.
/// 'Fix all' actions automatically fix errors that have a clear fix that do
/// not require user input. They should not suppress errors or perform unsafe
@@ -3329,6 +3326,9 @@
/// @since 3.17.0
static const SourceFixAll = CodeActionKind('source.fixAll');
+ /// Base kind for an organize imports source action: `source.organizeImports`.
+ static const SourceOrganizeImports = CodeActionKind('source.organizeImports');
+
Object toJson() => _value;
@override
@@ -3464,7 +3464,7 @@
/// Params for the CodeActionRequest
class CodeActionParams
- implements WorkDoneProgressParams, PartialResultParams, ToJsonable {
+ implements PartialResultParams, WorkDoneProgressParams, ToJsonable {
static const jsonHandler = LspJsonHandler(
CodeActionParams.canParse,
CodeActionParams.fromJson,
@@ -3653,7 +3653,7 @@
}
class CodeActionRegistrationOptions
- implements TextDocumentRegistrationOptions, CodeActionOptions, ToJsonable {
+ implements CodeActionOptions, TextDocumentRegistrationOptions, ToJsonable {
static const jsonHandler = LspJsonHandler(
CodeActionRegistrationOptions.canParse,
CodeActionRegistrationOptions.fromJson,
@@ -3807,7 +3807,7 @@
/// The reason why code actions were requested.
/// @since 3.17.0
-class CodeActionTriggerKind {
+class CodeActionTriggerKind implements ToJsonable {
const CodeActionTriggerKind(this._value);
const CodeActionTriggerKind.fromJson(this._value);
@@ -3817,15 +3817,15 @@
return obj is int;
}
- /// Code actions were explicitly requested by the user or by an extension.
- static const Invoked = CodeActionTriggerKind(1);
-
/// Code actions were requested automatically.
///
/// This typically happens when current selection in a file changes, but can
/// also be triggered when file content changes.
static const Automatic = CodeActionTriggerKind(2);
+ /// Code actions were explicitly requested by the user or by an extension.
+ static const Invoked = CodeActionTriggerKind(1);
+
Object toJson() => _value;
@override
@@ -4175,7 +4175,7 @@
}
class CodeLensParams
- implements WorkDoneProgressParams, PartialResultParams, ToJsonable {
+ implements PartialResultParams, WorkDoneProgressParams, ToJsonable {
static const jsonHandler = LspJsonHandler(
CodeLensParams.canParse,
CodeLensParams.fromJson,
@@ -4307,7 +4307,7 @@
}
class CodeLensRegistrationOptions
- implements TextDocumentRegistrationOptions, CodeLensOptions, ToJsonable {
+ implements CodeLensOptions, TextDocumentRegistrationOptions, ToJsonable {
static const jsonHandler = LspJsonHandler(
CodeLensRegistrationOptions.canParse,
CodeLensRegistrationOptions.fromJson,
@@ -4880,7 +4880,7 @@
}
class ColorPresentationParams
- implements WorkDoneProgressParams, PartialResultParams, ToJsonable {
+ implements PartialResultParams, WorkDoneProgressParams, ToJsonable {
static const jsonHandler = LspJsonHandler(
ColorPresentationParams.canParse,
ColorPresentationParams.fromJson,
@@ -6786,7 +6786,7 @@
}
/// The kind of a completion entry.
-class CompletionItemKind {
+class CompletionItemKind implements ToJsonable {
const CompletionItemKind(this._value);
const CompletionItemKind.fromJson(this._value);
@@ -6796,31 +6796,31 @@
return obj is int;
}
- static const Text = CompletionItemKind(1);
- static const Method = CompletionItemKind(2);
- static const Function = CompletionItemKind(3);
- static const Constructor = CompletionItemKind(4);
- static const Field = CompletionItemKind(5);
- static const Variable = CompletionItemKind(6);
static const Class = CompletionItemKind(7);
+ static const Color = CompletionItemKind(16);
+ static const Constant = CompletionItemKind(21);
+ static const Constructor = CompletionItemKind(4);
+ static const Enum = CompletionItemKind(13);
+ static const EnumMember = CompletionItemKind(20);
+ static const Event = CompletionItemKind(23);
+ static const Field = CompletionItemKind(5);
+ static const File = CompletionItemKind(17);
+ static const Folder = CompletionItemKind(19);
+ static const Function = CompletionItemKind(3);
static const Interface = CompletionItemKind(8);
+ static const Keyword = CompletionItemKind(14);
+ static const Method = CompletionItemKind(2);
static const Module = CompletionItemKind(9);
+ static const Operator = CompletionItemKind(24);
static const Property = CompletionItemKind(10);
+ static const Reference = CompletionItemKind(18);
+ static const Snippet = CompletionItemKind(15);
+ static const Struct = CompletionItemKind(22);
+ static const Text = CompletionItemKind(1);
+ static const TypeParameter = CompletionItemKind(25);
static const Unit = CompletionItemKind(11);
static const Value = CompletionItemKind(12);
- static const Enum = CompletionItemKind(13);
- static const Keyword = CompletionItemKind(14);
- static const Snippet = CompletionItemKind(15);
- static const Color = CompletionItemKind(16);
- static const File = CompletionItemKind(17);
- static const Reference = CompletionItemKind(18);
- static const Folder = CompletionItemKind(19);
- static const EnumMember = CompletionItemKind(20);
- static const Constant = CompletionItemKind(21);
- static const Struct = CompletionItemKind(22);
- static const Event = CompletionItemKind(23);
- static const Operator = CompletionItemKind(24);
- static const TypeParameter = CompletionItemKind(25);
+ static const Variable = CompletionItemKind(6);
Object toJson() => _value;
@@ -6928,7 +6928,7 @@
/// Completion item tags are extra annotations that tweak the rendering of a
/// completion item.
/// @since 3.15.0
-class CompletionItemTag {
+class CompletionItemTag implements ToJsonable {
const CompletionItemTag(this._value);
const CompletionItemTag.fromJson(this._value);
@@ -7609,9 +7609,9 @@
class CompletionParams
implements
+ PartialResultParams,
TextDocumentPositionParams,
WorkDoneProgressParams,
- PartialResultParams,
ToJsonable {
static const jsonHandler = LspJsonHandler(
CompletionParams.canParse,
@@ -7798,7 +7798,7 @@
}
class CompletionRegistrationOptions
- implements TextDocumentRegistrationOptions, CompletionOptions, ToJsonable {
+ implements CompletionOptions, TextDocumentRegistrationOptions, ToJsonable {
static const jsonHandler = LspJsonHandler(
CompletionRegistrationOptions.canParse,
CompletionRegistrationOptions.fromJson,
@@ -8017,7 +8017,7 @@
}
/// How a completion was triggered
-class CompletionTriggerKind {
+class CompletionTriggerKind implements ToJsonable {
const CompletionTriggerKind._(this._value);
const CompletionTriggerKind.fromJson(this._value);
@@ -8688,9 +8688,9 @@
class DeclarationParams
implements
+ PartialResultParams,
TextDocumentPositionParams,
WorkDoneProgressParams,
- PartialResultParams,
ToJsonable {
static const jsonHandler = LspJsonHandler(
DeclarationParams.canParse,
@@ -8853,8 +8853,8 @@
class DeclarationRegistrationOptions
implements
DeclarationOptions,
- TextDocumentRegistrationOptions,
StaticRegistrationOptions,
+ TextDocumentRegistrationOptions,
ToJsonable {
static const jsonHandler = LspJsonHandler(
DeclarationRegistrationOptions.canParse,
@@ -9129,9 +9129,9 @@
class DefinitionParams
implements
+ PartialResultParams,
TextDocumentPositionParams,
WorkDoneProgressParams,
- PartialResultParams,
ToJsonable {
static const jsonHandler = LspJsonHandler(
DefinitionParams.canParse,
@@ -9292,7 +9292,7 @@
}
class DefinitionRegistrationOptions
- implements TextDocumentRegistrationOptions, DefinitionOptions, ToJsonable {
+ implements DefinitionOptions, TextDocumentRegistrationOptions, ToJsonable {
static const jsonHandler = LspJsonHandler(
DefinitionRegistrationOptions.canParse,
DefinitionRegistrationOptions.fromJson,
@@ -10229,9 +10229,9 @@
/// @since 3.17.0
class DiagnosticRegistrationOptions
implements
- TextDocumentRegistrationOptions,
DiagnosticOptions,
StaticRegistrationOptions,
+ TextDocumentRegistrationOptions,
ToJsonable {
static const jsonHandler = LspJsonHandler(
DiagnosticRegistrationOptions.canParse,
@@ -10604,7 +10604,7 @@
String toString() => jsonEncoder.convert(toJson());
}
-class DiagnosticSeverity {
+class DiagnosticSeverity implements ToJsonable {
const DiagnosticSeverity(this._value);
const DiagnosticSeverity.fromJson(this._value);
@@ -10617,14 +10617,14 @@
/// Reports an error.
static const Error = DiagnosticSeverity(1);
- /// Reports a warning.
- static const Warning = DiagnosticSeverity(2);
+ /// Reports a hint.
+ static const Hint = DiagnosticSeverity(4);
/// Reports an information.
static const Information = DiagnosticSeverity(3);
- /// Reports a hint.
- static const Hint = DiagnosticSeverity(4);
+ /// Reports a warning.
+ static const Warning = DiagnosticSeverity(2);
Object toJson() => _value;
@@ -10639,7 +10639,7 @@
/// The diagnostic tags.
/// @since 3.15.0
-class DiagnosticTag {
+class DiagnosticTag implements ToJsonable {
const DiagnosticTag(this._value);
const DiagnosticTag.fromJson(this._value);
@@ -10649,17 +10649,17 @@
return obj is int;
}
+ /// Deprecated or obsolete code.
+ ///
+ /// Clients are allowed to rendered diagnostics with this tag strike through.
+ static const Deprecated = DiagnosticTag(2);
+
/// Unused or unnecessary code.
///
/// Clients are allowed to render diagnostics with this tag faded out instead
/// of having an error squiggle.
static const Unnecessary = DiagnosticTag(1);
- /// Deprecated or obsolete code.
- ///
- /// Clients are allowed to rendered diagnostics with this tag strike through.
- static const Deprecated = DiagnosticTag(2);
-
Object toJson() => _value;
@override
@@ -12093,7 +12093,7 @@
}
class DocumentColorParams
- implements WorkDoneProgressParams, PartialResultParams, ToJsonable {
+ implements PartialResultParams, WorkDoneProgressParams, ToJsonable {
static const jsonHandler = LspJsonHandler(
DocumentColorParams.canParse,
DocumentColorParams.fromJson,
@@ -12227,9 +12227,9 @@
class DocumentColorRegistrationOptions
implements
- TextDocumentRegistrationOptions,
- StaticRegistrationOptions,
DocumentColorOptions,
+ StaticRegistrationOptions,
+ TextDocumentRegistrationOptions,
ToJsonable {
static const jsonHandler = LspJsonHandler(
DocumentColorRegistrationOptions.canParse,
@@ -12352,7 +12352,7 @@
/// Parameters of the document diagnostic request.
/// @since 3.17.0
class DocumentDiagnosticParams
- implements WorkDoneProgressParams, PartialResultParams, ToJsonable {
+ implements PartialResultParams, WorkDoneProgressParams, ToJsonable {
static const jsonHandler = LspJsonHandler(
DocumentDiagnosticParams.canParse,
DocumentDiagnosticParams.fromJson,
@@ -12530,7 +12530,7 @@
/// The document diagnostic report kinds.
/// @since 3.17.0
-class DocumentDiagnosticReportKind {
+class DocumentDiagnosticReportKind implements ToJsonable {
const DocumentDiagnosticReportKind(this._value);
const DocumentDiagnosticReportKind.fromJson(this._value);
@@ -12926,8 +12926,8 @@
class DocumentFormattingRegistrationOptions
implements
- TextDocumentRegistrationOptions,
DocumentFormattingOptions,
+ TextDocumentRegistrationOptions,
ToJsonable {
static const jsonHandler = LspJsonHandler(
DocumentFormattingRegistrationOptions.canParse,
@@ -13188,7 +13188,7 @@
}
/// A document highlight kind.
-class DocumentHighlightKind {
+class DocumentHighlightKind implements ToJsonable {
const DocumentHighlightKind(this._value);
const DocumentHighlightKind.fromJson(this._value);
@@ -13198,12 +13198,12 @@
return obj is int;
}
- /// A textual occurrence.
- static const Text = DocumentHighlightKind(1);
-
/// Read-access of a symbol, like reading a variable.
static const Read = DocumentHighlightKind(2);
+ /// A textual occurrence.
+ static const Text = DocumentHighlightKind(1);
+
/// Write-access of a symbol, like writing to a variable.
static const Write = DocumentHighlightKind(3);
@@ -13287,9 +13287,9 @@
class DocumentHighlightParams
implements
+ PartialResultParams,
TextDocumentPositionParams,
WorkDoneProgressParams,
- PartialResultParams,
ToJsonable {
static const jsonHandler = LspJsonHandler(
DocumentHighlightParams.canParse,
@@ -13452,8 +13452,8 @@
class DocumentHighlightRegistrationOptions
implements
- TextDocumentRegistrationOptions,
DocumentHighlightOptions,
+ TextDocumentRegistrationOptions,
ToJsonable {
static const jsonHandler = LspJsonHandler(
DocumentHighlightRegistrationOptions.canParse,
@@ -13867,7 +13867,7 @@
}
class DocumentLinkParams
- implements WorkDoneProgressParams, PartialResultParams, ToJsonable {
+ implements PartialResultParams, WorkDoneProgressParams, ToJsonable {
static const jsonHandler = LspJsonHandler(
DocumentLinkParams.canParse,
DocumentLinkParams.fromJson,
@@ -14001,8 +14001,8 @@
class DocumentLinkRegistrationOptions
implements
- TextDocumentRegistrationOptions,
DocumentLinkOptions,
+ TextDocumentRegistrationOptions,
ToJsonable {
static const jsonHandler = LspJsonHandler(
DocumentLinkRegistrationOptions.canParse,
@@ -14454,8 +14454,8 @@
class DocumentOnTypeFormattingRegistrationOptions
implements
- TextDocumentRegistrationOptions,
DocumentOnTypeFormattingOptions,
+ TextDocumentRegistrationOptions,
ToJsonable {
static const jsonHandler = LspJsonHandler(
DocumentOnTypeFormattingRegistrationOptions.canParse,
@@ -14883,8 +14883,8 @@
class DocumentRangeFormattingRegistrationOptions
implements
- TextDocumentRegistrationOptions,
DocumentRangeFormattingOptions,
+ TextDocumentRegistrationOptions,
ToJsonable {
static const jsonHandler = LspJsonHandler(
DocumentRangeFormattingRegistrationOptions.canParse,
@@ -15672,7 +15672,7 @@
}
class DocumentSymbolParams
- implements WorkDoneProgressParams, PartialResultParams, ToJsonable {
+ implements PartialResultParams, WorkDoneProgressParams, ToJsonable {
static const jsonHandler = LspJsonHandler(
DocumentSymbolParams.canParse,
DocumentSymbolParams.fromJson,
@@ -15806,8 +15806,8 @@
class DocumentSymbolRegistrationOptions
implements
- TextDocumentRegistrationOptions,
DocumentSymbolOptions,
+ TextDocumentRegistrationOptions,
ToJsonable {
static const jsonHandler = LspJsonHandler(
DocumentSymbolRegistrationOptions.canParse,
@@ -15928,7 +15928,7 @@
String toString() => jsonEncoder.convert(toJson());
}
-class ErrorCodes {
+class ErrorCodes implements ToJsonable {
const ErrorCodes(this._value);
const ErrorCodes.fromJson(this._value);
@@ -15938,12 +15938,22 @@
return obj is int;
}
- /// Defined by JSON RPC
- static const ParseError = ErrorCodes(-32700);
- static const InvalidRequest = ErrorCodes(-32600);
- static const MethodNotFound = ErrorCodes(-32601);
- static const InvalidParams = ErrorCodes(-32602);
+ /// The server detected that the content of a document got modified outside
+ /// normal conditions. A server should NOT send this error code if it detects
+ /// a content change in it unprocessed messages. The result even computed on
+ /// an older state might still be useful for the client.
+ ///
+ /// If a client decides that a result is not of any use anymore the client
+ /// should cancel the request.
+ static const ContentModified = ErrorCodes(-32801);
static const InternalError = ErrorCodes(-32603);
+ static const InvalidParams = ErrorCodes(-32602);
+ static const InvalidRequest = ErrorCodes(-32600);
+
+ /// This is the end range of JSON RPC reserved error codes. It doesn't denote
+ /// a real error code.
+ /// @since 3.16.0
+ static const jsonrpcReservedErrorRangeEnd = ErrorCodes(-32000);
/// This is the start range of JSON RPC reserved error codes. It doesn't
/// denote a real error code. No LSP error codes should be defined between the
@@ -15952,20 +15962,22 @@
/// @since 3.16.0
static const jsonrpcReservedErrorRangeStart = ErrorCodes(-32099);
- /// Error code indicating that a server received a notification or request
- /// before the server has received the `initialize` request.
- static const ServerNotInitialized = ErrorCodes(-32002);
- static const UnknownErrorCode = ErrorCodes(-32001);
-
- /// This is the end range of JSON RPC reserved error codes. It doesn't denote
- /// a real error code.
+ /// This is the end range of LSP reserved error codes. It doesn't denote a
+ /// real error code.
/// @since 3.16.0
- static const jsonrpcReservedErrorRangeEnd = ErrorCodes(-32000);
+ static const lspReservedErrorRangeEnd = ErrorCodes(-32800);
/// This is the start range of LSP reserved error codes. It doesn't denote a
/// real error code.
/// @since 3.16.0
static const lspReservedErrorRangeStart = ErrorCodes(-32899);
+ static const MethodNotFound = ErrorCodes(-32601);
+
+ /// Defined by JSON RPC
+ static const ParseError = ErrorCodes(-32700);
+
+ /// The client has canceled a request and a server as detected the cancel.
+ static const RequestCancelled = ErrorCodes(-32800);
/// A request failed but it was syntactically correct, e.g the method name was
/// known and the parameters were valid. The error message should contain
@@ -15978,22 +15990,10 @@
/// @since 3.17.0
static const ServerCancelled = ErrorCodes(-32802);
- /// The server detected that the content of a document got modified outside
- /// normal conditions. A server should NOT send this error code if it detects
- /// a content change in it unprocessed messages. The result even computed on
- /// an older state might still be useful for the client.
- ///
- /// If a client decides that a result is not of any use anymore the client
- /// should cancel the request.
- static const ContentModified = ErrorCodes(-32801);
-
- /// The client has canceled a request and a server as detected the cancel.
- static const RequestCancelled = ErrorCodes(-32800);
-
- /// This is the end range of LSP reserved error codes. It doesn't denote a
- /// real error code.
- /// @since 3.16.0
- static const lspReservedErrorRangeEnd = ErrorCodes(-32800);
+ /// Error code indicating that a server received a notification or request
+ /// before the server has received the `initialize` request.
+ static const ServerNotInitialized = ErrorCodes(-32002);
+ static const UnknownErrorCode = ErrorCodes(-32001);
Object toJson() => _value;
@@ -16485,7 +16485,7 @@
String toString() => jsonEncoder.convert(toJson());
}
-class FailureHandlingKind {
+class FailureHandlingKind implements ToJsonable {
const FailureHandlingKind._(this._value);
const FailureHandlingKind.fromJson(this._value);
@@ -16494,8 +16494,8 @@
static bool canParse(Object? obj, LspJsonReporter reporter) {
switch (obj) {
case 'abort':
- case 'transactional':
case 'textOnlyTransactional':
+ case 'transactional':
case 'undo':
return true;
}
@@ -16507,16 +16507,16 @@
/// executed.
static const Abort = FailureHandlingKind._('abort');
- /// All operations are executed transactional. That means they either all
- /// succeed or no changes at all are applied to the workspace.
- static const Transactional = FailureHandlingKind._('transactional');
-
/// If the workspace edit contains only textual file changes they are executed
/// transactional. If resource changes (create, rename or delete file) are
/// part of the change the failure handling strategy is abort.
static const TextOnlyTransactional =
FailureHandlingKind._('textOnlyTransactional');
+ /// All operations are executed transactional. That means they either all
+ /// succeed or no changes at all are applied to the workspace.
+ static const Transactional = FailureHandlingKind._('transactional');
+
/// The client tries to undo the operations already executed. But there is no
/// guarantee that this is succeeding.
static const Undo = FailureHandlingKind._('undo');
@@ -16533,7 +16533,7 @@
}
/// The file event type.
-class FileChangeType {
+class FileChangeType implements ToJsonable {
const FileChangeType(this._value);
const FileChangeType.fromJson(this._value);
@@ -16543,12 +16543,12 @@
return obj is int;
}
- /// The file got created.
- static const Created = FileChangeType(1);
-
/// The file got changed.
static const Changed = FileChangeType(2);
+ /// The file got created.
+ static const Created = FileChangeType(1);
+
/// The file got deleted.
static const Deleted = FileChangeType(3);
@@ -17037,7 +17037,7 @@
/// A pattern kind describing if a glob pattern matches a file a folder or both.
/// @since 3.16.0
-class FileOperationPatternKind {
+class FileOperationPatternKind implements ToJsonable {
const FileOperationPatternKind(this._value);
const FileOperationPatternKind.fromJson(this._value);
@@ -17927,7 +17927,7 @@
}
/// A set of predefined range kinds.
-class FoldingRangeKind {
+class FoldingRangeKind implements ToJsonable {
const FoldingRangeKind(this._value);
const FoldingRangeKind.fromJson(this._value);
@@ -18023,7 +18023,7 @@
}
class FoldingRangeParams
- implements WorkDoneProgressParams, PartialResultParams, ToJsonable {
+ implements PartialResultParams, WorkDoneProgressParams, ToJsonable {
static const jsonHandler = LspJsonHandler(
FoldingRangeParams.canParse,
FoldingRangeParams.fromJson,
@@ -18157,9 +18157,9 @@
class FoldingRangeRegistrationOptions
implements
- TextDocumentRegistrationOptions,
FoldingRangeOptions,
StaticRegistrationOptions,
+ TextDocumentRegistrationOptions,
ToJsonable {
static const jsonHandler = LspJsonHandler(
FoldingRangeRegistrationOptions.canParse,
@@ -18467,14 +18467,14 @@
}
}
static FullDocumentDiagnosticReport fromJson(Map<String, Object?> json) {
- if (RelatedFullDocumentDiagnosticReport.canParse(
- json, nullLspJsonReporter)) {
- return RelatedFullDocumentDiagnosticReport.fromJson(json);
- }
if (WorkspaceFullDocumentDiagnosticReport.canParse(
json, nullLspJsonReporter)) {
return WorkspaceFullDocumentDiagnosticReport.fromJson(json);
}
+ if (RelatedFullDocumentDiagnosticReport.canParse(
+ json, nullLspJsonReporter)) {
+ return RelatedFullDocumentDiagnosticReport.fromJson(json);
+ }
final itemsJson = json['items'];
final items = (itemsJson as List<Object?>)
.map((item) => Diagnostic.fromJson(item as Map<String, Object?>))
@@ -19079,7 +19079,7 @@
}
class HoverRegistrationOptions
- implements TextDocumentRegistrationOptions, HoverOptions, ToJsonable {
+ implements HoverOptions, TextDocumentRegistrationOptions, ToJsonable {
static const jsonHandler = LspJsonHandler(
HoverRegistrationOptions.canParse,
HoverRegistrationOptions.fromJson,
@@ -19400,9 +19400,9 @@
class ImplementationParams
implements
+ PartialResultParams,
TextDocumentPositionParams,
WorkDoneProgressParams,
- PartialResultParams,
ToJsonable {
static const jsonHandler = LspJsonHandler(
ImplementationParams.canParse,
@@ -19565,9 +19565,9 @@
class ImplementationRegistrationOptions
implements
- TextDocumentRegistrationOptions,
ImplementationOptions,
StaticRegistrationOptions,
+ TextDocumentRegistrationOptions,
ToJsonable {
static const jsonHandler = LspJsonHandler(
ImplementationRegistrationOptions.canParse,
@@ -19688,7 +19688,7 @@
}
/// Known error codes for an `InitializeErrorCodes`;
-class InitializeErrorCodes {
+class InitializeErrorCodes implements ToJsonable {
const InitializeErrorCodes(this._value);
const InitializeErrorCodes.fromJson(this._value);
@@ -20783,7 +20783,7 @@
/// Inlay hint kinds.
/// @since 3.17.0
-class InlayHintKind {
+class InlayHintKind implements ToJsonable {
const InlayHintKind(this._value);
const InlayHintKind.fromJson(this._value);
@@ -20793,12 +20793,12 @@
return obj is int;
}
- /// An inlay hint that for a type annotation.
- static const Type = InlayHintKind(1);
-
/// An inlay hint that is for a parameter.
static const Parameter = InlayHintKind(2);
+ /// An inlay hint that for a type annotation.
+ static const Type = InlayHintKind(1);
+
Object toJson() => _value;
@override
@@ -21206,8 +21206,8 @@
class InlayHintRegistrationOptions
implements
InlayHintOptions,
- TextDocumentRegistrationOptions,
StaticRegistrationOptions,
+ TextDocumentRegistrationOptions,
ToJsonable {
static const jsonHandler = LspJsonHandler(
InlayHintRegistrationOptions.canParse,
@@ -21894,8 +21894,8 @@
class InlineValueRegistrationOptions
implements
InlineValueOptions,
- TextDocumentRegistrationOptions,
StaticRegistrationOptions,
+ TextDocumentRegistrationOptions,
ToJsonable {
static const jsonHandler = LspJsonHandler(
InlineValueRegistrationOptions.canParse,
@@ -22448,7 +22448,7 @@
/// Defines whether the insert text in a completion item should be interpreted
/// as plain text or a snippet.
-class InsertTextFormat {
+class InsertTextFormat implements ToJsonable {
const InsertTextFormat._(this._value);
const InsertTextFormat.fromJson(this._value);
@@ -22487,7 +22487,7 @@
/// How whitespace and indentation is handled during completion item insertion.
/// @since 3.16.0
-class InsertTextMode {
+class InsertTextMode implements ToJsonable {
const InsertTextMode(this._value);
const InsertTextMode.fromJson(this._value);
@@ -22497,12 +22497,6 @@
return obj is int;
}
- /// The insertion or replace strings is taken as it is. If the value is multi
- /// line the lines below the cursor will be inserted using the indentation
- /// defined in the string value. The client will not apply any kind of
- /// adjustments to the string.
- static const asIs = InsertTextMode(1);
-
/// The editor adjusts leading whitespace of new lines so that they match the
/// indentation up to the cursor of the line for which the item is accepted.
///
@@ -22511,6 +22505,12 @@
/// inserted will be indented using 2 tabs as well.
static const adjustIndentation = InsertTextMode(2);
+ /// The insertion or replace strings is taken as it is. If the value is multi
+ /// line the lines below the cursor will be inserted using the indentation
+ /// defined in the string value. The client will not apply any kind of
+ /// adjustments to the string.
+ static const asIs = InsertTextMode(1);
+
Object toJson() => _value;
@override
@@ -22789,9 +22789,9 @@
class LinkedEditingRangeRegistrationOptions
implements
- TextDocumentRegistrationOptions,
LinkedEditingRangeOptions,
StaticRegistrationOptions,
+ TextDocumentRegistrationOptions,
ToJsonable {
static const jsonHandler = LspJsonHandler(
LinkedEditingRangeRegistrationOptions.canParse,
@@ -23704,7 +23704,7 @@
///
/// Please note that `MarkupKinds` must not start with a `$`. This kinds are
/// reserved for internal usage.
-class MarkupKind {
+class MarkupKind implements ToJsonable {
const MarkupKind._(this._value);
const MarkupKind.fromJson(this._value);
@@ -23712,19 +23712,19 @@
static bool canParse(Object? obj, LspJsonReporter reporter) {
switch (obj) {
- case 'plaintext':
case 'markdown':
+ case 'plaintext':
return true;
}
return false;
}
- /// Plain text is supported as a content format
- static const PlainText = MarkupKind._('plaintext');
-
/// Markdown is supported as a content format
static const Markdown = MarkupKind._('markdown');
+ /// Plain text is supported as a content format
+ static const PlainText = MarkupKind._('plaintext');
+
Object toJson() => _value;
@override
@@ -23750,12 +23750,12 @@
if (RequestMessage.canParse(json, nullLspJsonReporter)) {
return RequestMessage.fromJson(json);
}
- if (ResponseMessage.canParse(json, nullLspJsonReporter)) {
- return ResponseMessage.fromJson(json);
- }
if (NotificationMessage.canParse(json, nullLspJsonReporter)) {
return NotificationMessage.fromJson(json);
}
+ if (ResponseMessage.canParse(json, nullLspJsonReporter)) {
+ return ResponseMessage.fromJson(json);
+ }
final clientRequestTimeJson = json['clientRequestTime'];
final clientRequestTime = clientRequestTimeJson as int?;
final jsonrpcJson = json['jsonrpc'];
@@ -23903,7 +23903,7 @@
String toString() => jsonEncoder.convert(toJson());
}
-class MessageType {
+class MessageType implements ToJsonable {
const MessageType(this._value);
const MessageType.fromJson(this._value);
@@ -23916,15 +23916,15 @@
/// An error message.
static const Error = MessageType(1);
- /// A warning message.
- static const Warning = MessageType(2);
-
/// An information message.
static const Info = MessageType(3);
/// A log message.
static const Log = MessageType(4);
+ /// A warning message.
+ static const Warning = MessageType(2);
+
Object toJson() => _value;
@override
@@ -23937,7 +23937,7 @@
}
/// Valid LSP methods known at the time of code generation from the spec.
-class Method {
+class Method implements ToJsonable {
const Method(this._value);
const Method.fromJson(this._value);
@@ -23947,90 +23947,6 @@
return obj is String;
}
- /// Constant for the '$/cancelRequest' method.
- static const cancelRequest = Method(r'$/cancelRequest');
-
- /// Constant for the '$/progress' method.
- static const progress = Method(r'$/progress');
-
- /// Constant for the 'initialize' method.
- static const initialize = Method('initialize');
-
- /// Constant for the 'initialized' method.
- static const initialized = Method('initialized');
-
- /// Constant for the 'client/registerCapability' method.
- static const client_registerCapability = Method('client/registerCapability');
-
- /// Constant for the 'client/unregisterCapability' method.
- static const client_unregisterCapability =
- Method('client/unregisterCapability');
-
- /// Constant for the '$/setTrace' method.
- static const setTrace = Method(r'$/setTrace');
-
- /// Constant for the '$/logTrace' method.
- static const logTrace = Method(r'$/logTrace');
-
- /// Constant for the 'shutdown' method.
- static const shutdown = Method('shutdown');
-
- /// Constant for the 'exit' method.
- static const exit = Method('exit');
-
- /// Constant for the 'textDocument/didOpen' method.
- static const textDocument_didOpen = Method('textDocument/didOpen');
-
- /// Constant for the 'textDocument/didChange' method.
- static const textDocument_didChange = Method('textDocument/didChange');
-
- /// Constant for the 'textDocument/willSave' method.
- static const textDocument_willSave = Method('textDocument/willSave');
-
- /// Constant for the 'textDocument/willSaveWaitUntil' method.
- static const textDocument_willSaveWaitUntil =
- Method('textDocument/willSaveWaitUntil');
-
- /// Constant for the 'textDocument/didSave' method.
- static const textDocument_didSave = Method('textDocument/didSave');
-
- /// Constant for the 'textDocument/didClose' method.
- static const textDocument_didClose = Method('textDocument/didClose');
-
- /// Constant for the 'notebookDocument/didOpen' method.
- static const notebookDocument_didOpen = Method('notebookDocument/didOpen');
-
- /// Constant for the 'notebookDocument/didChange' method.
- static const notebookDocument_didChange =
- Method('notebookDocument/didChange');
-
- /// Constant for the 'notebookDocument/didSave' method.
- static const notebookDocument_didSave = Method('notebookDocument/didSave');
-
- /// Constant for the 'notebookDocument/didClose' method.
- static const notebookDocument_didClose = Method('notebookDocument/didClose');
-
- /// Constant for the 'textDocument/declaration' method.
- static const textDocument_declaration = Method('textDocument/declaration');
-
- /// Constant for the 'textDocument/definition' method.
- static const textDocument_definition = Method('textDocument/definition');
-
- /// Constant for the 'textDocument/typeDefinition' method.
- static const textDocument_typeDefinition =
- Method('textDocument/typeDefinition');
-
- /// Constant for the 'textDocument/implementation' method.
- static const textDocument_implementation =
- Method('textDocument/implementation');
-
- /// Constant for the 'textDocument/references' method.
- static const textDocument_references = Method('textDocument/references');
-
- /// Constant for the 'textDocument/prepareCallHierarchy' method.
- static const textDocument_prepareCallHierarchy =
- Method('textDocument/prepareCallHierarchy');
-
/// Constant for the 'callHierarchy/incomingCalls' method.
static const callHierarchy_incomingCalls =
Method('callHierarchy/incomingCalls');
@@ -24039,15 +23955,102 @@
static const callHierarchy_outgoingCalls =
Method('callHierarchy/outgoingCalls');
- /// Constant for the 'textDocument/prepareTypeHierarchy' method.
- static const textDocument_prepareTypeHierarchy =
- Method('textDocument/prepareTypeHierarchy');
+ /// Constant for the '$/cancelRequest' method.
+ static const cancelRequest = Method(r'$/cancelRequest');
- /// Constant for the 'typeHierarchy/supertypes' method.
- static const typeHierarchy_supertypes = Method('typeHierarchy/supertypes');
+ /// Constant for the 'client/registerCapability' method.
+ static const client_registerCapability = Method('client/registerCapability');
- /// Constant for the 'typeHierarchy/subtypes' method.
- static const typeHierarchy_subtypes = Method('typeHierarchy/subtypes');
+ /// Constant for the 'client/unregisterCapability' method.
+ static const client_unregisterCapability =
+ Method('client/unregisterCapability');
+
+ /// Constant for the 'codeAction/resolve' method.
+ static const codeAction_resolve = Method('codeAction/resolve');
+
+ /// Constant for the 'codeLens/resolve' method.
+ static const codeLens_resolve = Method('codeLens/resolve');
+
+ /// Constant for the 'completionItem/resolve' method.
+ static const completionItem_resolve = Method('completionItem/resolve');
+
+ /// Constant for the 'documentLink/resolve' method.
+ static const documentLink_resolve = Method('documentLink/resolve');
+
+ /// Constant for the 'exit' method.
+ static const exit = Method('exit');
+
+ /// Constant for the 'initialize' method.
+ static const initialize = Method('initialize');
+
+ /// Constant for the 'initialized' method.
+ static const initialized = Method('initialized');
+
+ /// Constant for the 'inlayHint/resolve' method.
+ static const inlayHint_resolve = Method('inlayHint/resolve');
+
+ /// Constant for the '$/logTrace' method.
+ static const logTrace = Method(r'$/logTrace');
+
+ /// Constant for the 'notebookDocument/didChange' method.
+ static const notebookDocument_didChange =
+ Method('notebookDocument/didChange');
+
+ /// Constant for the 'notebookDocument/didClose' method.
+ static const notebookDocument_didClose = Method('notebookDocument/didClose');
+
+ /// Constant for the 'notebookDocument/didOpen' method.
+ static const notebookDocument_didOpen = Method('notebookDocument/didOpen');
+
+ /// Constant for the 'notebookDocument/didSave' method.
+ static const notebookDocument_didSave = Method('notebookDocument/didSave');
+
+ /// Constant for the '$/progress' method.
+ static const progress = Method(r'$/progress');
+
+ /// Constant for the '$/setTrace' method.
+ static const setTrace = Method(r'$/setTrace');
+
+ /// Constant for the 'shutdown' method.
+ static const shutdown = Method('shutdown');
+
+ /// Constant for the 'telemetry/event' method.
+ static const telemetry_event = Method('telemetry/event');
+
+ /// Constant for the 'textDocument/codeAction' method.
+ static const textDocument_codeAction = Method('textDocument/codeAction');
+
+ /// Constant for the 'textDocument/codeLens' method.
+ static const textDocument_codeLens = Method('textDocument/codeLens');
+
+ /// Constant for the 'textDocument/colorPresentation' method.
+ static const textDocument_colorPresentation =
+ Method('textDocument/colorPresentation');
+
+ /// Constant for the 'textDocument/completion' method.
+ static const textDocument_completion = Method('textDocument/completion');
+
+ /// Constant for the 'textDocument/declaration' method.
+ static const textDocument_declaration = Method('textDocument/declaration');
+
+ /// Constant for the 'textDocument/definition' method.
+ static const textDocument_definition = Method('textDocument/definition');
+
+ /// Constant for the 'textDocument/didChange' method.
+ static const textDocument_didChange = Method('textDocument/didChange');
+
+ /// Constant for the 'textDocument/didClose' method.
+ static const textDocument_didClose = Method('textDocument/didClose');
+
+ /// Constant for the 'textDocument/didOpen' method.
+ static const textDocument_didOpen = Method('textDocument/didOpen');
+
+ /// Constant for the 'textDocument/didSave' method.
+ static const textDocument_didSave = Method('textDocument/didSave');
+
+ /// Constant for the 'textDocument/documentColor' method.
+ static const textDocument_documentColor =
+ Method('textDocument/documentColor');
/// Constant for the 'textDocument/documentHighlight' method.
static const textDocument_documentHighlight =
@@ -24056,33 +24059,70 @@
/// Constant for the 'textDocument/documentLink' method.
static const textDocument_documentLink = Method('textDocument/documentLink');
- /// Constant for the 'documentLink/resolve' method.
- static const documentLink_resolve = Method('documentLink/resolve');
-
- /// Constant for the 'textDocument/hover' method.
- static const textDocument_hover = Method('textDocument/hover');
-
- /// Constant for the 'textDocument/codeLens' method.
- static const textDocument_codeLens = Method('textDocument/codeLens');
-
- /// Constant for the 'codeLens/resolve' method.
- static const codeLens_resolve = Method('codeLens/resolve');
-
- /// Constant for the 'workspace/codeLens/refresh' method.
- static const workspace_codeLens_refresh =
- Method('workspace/codeLens/refresh');
+ /// Constant for the 'textDocument/documentSymbol' method.
+ static const textDocument_documentSymbol =
+ Method('textDocument/documentSymbol');
/// Constant for the 'textDocument/foldingRange' method.
static const textDocument_foldingRange = Method('textDocument/foldingRange');
+ /// Constant for the 'textDocument/formatting' method.
+ static const textDocument_formatting = Method('textDocument/formatting');
+
+ /// Constant for the 'textDocument/hover' method.
+ static const textDocument_hover = Method('textDocument/hover');
+
+ /// Constant for the 'textDocument/implementation' method.
+ static const textDocument_implementation =
+ Method('textDocument/implementation');
+
+ /// Constant for the 'textDocument/inlayHint' method.
+ static const textDocument_inlayHint = Method('textDocument/inlayHint');
+
+ /// Constant for the 'textDocument/inlineValue' method.
+ static const textDocument_inlineValue = Method('textDocument/inlineValue');
+
+ /// Constant for the 'textDocument/linkedEditingRange' method.
+ static const textDocument_linkedEditingRange =
+ Method('textDocument/linkedEditingRange');
+
+ /// Constant for the 'textDocument/moniker' method.
+ static const textDocument_moniker = Method('textDocument/moniker');
+
+ /// Constant for the 'textDocument/onTypeFormatting' method.
+ static const textDocument_onTypeFormatting =
+ Method('textDocument/onTypeFormatting');
+
+ /// Constant for the 'textDocument/prepareCallHierarchy' method.
+ static const textDocument_prepareCallHierarchy =
+ Method('textDocument/prepareCallHierarchy');
+
+ /// Constant for the 'textDocument/prepareRename' method.
+ static const textDocument_prepareRename =
+ Method('textDocument/prepareRename');
+
+ /// Constant for the 'textDocument/prepareTypeHierarchy' method.
+ static const textDocument_prepareTypeHierarchy =
+ Method('textDocument/prepareTypeHierarchy');
+
+ /// Constant for the 'textDocument/publishDiagnostics' method.
+ static const textDocument_publishDiagnostics =
+ Method('textDocument/publishDiagnostics');
+
+ /// Constant for the 'textDocument/rangeFormatting' method.
+ static const textDocument_rangeFormatting =
+ Method('textDocument/rangeFormatting');
+
+ /// Constant for the 'textDocument/references' method.
+ static const textDocument_references = Method('textDocument/references');
+
+ /// Constant for the 'textDocument/rename' method.
+ static const textDocument_rename = Method('textDocument/rename');
+
/// Constant for the 'textDocument/selectionRange' method.
static const textDocument_selectionRange =
Method('textDocument/selectionRange');
- /// Constant for the 'textDocument/documentSymbol' method.
- static const textDocument_documentSymbol =
- Method('textDocument/documentSymbol');
-
/// Constant for the 'textDocument/semanticTokens/full' method.
static const textDocument_semanticTokens_full =
Method('textDocument/semanticTokens/full');
@@ -24095,132 +24135,32 @@
static const textDocument_semanticTokens_range =
Method('textDocument/semanticTokens/range');
- /// Constant for the 'workspace/semanticTokens/refresh' method.
- static const workspace_semanticTokens_refresh =
- Method('workspace/semanticTokens/refresh');
-
- /// Constant for the 'textDocument/inlayHint' method.
- static const textDocument_inlayHint = Method('textDocument/inlayHint');
-
- /// Constant for the 'inlayHint/resolve' method.
- static const inlayHint_resolve = Method('inlayHint/resolve');
-
- /// Constant for the 'workspace/inlayHint/refresh' method.
- static const workspace_inlayHint_refresh =
- Method('workspace/inlayHint/refresh');
-
- /// Constant for the 'textDocument/inlineValue' method.
- static const textDocument_inlineValue = Method('textDocument/inlineValue');
-
- /// Constant for the 'workspace/inlineValue/refresh' method.
- static const workspace_inlineValue_refresh =
- Method('workspace/inlineValue/refresh');
-
- /// Constant for the 'textDocument/moniker' method.
- static const textDocument_moniker = Method('textDocument/moniker');
-
- /// Constant for the 'textDocument/completion' method.
- static const textDocument_completion = Method('textDocument/completion');
-
- /// Constant for the 'completionItem/resolve' method.
- static const completionItem_resolve = Method('completionItem/resolve');
-
- /// Constant for the 'textDocument/publishDiagnostics' method.
- static const textDocument_publishDiagnostics =
- Method('textDocument/publishDiagnostics');
-
- /// Constant for the 'workspace/diagnostic/refresh' method.
- static const workspace_diagnostic_refresh =
- Method('workspace/diagnostic/refresh');
-
/// Constant for the 'textDocument/signatureHelp' method.
static const textDocument_signatureHelp =
Method('textDocument/signatureHelp');
- /// Constant for the 'textDocument/codeAction' method.
- static const textDocument_codeAction = Method('textDocument/codeAction');
+ /// Constant for the 'textDocument/typeDefinition' method.
+ static const textDocument_typeDefinition =
+ Method('textDocument/typeDefinition');
- /// Constant for the 'codeAction/resolve' method.
- static const codeAction_resolve = Method('codeAction/resolve');
+ /// Constant for the 'textDocument/willSave' method.
+ static const textDocument_willSave = Method('textDocument/willSave');
- /// Constant for the 'textDocument/documentColor' method.
- static const textDocument_documentColor =
- Method('textDocument/documentColor');
+ /// Constant for the 'textDocument/willSaveWaitUntil' method.
+ static const textDocument_willSaveWaitUntil =
+ Method('textDocument/willSaveWaitUntil');
- /// Constant for the 'textDocument/colorPresentation' method.
- static const textDocument_colorPresentation =
- Method('textDocument/colorPresentation');
+ /// Constant for the 'typeHierarchy/subtypes' method.
+ static const typeHierarchy_subtypes = Method('typeHierarchy/subtypes');
- /// Constant for the 'textDocument/formatting' method.
- static const textDocument_formatting = Method('textDocument/formatting');
+ /// Constant for the 'typeHierarchy/supertypes' method.
+ static const typeHierarchy_supertypes = Method('typeHierarchy/supertypes');
- /// Constant for the 'textDocument/rangeFormatting' method.
- static const textDocument_rangeFormatting =
- Method('textDocument/rangeFormatting');
+ /// Constant for the 'window/logMessage' method.
+ static const window_logMessage = Method('window/logMessage');
- /// Constant for the 'textDocument/onTypeFormatting' method.
- static const textDocument_onTypeFormatting =
- Method('textDocument/onTypeFormatting');
-
- /// Constant for the 'textDocument/rename' method.
- static const textDocument_rename = Method('textDocument/rename');
-
- /// Constant for the 'textDocument/prepareRename' method.
- static const textDocument_prepareRename =
- Method('textDocument/prepareRename');
-
- /// Constant for the 'textDocument/linkedEditingRange' method.
- static const textDocument_linkedEditingRange =
- Method('textDocument/linkedEditingRange');
-
- /// Constant for the 'workspace/symbol' method.
- static const workspace_symbol = Method('workspace/symbol');
-
- /// Constant for the 'workspaceSymbol/resolve' method.
- static const workspaceSymbol_resolve = Method('workspaceSymbol/resolve');
-
- /// Constant for the 'workspace/configuration' method.
- static const workspace_configuration = Method('workspace/configuration');
-
- /// Constant for the 'workspace/didChangeConfiguration' method.
- static const workspace_didChangeConfiguration =
- Method('workspace/didChangeConfiguration');
-
- /// Constant for the 'workspace/workspaceFolders' method.
- static const workspace_workspaceFolders =
- Method('workspace/workspaceFolders');
-
- /// Constant for the 'workspace/didChangeWorkspaceFolders' method.
- static const workspace_didChangeWorkspaceFolders =
- Method('workspace/didChangeWorkspaceFolders');
-
- /// Constant for the 'workspace/willCreateFiles' method.
- static const workspace_willCreateFiles = Method('workspace/willCreateFiles');
-
- /// Constant for the 'workspace/didCreateFiles' method.
- static const workspace_didCreateFiles = Method('workspace/didCreateFiles');
-
- /// Constant for the 'workspace/willRenameFiles' method.
- static const workspace_willRenameFiles = Method('workspace/willRenameFiles');
-
- /// Constant for the 'workspace/didRenameFiles' method.
- static const workspace_didRenameFiles = Method('workspace/didRenameFiles');
-
- /// Constant for the 'workspace/willDeleteFiles' method.
- static const workspace_willDeleteFiles = Method('workspace/willDeleteFiles');
-
- /// Constant for the 'workspace/didDeleteFiles' method.
- static const workspace_didDeleteFiles = Method('workspace/didDeleteFiles');
-
- /// Constant for the 'workspace/didChangeWatchedFiles' method.
- static const workspace_didChangeWatchedFiles =
- Method('workspace/didChangeWatchedFiles');
-
- /// Constant for the 'workspace/executeCommand' method.
- static const workspace_executeCommand = Method('workspace/executeCommand');
-
- /// Constant for the 'workspace/applyEdit' method.
- static const workspace_applyEdit = Method('workspace/applyEdit');
+ /// Constant for the 'window/showDocument' method.
+ static const window_showDocument = Method('window/showDocument');
/// Constant for the 'window/showMessage' method.
static const window_showMessage = Method('window/showMessage');
@@ -24228,22 +24168,82 @@
/// Constant for the 'window/showMessageRequest' method.
static const window_showMessageRequest = Method('window/showMessageRequest');
- /// Constant for the 'window/showDocument' method.
- static const window_showDocument = Method('window/showDocument');
-
- /// Constant for the 'window/logMessage' method.
- static const window_logMessage = Method('window/logMessage');
+ /// Constant for the 'window/workDoneProgress/cancel' method.
+ static const window_workDoneProgress_cancel =
+ Method('window/workDoneProgress/cancel');
/// Constant for the 'window/workDoneProgress/create' method.
static const window_workDoneProgress_create =
Method('window/workDoneProgress/create');
- /// Constant for the 'window/workDoneProgress/cancel' method.
- static const window_workDoneProgress_cancel =
- Method('window/workDoneProgress/cancel');
+ /// Constant for the 'workspace/applyEdit' method.
+ static const workspace_applyEdit = Method('workspace/applyEdit');
- /// Constant for the 'telemetry/event' method.
- static const telemetry_event = Method('telemetry/event');
+ /// Constant for the 'workspace/codeLens/refresh' method.
+ static const workspace_codeLens_refresh =
+ Method('workspace/codeLens/refresh');
+
+ /// Constant for the 'workspace/configuration' method.
+ static const workspace_configuration = Method('workspace/configuration');
+
+ /// Constant for the 'workspace/diagnostic/refresh' method.
+ static const workspace_diagnostic_refresh =
+ Method('workspace/diagnostic/refresh');
+
+ /// Constant for the 'workspace/didChangeConfiguration' method.
+ static const workspace_didChangeConfiguration =
+ Method('workspace/didChangeConfiguration');
+
+ /// Constant for the 'workspace/didChangeWatchedFiles' method.
+ static const workspace_didChangeWatchedFiles =
+ Method('workspace/didChangeWatchedFiles');
+
+ /// Constant for the 'workspace/didChangeWorkspaceFolders' method.
+ static const workspace_didChangeWorkspaceFolders =
+ Method('workspace/didChangeWorkspaceFolders');
+
+ /// Constant for the 'workspace/didCreateFiles' method.
+ static const workspace_didCreateFiles = Method('workspace/didCreateFiles');
+
+ /// Constant for the 'workspace/didDeleteFiles' method.
+ static const workspace_didDeleteFiles = Method('workspace/didDeleteFiles');
+
+ /// Constant for the 'workspace/didRenameFiles' method.
+ static const workspace_didRenameFiles = Method('workspace/didRenameFiles');
+
+ /// Constant for the 'workspace/executeCommand' method.
+ static const workspace_executeCommand = Method('workspace/executeCommand');
+
+ /// Constant for the 'workspace/inlayHint/refresh' method.
+ static const workspace_inlayHint_refresh =
+ Method('workspace/inlayHint/refresh');
+
+ /// Constant for the 'workspace/inlineValue/refresh' method.
+ static const workspace_inlineValue_refresh =
+ Method('workspace/inlineValue/refresh');
+
+ /// Constant for the 'workspace/semanticTokens/refresh' method.
+ static const workspace_semanticTokens_refresh =
+ Method('workspace/semanticTokens/refresh');
+
+ /// Constant for the 'workspace/symbol' method.
+ static const workspace_symbol = Method('workspace/symbol');
+
+ /// Constant for the 'workspace/willCreateFiles' method.
+ static const workspace_willCreateFiles = Method('workspace/willCreateFiles');
+
+ /// Constant for the 'workspace/willDeleteFiles' method.
+ static const workspace_willDeleteFiles = Method('workspace/willDeleteFiles');
+
+ /// Constant for the 'workspace/willRenameFiles' method.
+ static const workspace_willRenameFiles = Method('workspace/willRenameFiles');
+
+ /// Constant for the 'workspace/workspaceFolders' method.
+ static const workspace_workspaceFolders =
+ Method('workspace/workspaceFolders');
+
+ /// Constant for the 'workspaceSymbol/resolve' method.
+ static const workspaceSymbol_resolve = Method('workspaceSymbol/resolve');
Object toJson() => _value;
@@ -24475,7 +24475,7 @@
}
/// The moniker kind.
-class MonikerKind {
+class MonikerKind implements ToJsonable {
const MonikerKind(this._value);
const MonikerKind.fromJson(this._value);
@@ -24485,12 +24485,12 @@
return obj is String;
}
- /// The moniker represent a symbol that is imported into a project
- static const import = MonikerKind('import');
-
/// The moniker represents a symbol that is exported from a project
static const export = MonikerKind('export');
+ /// The moniker represent a symbol that is imported into a project
+ static const import = MonikerKind('import');
+
/// The moniker represents a symbol that is local to a project (e.g. a local
/// variable of a function, a class not visible outside the project, ...)
static const local = MonikerKind('local');
@@ -24572,9 +24572,9 @@
class MonikerParams
implements
+ PartialResultParams,
TextDocumentPositionParams,
WorkDoneProgressParams,
- PartialResultParams,
ToJsonable {
static const jsonHandler = LspJsonHandler(
MonikerParams.canParse,
@@ -24735,7 +24735,7 @@
}
class MonikerRegistrationOptions
- implements TextDocumentRegistrationOptions, MonikerOptions, ToJsonable {
+ implements MonikerOptions, TextDocumentRegistrationOptions, ToJsonable {
static const jsonHandler = LspJsonHandler(
MonikerRegistrationOptions.canParse,
MonikerRegistrationOptions.fromJson,
@@ -25106,7 +25106,7 @@
/// A notebook cell kind.
/// @since 3.17.0
-class NotebookCellKind {
+class NotebookCellKind implements ToJsonable {
const NotebookCellKind(this._value);
const NotebookCellKind.fromJson(this._value);
@@ -25116,12 +25116,12 @@
return obj is int;
}
- /// A markup-cell is formatted source that is used for display.
- static const Markup = NotebookCellKind(1);
-
/// A code-cell is source code.
static const Code = NotebookCellKind(2);
+ /// A markup-cell is formatted source that is used for display.
+ static const Markup = NotebookCellKind(1);
+
Object toJson() => _value;
@override
@@ -27297,84 +27297,84 @@
this.partialResultToken,
});
static PartialResultParams fromJson(Map<String, Object?> json) {
- if (DeclarationParams.canParse(json, nullLspJsonReporter)) {
- return DeclarationParams.fromJson(json);
+ if (CodeActionParams.canParse(json, nullLspJsonReporter)) {
+ return CodeActionParams.fromJson(json);
}
- if (DefinitionParams.canParse(json, nullLspJsonReporter)) {
- return DefinitionParams.fromJson(json);
- }
- if (TypeDefinitionParams.canParse(json, nullLspJsonReporter)) {
- return TypeDefinitionParams.fromJson(json);
- }
- if (ImplementationParams.canParse(json, nullLspJsonReporter)) {
- return ImplementationParams.fromJson(json);
- }
- if (ReferenceParams.canParse(json, nullLspJsonReporter)) {
- return ReferenceParams.fromJson(json);
- }
- if (CallHierarchyIncomingCallsParams.canParse(json, nullLspJsonReporter)) {
- return CallHierarchyIncomingCallsParams.fromJson(json);
- }
- if (CallHierarchyOutgoingCallsParams.canParse(json, nullLspJsonReporter)) {
- return CallHierarchyOutgoingCallsParams.fromJson(json);
- }
- if (TypeHierarchySupertypesParams.canParse(json, nullLspJsonReporter)) {
- return TypeHierarchySupertypesParams.fromJson(json);
- }
- if (TypeHierarchySubtypesParams.canParse(json, nullLspJsonReporter)) {
- return TypeHierarchySubtypesParams.fromJson(json);
- }
- if (DocumentHighlightParams.canParse(json, nullLspJsonReporter)) {
- return DocumentHighlightParams.fromJson(json);
- }
- if (DocumentLinkParams.canParse(json, nullLspJsonReporter)) {
- return DocumentLinkParams.fromJson(json);
- }
- if (CodeLensParams.canParse(json, nullLspJsonReporter)) {
- return CodeLensParams.fromJson(json);
- }
- if (FoldingRangeParams.canParse(json, nullLspJsonReporter)) {
- return FoldingRangeParams.fromJson(json);
+ if (ColorPresentationParams.canParse(json, nullLspJsonReporter)) {
+ return ColorPresentationParams.fromJson(json);
}
if (SelectionRangeParams.canParse(json, nullLspJsonReporter)) {
return SelectionRangeParams.fromJson(json);
}
- if (DocumentSymbolParams.canParse(json, nullLspJsonReporter)) {
- return DocumentSymbolParams.fromJson(json);
- }
- if (SemanticTokensParams.canParse(json, nullLspJsonReporter)) {
- return SemanticTokensParams.fromJson(json);
- }
if (SemanticTokensDeltaParams.canParse(json, nullLspJsonReporter)) {
return SemanticTokensDeltaParams.fromJson(json);
}
if (SemanticTokensRangeParams.canParse(json, nullLspJsonReporter)) {
return SemanticTokensRangeParams.fromJson(json);
}
- if (MonikerParams.canParse(json, nullLspJsonReporter)) {
- return MonikerParams.fromJson(json);
- }
- if (CompletionParams.canParse(json, nullLspJsonReporter)) {
- return CompletionParams.fromJson(json);
- }
if (DocumentDiagnosticParams.canParse(json, nullLspJsonReporter)) {
return DocumentDiagnosticParams.fromJson(json);
}
if (WorkspaceDiagnosticParams.canParse(json, nullLspJsonReporter)) {
return WorkspaceDiagnosticParams.fromJson(json);
}
- if (CodeActionParams.canParse(json, nullLspJsonReporter)) {
- return CodeActionParams.fromJson(json);
+ if (CallHierarchyIncomingCallsParams.canParse(json, nullLspJsonReporter)) {
+ return CallHierarchyIncomingCallsParams.fromJson(json);
+ }
+ if (CallHierarchyOutgoingCallsParams.canParse(json, nullLspJsonReporter)) {
+ return CallHierarchyOutgoingCallsParams.fromJson(json);
+ }
+ if (CodeLensParams.canParse(json, nullLspJsonReporter)) {
+ return CodeLensParams.fromJson(json);
}
if (DocumentColorParams.canParse(json, nullLspJsonReporter)) {
return DocumentColorParams.fromJson(json);
}
- if (ColorPresentationParams.canParse(json, nullLspJsonReporter)) {
- return ColorPresentationParams.fromJson(json);
+ if (DocumentLinkParams.canParse(json, nullLspJsonReporter)) {
+ return DocumentLinkParams.fromJson(json);
+ }
+ if (DocumentSymbolParams.canParse(json, nullLspJsonReporter)) {
+ return DocumentSymbolParams.fromJson(json);
+ }
+ if (FoldingRangeParams.canParse(json, nullLspJsonReporter)) {
+ return FoldingRangeParams.fromJson(json);
+ }
+ if (ReferenceParams.canParse(json, nullLspJsonReporter)) {
+ return ReferenceParams.fromJson(json);
+ }
+ if (SemanticTokensParams.canParse(json, nullLspJsonReporter)) {
+ return SemanticTokensParams.fromJson(json);
+ }
+ if (TypeHierarchySubtypesParams.canParse(json, nullLspJsonReporter)) {
+ return TypeHierarchySubtypesParams.fromJson(json);
+ }
+ if (TypeHierarchySupertypesParams.canParse(json, nullLspJsonReporter)) {
+ return TypeHierarchySupertypesParams.fromJson(json);
}
if (WorkspaceSymbolParams.canParse(json, nullLspJsonReporter)) {
return WorkspaceSymbolParams.fromJson(json);
}
+ if (CompletionParams.canParse(json, nullLspJsonReporter)) {
+ return CompletionParams.fromJson(json);
+ }
+ if (DeclarationParams.canParse(json, nullLspJsonReporter)) {
+ return DeclarationParams.fromJson(json);
+ }
+ if (DefinitionParams.canParse(json, nullLspJsonReporter)) {
+ return DefinitionParams.fromJson(json);
+ }
+ if (DocumentHighlightParams.canParse(json, nullLspJsonReporter)) {
+ return DocumentHighlightParams.fromJson(json);
+ }
+ if (ImplementationParams.canParse(json, nullLspJsonReporter)) {
+ return ImplementationParams.fromJson(json);
+ }
+ if (MonikerParams.canParse(json, nullLspJsonReporter)) {
+ return MonikerParams.fromJson(json);
+ }
+ if (TypeDefinitionParams.canParse(json, nullLspJsonReporter)) {
+ return TypeDefinitionParams.fromJson(json);
+ }
final partialResultTokenJson = json['partialResultToken'];
final partialResultToken = partialResultTokenJson == null
? null
@@ -27436,6 +27436,101 @@
String toString() => jsonEncoder.convert(toJson());
}
+class PlaceholderAndRange implements ToJsonable {
+ static const jsonHandler = LspJsonHandler(
+ PlaceholderAndRange.canParse,
+ PlaceholderAndRange.fromJson,
+ );
+
+ PlaceholderAndRange({
+ required this.placeholder,
+ required this.range,
+ });
+ static PlaceholderAndRange fromJson(Map<String, Object?> json) {
+ final placeholderJson = json['placeholder'];
+ final placeholder = placeholderJson as String;
+ final rangeJson = json['range'];
+ final range = Range.fromJson(rangeJson as Map<String, Object?>);
+ return PlaceholderAndRange(
+ placeholder: placeholder,
+ range: range,
+ );
+ }
+
+ final String placeholder;
+ final Range range;
+
+ Map<String, Object?> toJson() {
+ var __result = <String, Object?>{};
+ __result['placeholder'] = placeholder;
+ __result['range'] = range.toJson();
+ return __result;
+ }
+
+ static bool canParse(Object? obj, LspJsonReporter reporter) {
+ if (obj is Map<String, Object?>) {
+ reporter.push('placeholder');
+ try {
+ if (!obj.containsKey('placeholder')) {
+ reporter.reportError('must not be undefined');
+ return false;
+ }
+ final placeholder = obj['placeholder'];
+ if (placeholder == null) {
+ reporter.reportError('must not be null');
+ return false;
+ }
+ if (!(placeholder is String)) {
+ reporter.reportError('must be of type String');
+ return false;
+ }
+ } finally {
+ reporter.pop();
+ }
+ reporter.push('range');
+ try {
+ if (!obj.containsKey('range')) {
+ reporter.reportError('must not be undefined');
+ return false;
+ }
+ final range = obj['range'];
+ if (range == null) {
+ reporter.reportError('must not be null');
+ return false;
+ }
+ if (!(Range.canParse(range, reporter))) {
+ reporter.reportError('must be of type Range');
+ return false;
+ }
+ } finally {
+ reporter.pop();
+ }
+ return true;
+ } else {
+ reporter.reportError('must be of type PlaceholderAndRange');
+ return false;
+ }
+ }
+
+ @override
+ bool operator ==(Object other) {
+ if (other is PlaceholderAndRange &&
+ other.runtimeType == PlaceholderAndRange) {
+ return placeholder == other.placeholder && range == other.range && true;
+ }
+ return false;
+ }
+
+ @override
+ int get hashCode => Object.hash(
+ placeholder,
+ range,
+ );
+
+ @override
+ String toString() => jsonEncoder.convert(toJson());
+}
+
class Position implements ToJsonable {
static const jsonHandler = LspJsonHandler(
Position.canParse,
@@ -27539,7 +27634,7 @@
/// A set of predefined position encoding kinds.
/// @since 3.17.0
-class PositionEncodingKind {
+class PositionEncodingKind implements ToJsonable {
const PositionEncodingKind(this._value);
const PositionEncodingKind.fromJson(this._value);
@@ -27549,9 +27644,6 @@
return obj is String;
}
- /// Character offsets count UTF-8 code units.
- static const UTF8 = PositionEncodingKind('utf-8');
-
/// Character offsets count UTF-16 code units.
///
/// This is the default and must always be supported by servers
@@ -27564,6 +27656,9 @@
/// representation of character offsets.
static const UTF32 = PositionEncodingKind('utf-32');
+ /// Character offsets count UTF-8 code units.
+ static const UTF8 = PositionEncodingKind('utf-8');
+
Object toJson() => _value;
@override
@@ -27676,7 +27771,7 @@
String toString() => jsonEncoder.convert(toJson());
}
-class PrepareSupportDefaultBehavior {
+class PrepareSupportDefaultBehavior implements ToJsonable {
const PrepareSupportDefaultBehavior(this._value);
const PrepareSupportDefaultBehavior.fromJson(this._value);
@@ -28358,101 +28453,6 @@
String toString() => jsonEncoder.convert(toJson());
}
-class RangeAndPlaceholder implements ToJsonable {
- static const jsonHandler = LspJsonHandler(
- RangeAndPlaceholder.canParse,
- RangeAndPlaceholder.fromJson,
- );
-
- RangeAndPlaceholder({
- required this.placeholder,
- required this.range,
- });
- static RangeAndPlaceholder fromJson(Map<String, Object?> json) {
- final placeholderJson = json['placeholder'];
- final placeholder = placeholderJson as String;
- final rangeJson = json['range'];
- final range = Range.fromJson(rangeJson as Map<String, Object?>);
- return RangeAndPlaceholder(
- placeholder: placeholder,
- range: range,
- );
- }
-
- final String placeholder;
- final Range range;
-
- Map<String, Object?> toJson() {
- var __result = <String, Object?>{};
- __result['placeholder'] = placeholder;
- __result['range'] = range.toJson();
- return __result;
- }
-
- static bool canParse(Object? obj, LspJsonReporter reporter) {
- if (obj is Map<String, Object?>) {
- reporter.push('placeholder');
- try {
- if (!obj.containsKey('placeholder')) {
- reporter.reportError('must not be undefined');
- return false;
- }
- final placeholder = obj['placeholder'];
- if (placeholder == null) {
- reporter.reportError('must not be null');
- return false;
- }
- if (!(placeholder is String)) {
- reporter.reportError('must be of type String');
- return false;
- }
- } finally {
- reporter.pop();
- }
- reporter.push('range');
- try {
- if (!obj.containsKey('range')) {
- reporter.reportError('must not be undefined');
- return false;
- }
- final range = obj['range'];
- if (range == null) {
- reporter.reportError('must not be null');
- return false;
- }
- if (!(Range.canParse(range, reporter))) {
- reporter.reportError('must be of type Range');
- return false;
- }
- } finally {
- reporter.pop();
- }
- return true;
- } else {
- reporter.reportError('must be of type RangeAndPlaceholder');
- return false;
- }
- }
-
- @override
- bool operator ==(Object other) {
- if (other is RangeAndPlaceholder &&
- other.runtimeType == RangeAndPlaceholder) {
- return placeholder == other.placeholder && range == other.range && true;
- }
- return false;
- }
-
- @override
- int get hashCode => Object.hash(
- placeholder,
- range,
- );
-
- @override
- String toString() => jsonEncoder.convert(toJson());
-}
-
class ReferenceClientCapabilities implements ToJsonable {
static const jsonHandler = LspJsonHandler(
ReferenceClientCapabilities.canParse,
@@ -28650,9 +28650,9 @@
class ReferenceParams
implements
+ PartialResultParams,
TextDocumentPositionParams,
WorkDoneProgressParams,
- PartialResultParams,
ToJsonable {
static const jsonHandler = LspJsonHandler(
ReferenceParams.canParse,
@@ -28841,7 +28841,7 @@
}
class ReferenceRegistrationOptions
- implements TextDocumentRegistrationOptions, ReferenceOptions, ToJsonable {
+ implements ReferenceOptions, TextDocumentRegistrationOptions, ToJsonable {
static const jsonHandler = LspJsonHandler(
ReferenceRegistrationOptions.canParse,
ReferenceRegistrationOptions.fromJson,
@@ -30442,7 +30442,7 @@
}
class RenameRegistrationOptions
- implements TextDocumentRegistrationOptions, RenameOptions, ToJsonable {
+ implements RenameOptions, TextDocumentRegistrationOptions, ToJsonable {
static const jsonHandler = LspJsonHandler(
RenameRegistrationOptions.canParse,
RenameRegistrationOptions.fromJson,
@@ -30722,7 +30722,7 @@
String toString() => jsonEncoder.convert(toJson());
}
-class ResourceOperationKind {
+class ResourceOperationKind implements ToJsonable {
const ResourceOperationKind._(this._value);
const ResourceOperationKind.fromJson(this._value);
@@ -30731,8 +30731,8 @@
static bool canParse(Object? obj, LspJsonReporter reporter) {
switch (obj) {
case 'create':
- case 'rename':
case 'delete':
+ case 'rename':
return true;
}
return false;
@@ -30741,12 +30741,12 @@
/// Supports creating new files and folders.
static const Create = ResourceOperationKind._('create');
- /// Supports renaming existing files and folders.
- static const Rename = ResourceOperationKind._('rename');
-
/// Supports deleting existing files and folders.
static const Delete = ResourceOperationKind._('delete');
+ /// Supports renaming existing files and folders.
+ static const Rename = ResourceOperationKind._('rename');
+
Object toJson() => _value;
@override
@@ -31327,7 +31327,7 @@
}
class SelectionRangeParams
- implements WorkDoneProgressParams, PartialResultParams, ToJsonable {
+ implements PartialResultParams, WorkDoneProgressParams, ToJsonable {
static const jsonHandler = LspJsonHandler(
SelectionRangeParams.canParse,
SelectionRangeParams.fromJson,
@@ -31494,8 +31494,8 @@
class SelectionRangeRegistrationOptions
implements
SelectionRangeOptions,
- TextDocumentRegistrationOptions,
StaticRegistrationOptions,
+ TextDocumentRegistrationOptions,
ToJsonable {
static const jsonHandler = LspJsonHandler(
SelectionRangeRegistrationOptions.canParse,
@@ -31615,7 +31615,7 @@
String toString() => jsonEncoder.convert(toJson());
}
-class SemanticTokenModifiers {
+class SemanticTokenModifiers implements ToJsonable {
const SemanticTokenModifiers(this._value);
const SemanticTokenModifiers.fromJson(this._value);
@@ -31625,16 +31625,16 @@
return obj is String;
}
- static const declaration = SemanticTokenModifiers('declaration');
- static const definition = SemanticTokenModifiers('definition');
- static const readonly = SemanticTokenModifiers('readonly');
- static const static = SemanticTokenModifiers('static');
- static const deprecated = SemanticTokenModifiers('deprecated');
static const abstract = SemanticTokenModifiers('abstract');
static const async = SemanticTokenModifiers('async');
- static const modification = SemanticTokenModifiers('modification');
- static const documentation = SemanticTokenModifiers('documentation');
+ static const declaration = SemanticTokenModifiers('declaration');
static const defaultLibrary = SemanticTokenModifiers('defaultLibrary');
+ static const definition = SemanticTokenModifiers('definition');
+ static const deprecated = SemanticTokenModifiers('deprecated');
+ static const documentation = SemanticTokenModifiers('documentation');
+ static const modification = SemanticTokenModifiers('modification');
+ static const readonly = SemanticTokenModifiers('readonly');
+ static const static = SemanticTokenModifiers('static');
Object toJson() => _value;
@@ -31648,7 +31648,7 @@
o is SemanticTokenModifiers && o._value == _value;
}
-class SemanticTokenTypes {
+class SemanticTokenTypes implements ToJsonable {
const SemanticTokenTypes(this._value);
const SemanticTokenTypes.fromJson(this._value);
@@ -31658,31 +31658,31 @@
return obj is String;
}
+ static const class_ = SemanticTokenTypes('class');
+ static const comment = SemanticTokenTypes('comment');
+ static const enum_ = SemanticTokenTypes('enum');
+ static const enumMember = SemanticTokenTypes('enumMember');
+ static const event = SemanticTokenTypes('event');
+ static const function = SemanticTokenTypes('function');
+ static const interface = SemanticTokenTypes('interface');
+ static const keyword = SemanticTokenTypes('keyword');
+ static const macro = SemanticTokenTypes('macro');
+ static const method = SemanticTokenTypes('method');
+ static const modifier = SemanticTokenTypes('modifier');
static const namespace = SemanticTokenTypes('namespace');
+ static const number = SemanticTokenTypes('number');
+ static const operator = SemanticTokenTypes('operator');
+ static const parameter = SemanticTokenTypes('parameter');
+ static const property = SemanticTokenTypes('property');
+ static const regexp = SemanticTokenTypes('regexp');
+ static const string = SemanticTokenTypes('string');
+ static const struct = SemanticTokenTypes('struct');
/// Represents a generic type. Acts as a fallback for types which can't be
/// mapped to a specific type like class or enum.
static const type = SemanticTokenTypes('type');
- static const class_ = SemanticTokenTypes('class');
- static const enum_ = SemanticTokenTypes('enum');
- static const interface = SemanticTokenTypes('interface');
- static const struct = SemanticTokenTypes('struct');
static const typeParameter = SemanticTokenTypes('typeParameter');
- static const parameter = SemanticTokenTypes('parameter');
static const variable = SemanticTokenTypes('variable');
- static const property = SemanticTokenTypes('property');
- static const enumMember = SemanticTokenTypes('enumMember');
- static const event = SemanticTokenTypes('event');
- static const function = SemanticTokenTypes('function');
- static const method = SemanticTokenTypes('method');
- static const macro = SemanticTokenTypes('macro');
- static const keyword = SemanticTokenTypes('keyword');
- static const modifier = SemanticTokenTypes('modifier');
- static const comment = SemanticTokenTypes('comment');
- static const string = SemanticTokenTypes('string');
- static const number = SemanticTokenTypes('number');
- static const regexp = SemanticTokenTypes('regexp');
- static const operator = SemanticTokenTypes('operator');
Object toJson() => _value;
@@ -32416,7 +32416,7 @@
}
class SemanticTokensDeltaParams
- implements WorkDoneProgressParams, PartialResultParams, ToJsonable {
+ implements PartialResultParams, WorkDoneProgressParams, ToJsonable {
static const jsonHandler = LspJsonHandler(
SemanticTokensDeltaParams.canParse,
SemanticTokensDeltaParams.fromJson,
@@ -33152,7 +33152,7 @@
}
class SemanticTokensParams
- implements WorkDoneProgressParams, PartialResultParams, ToJsonable {
+ implements PartialResultParams, WorkDoneProgressParams, ToJsonable {
static const jsonHandler = LspJsonHandler(
SemanticTokensParams.canParse,
SemanticTokensParams.fromJson,
@@ -33354,7 +33354,7 @@
}
class SemanticTokensRangeParams
- implements WorkDoneProgressParams, PartialResultParams, ToJsonable {
+ implements PartialResultParams, WorkDoneProgressParams, ToJsonable {
static const jsonHandler = LspJsonHandler(
SemanticTokensRangeParams.canParse,
SemanticTokensRangeParams.fromJson,
@@ -33516,9 +33516,9 @@
class SemanticTokensRegistrationOptions
implements
- TextDocumentRegistrationOptions,
SemanticTokensOptions,
StaticRegistrationOptions,
+ TextDocumentRegistrationOptions,
ToJsonable {
static const jsonHandler = LspJsonHandler(
SemanticTokensRegistrationOptions.canParse,
@@ -37083,8 +37083,8 @@
class SignatureHelpRegistrationOptions
implements
- TextDocumentRegistrationOptions,
SignatureHelpOptions,
+ TextDocumentRegistrationOptions,
ToJsonable {
static const jsonHandler = LspJsonHandler(
SignatureHelpRegistrationOptions.canParse,
@@ -37241,7 +37241,7 @@
/// How a signature help was triggered.
/// @since 3.15.0
-class SignatureHelpTriggerKind {
+class SignatureHelpTriggerKind implements ToJsonable {
const SignatureHelpTriggerKind(this._value);
const SignatureHelpTriggerKind.fromJson(this._value);
@@ -37251,16 +37251,16 @@
return obj is int;
}
+ /// Signature help was triggered by the cursor moving or by the document
+ /// content changing.
+ static const ContentChange = SignatureHelpTriggerKind(3);
+
/// Signature help was invoked manually by the user or by a command.
static const Invoked = SignatureHelpTriggerKind(1);
/// Signature help was triggered by a trigger character.
static const TriggerCharacter = SignatureHelpTriggerKind(2);
- /// Signature help was triggered by the cursor moving or by the document
- /// content changing.
- static const ContentChange = SignatureHelpTriggerKind(3);
-
Object toJson() => _value;
@override
@@ -37446,39 +37446,11 @@
this.id,
});
static StaticRegistrationOptions fromJson(Map<String, Object?> json) {
- if (NotebookDocumentSyncRegistrationOptions.canParse(
- json, nullLspJsonReporter)) {
- return NotebookDocumentSyncRegistrationOptions.fromJson(json);
- }
- if (DeclarationRegistrationOptions.canParse(json, nullLspJsonReporter)) {
- return DeclarationRegistrationOptions.fromJson(json);
- }
- if (TypeDefinitionRegistrationOptions.canParse(json, nullLspJsonReporter)) {
- return TypeDefinitionRegistrationOptions.fromJson(json);
- }
- if (ImplementationRegistrationOptions.canParse(json, nullLspJsonReporter)) {
- return ImplementationRegistrationOptions.fromJson(json);
- }
if (CallHierarchyRegistrationOptions.canParse(json, nullLspJsonReporter)) {
return CallHierarchyRegistrationOptions.fromJson(json);
}
- if (TypeHierarchyRegistrationOptions.canParse(json, nullLspJsonReporter)) {
- return TypeHierarchyRegistrationOptions.fromJson(json);
- }
- if (FoldingRangeRegistrationOptions.canParse(json, nullLspJsonReporter)) {
- return FoldingRangeRegistrationOptions.fromJson(json);
- }
- if (SelectionRangeRegistrationOptions.canParse(json, nullLspJsonReporter)) {
- return SelectionRangeRegistrationOptions.fromJson(json);
- }
- if (SemanticTokensRegistrationOptions.canParse(json, nullLspJsonReporter)) {
- return SemanticTokensRegistrationOptions.fromJson(json);
- }
- if (InlayHintRegistrationOptions.canParse(json, nullLspJsonReporter)) {
- return InlayHintRegistrationOptions.fromJson(json);
- }
- if (InlineValueRegistrationOptions.canParse(json, nullLspJsonReporter)) {
- return InlineValueRegistrationOptions.fromJson(json);
+ if (DeclarationRegistrationOptions.canParse(json, nullLspJsonReporter)) {
+ return DeclarationRegistrationOptions.fromJson(json);
}
if (DiagnosticRegistrationOptions.canParse(json, nullLspJsonReporter)) {
return DiagnosticRegistrationOptions.fromJson(json);
@@ -37486,10 +37458,38 @@
if (DocumentColorRegistrationOptions.canParse(json, nullLspJsonReporter)) {
return DocumentColorRegistrationOptions.fromJson(json);
}
+ if (FoldingRangeRegistrationOptions.canParse(json, nullLspJsonReporter)) {
+ return FoldingRangeRegistrationOptions.fromJson(json);
+ }
+ if (ImplementationRegistrationOptions.canParse(json, nullLspJsonReporter)) {
+ return ImplementationRegistrationOptions.fromJson(json);
+ }
+ if (InlayHintRegistrationOptions.canParse(json, nullLspJsonReporter)) {
+ return InlayHintRegistrationOptions.fromJson(json);
+ }
+ if (InlineValueRegistrationOptions.canParse(json, nullLspJsonReporter)) {
+ return InlineValueRegistrationOptions.fromJson(json);
+ }
if (LinkedEditingRangeRegistrationOptions.canParse(
json, nullLspJsonReporter)) {
return LinkedEditingRangeRegistrationOptions.fromJson(json);
}
+ if (NotebookDocumentSyncRegistrationOptions.canParse(
+ json, nullLspJsonReporter)) {
+ return NotebookDocumentSyncRegistrationOptions.fromJson(json);
+ }
+ if (SelectionRangeRegistrationOptions.canParse(json, nullLspJsonReporter)) {
+ return SelectionRangeRegistrationOptions.fromJson(json);
+ }
+ if (SemanticTokensRegistrationOptions.canParse(json, nullLspJsonReporter)) {
+ return SemanticTokensRegistrationOptions.fromJson(json);
+ }
+ if (TypeDefinitionRegistrationOptions.canParse(json, nullLspJsonReporter)) {
+ return TypeDefinitionRegistrationOptions.fromJson(json);
+ }
+ if (TypeHierarchyRegistrationOptions.canParse(json, nullLspJsonReporter)) {
+ return TypeHierarchyRegistrationOptions.fromJson(json);
+ }
final idJson = json['id'];
final id = idJson as String?;
return StaticRegistrationOptions(
@@ -37758,7 +37758,7 @@
}
/// A symbol kind.
-class SymbolKind {
+class SymbolKind implements ToJsonable {
const SymbolKind(this._value);
const SymbolKind.fromJson(this._value);
@@ -37768,32 +37768,32 @@
return obj is int;
}
- static const File = SymbolKind(1);
- static const Module = SymbolKind(2);
- static const Namespace = SymbolKind(3);
- static const Package = SymbolKind(4);
+ static const Array = SymbolKind(18);
+ static const Boolean = SymbolKind(17);
static const Class = SymbolKind(5);
- static const Method = SymbolKind(6);
- static const Property = SymbolKind(7);
- static const Field = SymbolKind(8);
+ static const Constant = SymbolKind(14);
static const Constructor = SymbolKind(9);
static const Enum = SymbolKind(10);
- static const Interface = SymbolKind(11);
- static const Function = SymbolKind(12);
- static const Variable = SymbolKind(13);
- static const Constant = SymbolKind(14);
- static const Str = SymbolKind(15);
- static const Number = SymbolKind(16);
- static const Boolean = SymbolKind(17);
- static const Array = SymbolKind(18);
- static const Obj = SymbolKind(19);
- static const Key = SymbolKind(20);
- static const Null = SymbolKind(21);
static const EnumMember = SymbolKind(22);
- static const Struct = SymbolKind(23);
static const Event = SymbolKind(24);
+ static const Field = SymbolKind(8);
+ static const File = SymbolKind(1);
+ static const Function = SymbolKind(12);
+ static const Interface = SymbolKind(11);
+ static const Key = SymbolKind(20);
+ static const Method = SymbolKind(6);
+ static const Module = SymbolKind(2);
+ static const Namespace = SymbolKind(3);
+ static const Null = SymbolKind(21);
+ static const Number = SymbolKind(16);
+ static const Obj = SymbolKind(19);
static const Operator = SymbolKind(25);
+ static const Package = SymbolKind(4);
+ static const Property = SymbolKind(7);
+ static const Str = SymbolKind(15);
+ static const Struct = SymbolKind(23);
static const TypeParameter = SymbolKind(26);
+ static const Variable = SymbolKind(13);
Object toJson() => _value;
@@ -37808,7 +37808,7 @@
/// Symbol tags are extra annotations that tweak the rendering of a symbol.
/// @since 3.16
-class SymbolTag {
+class SymbolTag implements ToJsonable {
const SymbolTag(this._value);
const SymbolTag.fromJson(this._value);
@@ -39499,35 +39499,11 @@
required this.textDocument,
});
static TextDocumentPositionParams fromJson(Map<String, Object?> json) {
- if (DeclarationParams.canParse(json, nullLspJsonReporter)) {
- return DeclarationParams.fromJson(json);
- }
- if (DefinitionParams.canParse(json, nullLspJsonReporter)) {
- return DefinitionParams.fromJson(json);
- }
- if (TypeDefinitionParams.canParse(json, nullLspJsonReporter)) {
- return TypeDefinitionParams.fromJson(json);
- }
- if (ImplementationParams.canParse(json, nullLspJsonReporter)) {
- return ImplementationParams.fromJson(json);
- }
if (ReferenceParams.canParse(json, nullLspJsonReporter)) {
return ReferenceParams.fromJson(json);
}
- if (CallHierarchyPrepareParams.canParse(json, nullLspJsonReporter)) {
- return CallHierarchyPrepareParams.fromJson(json);
- }
- if (TypeHierarchyPrepareParams.canParse(json, nullLspJsonReporter)) {
- return TypeHierarchyPrepareParams.fromJson(json);
- }
- if (DocumentHighlightParams.canParse(json, nullLspJsonReporter)) {
- return DocumentHighlightParams.fromJson(json);
- }
- if (HoverParams.canParse(json, nullLspJsonReporter)) {
- return HoverParams.fromJson(json);
- }
- if (MonikerParams.canParse(json, nullLspJsonReporter)) {
- return MonikerParams.fromJson(json);
+ if (RenameParams.canParse(json, nullLspJsonReporter)) {
+ return RenameParams.fromJson(json);
}
if (CompletionParams.canParse(json, nullLspJsonReporter)) {
return CompletionParams.fromJson(json);
@@ -39535,14 +39511,38 @@
if (SignatureHelpParams.canParse(json, nullLspJsonReporter)) {
return SignatureHelpParams.fromJson(json);
}
- if (RenameParams.canParse(json, nullLspJsonReporter)) {
- return RenameParams.fromJson(json);
+ if (CallHierarchyPrepareParams.canParse(json, nullLspJsonReporter)) {
+ return CallHierarchyPrepareParams.fromJson(json);
+ }
+ if (DeclarationParams.canParse(json, nullLspJsonReporter)) {
+ return DeclarationParams.fromJson(json);
+ }
+ if (DefinitionParams.canParse(json, nullLspJsonReporter)) {
+ return DefinitionParams.fromJson(json);
+ }
+ if (DocumentHighlightParams.canParse(json, nullLspJsonReporter)) {
+ return DocumentHighlightParams.fromJson(json);
+ }
+ if (HoverParams.canParse(json, nullLspJsonReporter)) {
+ return HoverParams.fromJson(json);
+ }
+ if (ImplementationParams.canParse(json, nullLspJsonReporter)) {
+ return ImplementationParams.fromJson(json);
+ }
+ if (LinkedEditingRangeParams.canParse(json, nullLspJsonReporter)) {
+ return LinkedEditingRangeParams.fromJson(json);
+ }
+ if (MonikerParams.canParse(json, nullLspJsonReporter)) {
+ return MonikerParams.fromJson(json);
}
if (PrepareRenameParams.canParse(json, nullLspJsonReporter)) {
return PrepareRenameParams.fromJson(json);
}
- if (LinkedEditingRangeParams.canParse(json, nullLspJsonReporter)) {
- return LinkedEditingRangeParams.fromJson(json);
+ if (TypeDefinitionParams.canParse(json, nullLspJsonReporter)) {
+ return TypeDefinitionParams.fromJson(json);
+ }
+ if (TypeHierarchyPrepareParams.canParse(json, nullLspJsonReporter)) {
+ return TypeHierarchyPrepareParams.fromJson(json);
}
final positionJson = json['position'];
final position = Position.fromJson(positionJson as Map<String, Object?>);
@@ -39653,73 +39653,27 @@
json, nullLspJsonReporter)) {
return TextDocumentSaveRegistrationOptions.fromJson(json);
}
+ if (CallHierarchyRegistrationOptions.canParse(json, nullLspJsonReporter)) {
+ return CallHierarchyRegistrationOptions.fromJson(json);
+ }
+ if (CodeActionRegistrationOptions.canParse(json, nullLspJsonReporter)) {
+ return CodeActionRegistrationOptions.fromJson(json);
+ }
+ if (CodeLensRegistrationOptions.canParse(json, nullLspJsonReporter)) {
+ return CodeLensRegistrationOptions.fromJson(json);
+ }
+ if (CompletionRegistrationOptions.canParse(json, nullLspJsonReporter)) {
+ return CompletionRegistrationOptions.fromJson(json);
+ }
if (DeclarationRegistrationOptions.canParse(json, nullLspJsonReporter)) {
return DeclarationRegistrationOptions.fromJson(json);
}
if (DefinitionRegistrationOptions.canParse(json, nullLspJsonReporter)) {
return DefinitionRegistrationOptions.fromJson(json);
}
- if (TypeDefinitionRegistrationOptions.canParse(json, nullLspJsonReporter)) {
- return TypeDefinitionRegistrationOptions.fromJson(json);
- }
- if (ImplementationRegistrationOptions.canParse(json, nullLspJsonReporter)) {
- return ImplementationRegistrationOptions.fromJson(json);
- }
- if (ReferenceRegistrationOptions.canParse(json, nullLspJsonReporter)) {
- return ReferenceRegistrationOptions.fromJson(json);
- }
- if (CallHierarchyRegistrationOptions.canParse(json, nullLspJsonReporter)) {
- return CallHierarchyRegistrationOptions.fromJson(json);
- }
- if (TypeHierarchyRegistrationOptions.canParse(json, nullLspJsonReporter)) {
- return TypeHierarchyRegistrationOptions.fromJson(json);
- }
- if (DocumentHighlightRegistrationOptions.canParse(
- json, nullLspJsonReporter)) {
- return DocumentHighlightRegistrationOptions.fromJson(json);
- }
- if (DocumentLinkRegistrationOptions.canParse(json, nullLspJsonReporter)) {
- return DocumentLinkRegistrationOptions.fromJson(json);
- }
- if (HoverRegistrationOptions.canParse(json, nullLspJsonReporter)) {
- return HoverRegistrationOptions.fromJson(json);
- }
- if (CodeLensRegistrationOptions.canParse(json, nullLspJsonReporter)) {
- return CodeLensRegistrationOptions.fromJson(json);
- }
- if (FoldingRangeRegistrationOptions.canParse(json, nullLspJsonReporter)) {
- return FoldingRangeRegistrationOptions.fromJson(json);
- }
- if (SelectionRangeRegistrationOptions.canParse(json, nullLspJsonReporter)) {
- return SelectionRangeRegistrationOptions.fromJson(json);
- }
- if (DocumentSymbolRegistrationOptions.canParse(json, nullLspJsonReporter)) {
- return DocumentSymbolRegistrationOptions.fromJson(json);
- }
- if (SemanticTokensRegistrationOptions.canParse(json, nullLspJsonReporter)) {
- return SemanticTokensRegistrationOptions.fromJson(json);
- }
- if (InlayHintRegistrationOptions.canParse(json, nullLspJsonReporter)) {
- return InlayHintRegistrationOptions.fromJson(json);
- }
- if (InlineValueRegistrationOptions.canParse(json, nullLspJsonReporter)) {
- return InlineValueRegistrationOptions.fromJson(json);
- }
- if (MonikerRegistrationOptions.canParse(json, nullLspJsonReporter)) {
- return MonikerRegistrationOptions.fromJson(json);
- }
- if (CompletionRegistrationOptions.canParse(json, nullLspJsonReporter)) {
- return CompletionRegistrationOptions.fromJson(json);
- }
if (DiagnosticRegistrationOptions.canParse(json, nullLspJsonReporter)) {
return DiagnosticRegistrationOptions.fromJson(json);
}
- if (SignatureHelpRegistrationOptions.canParse(json, nullLspJsonReporter)) {
- return SignatureHelpRegistrationOptions.fromJson(json);
- }
- if (CodeActionRegistrationOptions.canParse(json, nullLspJsonReporter)) {
- return CodeActionRegistrationOptions.fromJson(json);
- }
if (DocumentColorRegistrationOptions.canParse(json, nullLspJsonReporter)) {
return DocumentColorRegistrationOptions.fromJson(json);
}
@@ -39727,21 +39681,67 @@
json, nullLspJsonReporter)) {
return DocumentFormattingRegistrationOptions.fromJson(json);
}
- if (DocumentRangeFormattingRegistrationOptions.canParse(
+ if (DocumentHighlightRegistrationOptions.canParse(
json, nullLspJsonReporter)) {
- return DocumentRangeFormattingRegistrationOptions.fromJson(json);
+ return DocumentHighlightRegistrationOptions.fromJson(json);
+ }
+ if (DocumentLinkRegistrationOptions.canParse(json, nullLspJsonReporter)) {
+ return DocumentLinkRegistrationOptions.fromJson(json);
}
if (DocumentOnTypeFormattingRegistrationOptions.canParse(
json, nullLspJsonReporter)) {
return DocumentOnTypeFormattingRegistrationOptions.fromJson(json);
}
- if (RenameRegistrationOptions.canParse(json, nullLspJsonReporter)) {
- return RenameRegistrationOptions.fromJson(json);
+ if (DocumentRangeFormattingRegistrationOptions.canParse(
+ json, nullLspJsonReporter)) {
+ return DocumentRangeFormattingRegistrationOptions.fromJson(json);
+ }
+ if (DocumentSymbolRegistrationOptions.canParse(json, nullLspJsonReporter)) {
+ return DocumentSymbolRegistrationOptions.fromJson(json);
+ }
+ if (FoldingRangeRegistrationOptions.canParse(json, nullLspJsonReporter)) {
+ return FoldingRangeRegistrationOptions.fromJson(json);
+ }
+ if (HoverRegistrationOptions.canParse(json, nullLspJsonReporter)) {
+ return HoverRegistrationOptions.fromJson(json);
+ }
+ if (ImplementationRegistrationOptions.canParse(json, nullLspJsonReporter)) {
+ return ImplementationRegistrationOptions.fromJson(json);
+ }
+ if (InlayHintRegistrationOptions.canParse(json, nullLspJsonReporter)) {
+ return InlayHintRegistrationOptions.fromJson(json);
+ }
+ if (InlineValueRegistrationOptions.canParse(json, nullLspJsonReporter)) {
+ return InlineValueRegistrationOptions.fromJson(json);
}
if (LinkedEditingRangeRegistrationOptions.canParse(
json, nullLspJsonReporter)) {
return LinkedEditingRangeRegistrationOptions.fromJson(json);
}
+ if (MonikerRegistrationOptions.canParse(json, nullLspJsonReporter)) {
+ return MonikerRegistrationOptions.fromJson(json);
+ }
+ if (ReferenceRegistrationOptions.canParse(json, nullLspJsonReporter)) {
+ return ReferenceRegistrationOptions.fromJson(json);
+ }
+ if (RenameRegistrationOptions.canParse(json, nullLspJsonReporter)) {
+ return RenameRegistrationOptions.fromJson(json);
+ }
+ if (SelectionRangeRegistrationOptions.canParse(json, nullLspJsonReporter)) {
+ return SelectionRangeRegistrationOptions.fromJson(json);
+ }
+ if (SemanticTokensRegistrationOptions.canParse(json, nullLspJsonReporter)) {
+ return SemanticTokensRegistrationOptions.fromJson(json);
+ }
+ if (SignatureHelpRegistrationOptions.canParse(json, nullLspJsonReporter)) {
+ return SignatureHelpRegistrationOptions.fromJson(json);
+ }
+ if (TypeDefinitionRegistrationOptions.canParse(json, nullLspJsonReporter)) {
+ return TypeDefinitionRegistrationOptions.fromJson(json);
+ }
+ if (TypeHierarchyRegistrationOptions.canParse(json, nullLspJsonReporter)) {
+ return TypeHierarchyRegistrationOptions.fromJson(json);
+ }
final documentSelectorJson = json['documentSelector'];
final documentSelector = (documentSelectorJson as List<Object?>?)
?.map(
@@ -39807,7 +39807,7 @@
}
/// Represents reasons why a text document is saved.
-class TextDocumentSaveReason {
+class TextDocumentSaveReason implements ToJsonable {
const TextDocumentSaveReason(this._value);
const TextDocumentSaveReason.fromJson(this._value);
@@ -39817,16 +39817,16 @@
return obj is int;
}
- /// Manually triggered, e.g. by the user pressing save, by starting debugging,
- /// or by an API call.
- static const Manual = TextDocumentSaveReason(1);
-
/// Automatic after a delay.
static const AfterDelay = TextDocumentSaveReason(2);
/// When the editor lost focus.
static const FocusOut = TextDocumentSaveReason(3);
+ /// Manually triggered, e.g. by the user pressing save, by starting debugging,
+ /// or by an API call.
+ static const Manual = TextDocumentSaveReason(1);
+
Object toJson() => _value;
@override
@@ -40078,7 +40078,7 @@
/// Defines how the host (editor) should sync document changes to the language
/// server.
-class TextDocumentSyncKind {
+class TextDocumentSyncKind implements ToJsonable {
const TextDocumentSyncKind(this._value);
const TextDocumentSyncKind.fromJson(this._value);
@@ -40088,9 +40088,6 @@
return obj is int;
}
- /// Documents should not be synced at all.
- static const None = TextDocumentSyncKind(0);
-
/// Documents are synced by always sending the full content of the document.
static const Full = TextDocumentSyncKind(1);
@@ -40098,6 +40095,9 @@
/// incremental updates to the document are send.
static const Incremental = TextDocumentSyncKind(2);
+ /// Documents should not be synced at all.
+ static const None = TextDocumentSyncKind(0);
+
Object toJson() => _value;
@override
@@ -40385,7 +40385,7 @@
String toString() => jsonEncoder.convert(toJson());
}
-class TokenFormat {
+class TokenFormat implements ToJsonable {
const TokenFormat(this._value);
const TokenFormat.fromJson(this._value);
@@ -40566,9 +40566,9 @@
class TypeDefinitionParams
implements
+ PartialResultParams,
TextDocumentPositionParams,
WorkDoneProgressParams,
- PartialResultParams,
ToJsonable {
static const jsonHandler = LspJsonHandler(
TypeDefinitionParams.canParse,
@@ -40731,9 +40731,9 @@
class TypeDefinitionRegistrationOptions
implements
+ StaticRegistrationOptions,
TextDocumentRegistrationOptions,
TypeDefinitionOptions,
- StaticRegistrationOptions,
ToJsonable {
static const jsonHandler = LspJsonHandler(
TypeDefinitionRegistrationOptions.canParse,
@@ -41367,9 +41367,9 @@
class TypeHierarchyRegistrationOptions
implements
+ StaticRegistrationOptions,
TextDocumentRegistrationOptions,
TypeHierarchyOptions,
- StaticRegistrationOptions,
ToJsonable {
static const jsonHandler = LspJsonHandler(
TypeHierarchyRegistrationOptions.canParse,
@@ -41490,7 +41490,7 @@
}
class TypeHierarchySubtypesParams
- implements WorkDoneProgressParams, PartialResultParams, ToJsonable {
+ implements PartialResultParams, WorkDoneProgressParams, ToJsonable {
static const jsonHandler = LspJsonHandler(
TypeHierarchySubtypesParams.canParse,
TypeHierarchySubtypesParams.fromJson,
@@ -41621,7 +41621,7 @@
}
class TypeHierarchySupertypesParams
- implements WorkDoneProgressParams, PartialResultParams, ToJsonable {
+ implements PartialResultParams, WorkDoneProgressParams, ToJsonable {
static const jsonHandler = LspJsonHandler(
TypeHierarchySupertypesParams.canParse,
TypeHierarchySupertypesParams.fromJson,
@@ -41769,14 +41769,14 @@
}
}
static UnchangedDocumentDiagnosticReport fromJson(Map<String, Object?> json) {
- if (RelatedUnchangedDocumentDiagnosticReport.canParse(
- json, nullLspJsonReporter)) {
- return RelatedUnchangedDocumentDiagnosticReport.fromJson(json);
- }
if (WorkspaceUnchangedDocumentDiagnosticReport.canParse(
json, nullLspJsonReporter)) {
return WorkspaceUnchangedDocumentDiagnosticReport.fromJson(json);
}
+ if (RelatedUnchangedDocumentDiagnosticReport.canParse(
+ json, nullLspJsonReporter)) {
+ return RelatedUnchangedDocumentDiagnosticReport.fromJson(json);
+ }
final kindJson = json['kind'];
final kind = kindJson as String;
final resultIdJson = json['resultId'];
@@ -41867,7 +41867,7 @@
}
/// Moniker uniqueness level to define scope of the moniker.
-class UniquenessLevel {
+class UniquenessLevel implements ToJsonable {
const UniquenessLevel(this._value);
const UniquenessLevel.fromJson(this._value);
@@ -41880,18 +41880,18 @@
/// The moniker is only unique inside a document
static const document = UniquenessLevel('document');
- /// The moniker is unique inside a project for which a dump got created
- static const project = UniquenessLevel('project');
+ /// The moniker is globally unique
+ static const global = UniquenessLevel('global');
/// The moniker is unique inside the group to which a project belongs
static const group = UniquenessLevel('group');
+ /// The moniker is unique inside a project for which a dump got created
+ static const project = UniquenessLevel('project');
+
/// The moniker is unique inside the moniker scheme.
static const scheme = UniquenessLevel('scheme');
- /// The moniker is globally unique
- static const global = UniquenessLevel('global');
-
Object toJson() => _value;
@override
@@ -42284,7 +42284,7 @@
String toString() => jsonEncoder.convert(toJson());
}
-class WatchKind {
+class WatchKind implements ToJsonable {
const WatchKind(this._value);
const WatchKind.fromJson(this._value);
@@ -42294,12 +42294,12 @@
return obj is int;
}
- /// Interested in create events.
- static const Create = WatchKind(1);
-
/// Interested in change events
static const Change = WatchKind(2);
+ /// Interested in create events.
+ static const Create = WatchKind(1);
+
/// Interested in delete events
static const Delete = WatchKind(4);
@@ -42980,92 +42980,92 @@
this.workDoneProgress,
});
static WorkDoneProgressOptions fromJson(Map<String, Object?> json) {
+ if (DiagnosticOptions.canParse(json, nullLspJsonReporter)) {
+ return DiagnosticOptions.fromJson(json);
+ }
+ if (SemanticTokensOptions.canParse(json, nullLspJsonReporter)) {
+ return SemanticTokensOptions.fromJson(json);
+ }
+ if (ExecuteCommandOptions.canParse(json, nullLspJsonReporter)) {
+ return ExecuteCommandOptions.fromJson(json);
+ }
+ if (CompletionOptions.canParse(json, nullLspJsonReporter)) {
+ return CompletionOptions.fromJson(json);
+ }
+ if (CodeActionOptions.canParse(json, nullLspJsonReporter)) {
+ return CodeActionOptions.fromJson(json);
+ }
+ if (SignatureHelpOptions.canParse(json, nullLspJsonReporter)) {
+ return SignatureHelpOptions.fromJson(json);
+ }
+ if (CodeLensOptions.canParse(json, nullLspJsonReporter)) {
+ return CodeLensOptions.fromJson(json);
+ }
+ if (DocumentLinkOptions.canParse(json, nullLspJsonReporter)) {
+ return DocumentLinkOptions.fromJson(json);
+ }
+ if (DocumentSymbolOptions.canParse(json, nullLspJsonReporter)) {
+ return DocumentSymbolOptions.fromJson(json);
+ }
+ if (InlayHintOptions.canParse(json, nullLspJsonReporter)) {
+ return InlayHintOptions.fromJson(json);
+ }
+ if (RenameOptions.canParse(json, nullLspJsonReporter)) {
+ return RenameOptions.fromJson(json);
+ }
+ if (WorkspaceSymbolOptions.canParse(json, nullLspJsonReporter)) {
+ return WorkspaceSymbolOptions.fromJson(json);
+ }
+ if (CallHierarchyOptions.canParse(json, nullLspJsonReporter)) {
+ return CallHierarchyOptions.fromJson(json);
+ }
if (DeclarationOptions.canParse(json, nullLspJsonReporter)) {
return DeclarationOptions.fromJson(json);
}
if (DefinitionOptions.canParse(json, nullLspJsonReporter)) {
return DefinitionOptions.fromJson(json);
}
- if (TypeDefinitionOptions.canParse(json, nullLspJsonReporter)) {
- return TypeDefinitionOptions.fromJson(json);
- }
- if (ImplementationOptions.canParse(json, nullLspJsonReporter)) {
- return ImplementationOptions.fromJson(json);
- }
- if (ReferenceOptions.canParse(json, nullLspJsonReporter)) {
- return ReferenceOptions.fromJson(json);
- }
- if (CallHierarchyOptions.canParse(json, nullLspJsonReporter)) {
- return CallHierarchyOptions.fromJson(json);
- }
- if (TypeHierarchyOptions.canParse(json, nullLspJsonReporter)) {
- return TypeHierarchyOptions.fromJson(json);
- }
- if (DocumentHighlightOptions.canParse(json, nullLspJsonReporter)) {
- return DocumentHighlightOptions.fromJson(json);
- }
- if (DocumentLinkOptions.canParse(json, nullLspJsonReporter)) {
- return DocumentLinkOptions.fromJson(json);
- }
- if (HoverOptions.canParse(json, nullLspJsonReporter)) {
- return HoverOptions.fromJson(json);
- }
- if (CodeLensOptions.canParse(json, nullLspJsonReporter)) {
- return CodeLensOptions.fromJson(json);
- }
- if (FoldingRangeOptions.canParse(json, nullLspJsonReporter)) {
- return FoldingRangeOptions.fromJson(json);
- }
- if (SelectionRangeOptions.canParse(json, nullLspJsonReporter)) {
- return SelectionRangeOptions.fromJson(json);
- }
- if (DocumentSymbolOptions.canParse(json, nullLspJsonReporter)) {
- return DocumentSymbolOptions.fromJson(json);
- }
- if (SemanticTokensOptions.canParse(json, nullLspJsonReporter)) {
- return SemanticTokensOptions.fromJson(json);
- }
- if (InlayHintOptions.canParse(json, nullLspJsonReporter)) {
- return InlayHintOptions.fromJson(json);
- }
- if (InlineValueOptions.canParse(json, nullLspJsonReporter)) {
- return InlineValueOptions.fromJson(json);
- }
- if (MonikerOptions.canParse(json, nullLspJsonReporter)) {
- return MonikerOptions.fromJson(json);
- }
- if (CompletionOptions.canParse(json, nullLspJsonReporter)) {
- return CompletionOptions.fromJson(json);
- }
- if (DiagnosticOptions.canParse(json, nullLspJsonReporter)) {
- return DiagnosticOptions.fromJson(json);
- }
- if (SignatureHelpOptions.canParse(json, nullLspJsonReporter)) {
- return SignatureHelpOptions.fromJson(json);
- }
- if (CodeActionOptions.canParse(json, nullLspJsonReporter)) {
- return CodeActionOptions.fromJson(json);
- }
if (DocumentColorOptions.canParse(json, nullLspJsonReporter)) {
return DocumentColorOptions.fromJson(json);
}
if (DocumentFormattingOptions.canParse(json, nullLspJsonReporter)) {
return DocumentFormattingOptions.fromJson(json);
}
+ if (DocumentHighlightOptions.canParse(json, nullLspJsonReporter)) {
+ return DocumentHighlightOptions.fromJson(json);
+ }
if (DocumentRangeFormattingOptions.canParse(json, nullLspJsonReporter)) {
return DocumentRangeFormattingOptions.fromJson(json);
}
- if (RenameOptions.canParse(json, nullLspJsonReporter)) {
- return RenameOptions.fromJson(json);
+ if (FoldingRangeOptions.canParse(json, nullLspJsonReporter)) {
+ return FoldingRangeOptions.fromJson(json);
+ }
+ if (HoverOptions.canParse(json, nullLspJsonReporter)) {
+ return HoverOptions.fromJson(json);
+ }
+ if (ImplementationOptions.canParse(json, nullLspJsonReporter)) {
+ return ImplementationOptions.fromJson(json);
+ }
+ if (InlineValueOptions.canParse(json, nullLspJsonReporter)) {
+ return InlineValueOptions.fromJson(json);
}
if (LinkedEditingRangeOptions.canParse(json, nullLspJsonReporter)) {
return LinkedEditingRangeOptions.fromJson(json);
}
- if (WorkspaceSymbolOptions.canParse(json, nullLspJsonReporter)) {
- return WorkspaceSymbolOptions.fromJson(json);
+ if (MonikerOptions.canParse(json, nullLspJsonReporter)) {
+ return MonikerOptions.fromJson(json);
}
- if (ExecuteCommandOptions.canParse(json, nullLspJsonReporter)) {
- return ExecuteCommandOptions.fromJson(json);
+ if (ReferenceOptions.canParse(json, nullLspJsonReporter)) {
+ return ReferenceOptions.fromJson(json);
+ }
+ if (SelectionRangeOptions.canParse(json, nullLspJsonReporter)) {
+ return SelectionRangeOptions.fromJson(json);
+ }
+ if (TypeDefinitionOptions.canParse(json, nullLspJsonReporter)) {
+ return TypeDefinitionOptions.fromJson(json);
+ }
+ if (TypeHierarchyOptions.canParse(json, nullLspJsonReporter)) {
+ return TypeHierarchyOptions.fromJson(json);
}
final workDoneProgressJson = json['workDoneProgress'];
final workDoneProgress = workDoneProgressJson as bool?;
@@ -43129,119 +43129,119 @@
this.workDoneToken,
});
static WorkDoneProgressParams fromJson(Map<String, Object?> json) {
- if (InitializeParams.canParse(json, nullLspJsonReporter)) {
- return InitializeParams.fromJson(json);
+ if (CodeActionParams.canParse(json, nullLspJsonReporter)) {
+ return CodeActionParams.fromJson(json);
}
- if (DeclarationParams.canParse(json, nullLspJsonReporter)) {
- return DeclarationParams.fromJson(json);
+ if (ColorPresentationParams.canParse(json, nullLspJsonReporter)) {
+ return ColorPresentationParams.fromJson(json);
}
- if (DefinitionParams.canParse(json, nullLspJsonReporter)) {
- return DefinitionParams.fromJson(json);
+ if (DocumentRangeFormattingParams.canParse(json, nullLspJsonReporter)) {
+ return DocumentRangeFormattingParams.fromJson(json);
}
- if (TypeDefinitionParams.canParse(json, nullLspJsonReporter)) {
- return TypeDefinitionParams.fromJson(json);
+ if (InlineValueParams.canParse(json, nullLspJsonReporter)) {
+ return InlineValueParams.fromJson(json);
}
- if (ImplementationParams.canParse(json, nullLspJsonReporter)) {
- return ImplementationParams.fromJson(json);
+ if (DocumentFormattingParams.canParse(json, nullLspJsonReporter)) {
+ return DocumentFormattingParams.fromJson(json);
}
- if (ReferenceParams.canParse(json, nullLspJsonReporter)) {
- return ReferenceParams.fromJson(json);
- }
- if (CallHierarchyPrepareParams.canParse(json, nullLspJsonReporter)) {
- return CallHierarchyPrepareParams.fromJson(json);
- }
- if (CallHierarchyIncomingCallsParams.canParse(json, nullLspJsonReporter)) {
- return CallHierarchyIncomingCallsParams.fromJson(json);
- }
- if (CallHierarchyOutgoingCallsParams.canParse(json, nullLspJsonReporter)) {
- return CallHierarchyOutgoingCallsParams.fromJson(json);
- }
- if (TypeHierarchyPrepareParams.canParse(json, nullLspJsonReporter)) {
- return TypeHierarchyPrepareParams.fromJson(json);
- }
- if (TypeHierarchySupertypesParams.canParse(json, nullLspJsonReporter)) {
- return TypeHierarchySupertypesParams.fromJson(json);
- }
- if (TypeHierarchySubtypesParams.canParse(json, nullLspJsonReporter)) {
- return TypeHierarchySubtypesParams.fromJson(json);
- }
- if (DocumentHighlightParams.canParse(json, nullLspJsonReporter)) {
- return DocumentHighlightParams.fromJson(json);
- }
- if (DocumentLinkParams.canParse(json, nullLspJsonReporter)) {
- return DocumentLinkParams.fromJson(json);
- }
- if (HoverParams.canParse(json, nullLspJsonReporter)) {
- return HoverParams.fromJson(json);
- }
- if (CodeLensParams.canParse(json, nullLspJsonReporter)) {
- return CodeLensParams.fromJson(json);
- }
- if (FoldingRangeParams.canParse(json, nullLspJsonReporter)) {
- return FoldingRangeParams.fromJson(json);
+ if (InlayHintParams.canParse(json, nullLspJsonReporter)) {
+ return InlayHintParams.fromJson(json);
}
if (SelectionRangeParams.canParse(json, nullLspJsonReporter)) {
return SelectionRangeParams.fromJson(json);
}
- if (DocumentSymbolParams.canParse(json, nullLspJsonReporter)) {
- return DocumentSymbolParams.fromJson(json);
- }
- if (SemanticTokensParams.canParse(json, nullLspJsonReporter)) {
- return SemanticTokensParams.fromJson(json);
- }
if (SemanticTokensDeltaParams.canParse(json, nullLspJsonReporter)) {
return SemanticTokensDeltaParams.fromJson(json);
}
if (SemanticTokensRangeParams.canParse(json, nullLspJsonReporter)) {
return SemanticTokensRangeParams.fromJson(json);
}
- if (InlayHintParams.canParse(json, nullLspJsonReporter)) {
- return InlayHintParams.fromJson(json);
- }
- if (InlineValueParams.canParse(json, nullLspJsonReporter)) {
- return InlineValueParams.fromJson(json);
- }
- if (MonikerParams.canParse(json, nullLspJsonReporter)) {
- return MonikerParams.fromJson(json);
- }
- if (CompletionParams.canParse(json, nullLspJsonReporter)) {
- return CompletionParams.fromJson(json);
+ if (InitializeParams.canParse(json, nullLspJsonReporter)) {
+ return InitializeParams.fromJson(json);
}
if (DocumentDiagnosticParams.canParse(json, nullLspJsonReporter)) {
return DocumentDiagnosticParams.fromJson(json);
}
+ if (ExecuteCommandParams.canParse(json, nullLspJsonReporter)) {
+ return ExecuteCommandParams.fromJson(json);
+ }
if (WorkspaceDiagnosticParams.canParse(json, nullLspJsonReporter)) {
return WorkspaceDiagnosticParams.fromJson(json);
}
- if (SignatureHelpParams.canParse(json, nullLspJsonReporter)) {
- return SignatureHelpParams.fromJson(json);
+ if (CallHierarchyIncomingCallsParams.canParse(json, nullLspJsonReporter)) {
+ return CallHierarchyIncomingCallsParams.fromJson(json);
}
- if (CodeActionParams.canParse(json, nullLspJsonReporter)) {
- return CodeActionParams.fromJson(json);
+ if (CallHierarchyOutgoingCallsParams.canParse(json, nullLspJsonReporter)) {
+ return CallHierarchyOutgoingCallsParams.fromJson(json);
+ }
+ if (CodeLensParams.canParse(json, nullLspJsonReporter)) {
+ return CodeLensParams.fromJson(json);
}
if (DocumentColorParams.canParse(json, nullLspJsonReporter)) {
return DocumentColorParams.fromJson(json);
}
- if (ColorPresentationParams.canParse(json, nullLspJsonReporter)) {
- return ColorPresentationParams.fromJson(json);
+ if (DocumentLinkParams.canParse(json, nullLspJsonReporter)) {
+ return DocumentLinkParams.fromJson(json);
}
- if (DocumentFormattingParams.canParse(json, nullLspJsonReporter)) {
- return DocumentFormattingParams.fromJson(json);
+ if (DocumentSymbolParams.canParse(json, nullLspJsonReporter)) {
+ return DocumentSymbolParams.fromJson(json);
}
- if (DocumentRangeFormattingParams.canParse(json, nullLspJsonReporter)) {
- return DocumentRangeFormattingParams.fromJson(json);
+ if (FoldingRangeParams.canParse(json, nullLspJsonReporter)) {
+ return FoldingRangeParams.fromJson(json);
+ }
+ if (ReferenceParams.canParse(json, nullLspJsonReporter)) {
+ return ReferenceParams.fromJson(json);
}
if (RenameParams.canParse(json, nullLspJsonReporter)) {
return RenameParams.fromJson(json);
}
- if (LinkedEditingRangeParams.canParse(json, nullLspJsonReporter)) {
- return LinkedEditingRangeParams.fromJson(json);
+ if (SemanticTokensParams.canParse(json, nullLspJsonReporter)) {
+ return SemanticTokensParams.fromJson(json);
+ }
+ if (TypeHierarchySubtypesParams.canParse(json, nullLspJsonReporter)) {
+ return TypeHierarchySubtypesParams.fromJson(json);
+ }
+ if (TypeHierarchySupertypesParams.canParse(json, nullLspJsonReporter)) {
+ return TypeHierarchySupertypesParams.fromJson(json);
}
if (WorkspaceSymbolParams.canParse(json, nullLspJsonReporter)) {
return WorkspaceSymbolParams.fromJson(json);
}
- if (ExecuteCommandParams.canParse(json, nullLspJsonReporter)) {
- return ExecuteCommandParams.fromJson(json);
+ if (CompletionParams.canParse(json, nullLspJsonReporter)) {
+ return CompletionParams.fromJson(json);
+ }
+ if (SignatureHelpParams.canParse(json, nullLspJsonReporter)) {
+ return SignatureHelpParams.fromJson(json);
+ }
+ if (CallHierarchyPrepareParams.canParse(json, nullLspJsonReporter)) {
+ return CallHierarchyPrepareParams.fromJson(json);
+ }
+ if (DeclarationParams.canParse(json, nullLspJsonReporter)) {
+ return DeclarationParams.fromJson(json);
+ }
+ if (DefinitionParams.canParse(json, nullLspJsonReporter)) {
+ return DefinitionParams.fromJson(json);
+ }
+ if (DocumentHighlightParams.canParse(json, nullLspJsonReporter)) {
+ return DocumentHighlightParams.fromJson(json);
+ }
+ if (HoverParams.canParse(json, nullLspJsonReporter)) {
+ return HoverParams.fromJson(json);
+ }
+ if (ImplementationParams.canParse(json, nullLspJsonReporter)) {
+ return ImplementationParams.fromJson(json);
+ }
+ if (LinkedEditingRangeParams.canParse(json, nullLspJsonReporter)) {
+ return LinkedEditingRangeParams.fromJson(json);
+ }
+ if (MonikerParams.canParse(json, nullLspJsonReporter)) {
+ return MonikerParams.fromJson(json);
+ }
+ if (TypeDefinitionParams.canParse(json, nullLspJsonReporter)) {
+ return TypeDefinitionParams.fromJson(json);
+ }
+ if (TypeHierarchyPrepareParams.canParse(json, nullLspJsonReporter)) {
+ return TypeHierarchyPrepareParams.fromJson(json);
}
final workDoneTokenJson = json['workDoneToken'];
final workDoneToken = workDoneTokenJson == null
@@ -43888,7 +43888,7 @@
/// Parameters of the workspace diagnostic request.
/// @since 3.17.0
class WorkspaceDiagnosticParams
- implements WorkDoneProgressParams, PartialResultParams, ToJsonable {
+ implements PartialResultParams, WorkDoneProgressParams, ToJsonable {
static const jsonHandler = LspJsonHandler(
WorkspaceDiagnosticParams.canParse,
WorkspaceDiagnosticParams.fromJson,
@@ -44273,26 +44273,22 @@
.map((item) => TextEdit.fromJson(item as Map<String, Object?>))
.toList()));
final documentChangesJson = json['documentChanges'];
- final documentChanges = documentChangesJson == null
- ? null
- : ((documentChangesJson is List<Object?> &&
- (documentChangesJson.every((item) =>
- (CreateFile.canParse(item, nullLspJsonReporter) ||
- DeleteFile.canParse(item, nullLspJsonReporter) ||
- RenameFile.canParse(item, nullLspJsonReporter) ||
- TextDocumentEdit.canParse(item, nullLspJsonReporter)))))
- ? Either2<List<Either4<CreateFile, DeleteFile, RenameFile, TextDocumentEdit>>, List<TextDocumentEdit>>.t1((documentChangesJson)
- .map((item) => CreateFile.canParse(item, nullLspJsonReporter)
- ? Either4<CreateFile, DeleteFile, RenameFile, TextDocumentEdit>.t1(
- CreateFile.fromJson(item as Map<String, Object?>))
- : (DeleteFile.canParse(item, nullLspJsonReporter)
- ? Either4<CreateFile, DeleteFile, RenameFile, TextDocumentEdit>.t2(
- DeleteFile.fromJson(item as Map<String, Object?>))
- : (RenameFile.canParse(item, nullLspJsonReporter)
- ? Either4<CreateFile, DeleteFile, RenameFile, TextDocumentEdit>.t3(RenameFile.fromJson(item as Map<String, Object?>))
- : (TextDocumentEdit.canParse(item, nullLspJsonReporter) ? Either4<CreateFile, DeleteFile, RenameFile, TextDocumentEdit>.t4(TextDocumentEdit.fromJson(item as Map<String, Object?>)) : (throw '''$item was not one of (CreateFile, DeleteFile, RenameFile, TextDocumentEdit)''')))))
- .toList())
- : ((documentChangesJson is List<Object?> && (documentChangesJson.every((item) => TextDocumentEdit.canParse(item, nullLspJsonReporter)))) ? Either2<List<Either4<CreateFile, DeleteFile, RenameFile, TextDocumentEdit>>, List<TextDocumentEdit>>.t2((documentChangesJson).map((item) => TextDocumentEdit.fromJson(item as Map<String, Object?>)).toList()) : (throw '''$documentChangesJson was not one of (List<Either4<CreateFile, DeleteFile, RenameFile, TextDocumentEdit>>, List<TextDocumentEdit>)''')));
+ final documentChanges = (documentChangesJson as List<Object?>?)
+ ?.map((item) => CreateFile.canParse(item, nullLspJsonReporter)
+ ? Either4<CreateFile, DeleteFile, RenameFile, TextDocumentEdit>.t1(
+ CreateFile.fromJson(item as Map<String, Object?>))
+ : (DeleteFile.canParse(item, nullLspJsonReporter)
+ ? Either4<CreateFile, DeleteFile, RenameFile, TextDocumentEdit>.t2(
+ DeleteFile.fromJson(item as Map<String, Object?>))
+ : (RenameFile.canParse(item, nullLspJsonReporter)
+ ? Either4<CreateFile, DeleteFile, RenameFile, TextDocumentEdit>.t3(
+ RenameFile.fromJson(item as Map<String, Object?>))
+ : (TextDocumentEdit.canParse(item, nullLspJsonReporter)
+ ? Either4<CreateFile, DeleteFile, RenameFile,
+ TextDocumentEdit>.t4(
+ TextDocumentEdit.fromJson(item as Map<String, Object?>))
+ : (throw '''$item was not one of (CreateFile, DeleteFile, RenameFile, TextDocumentEdit)''')))))
+ .toList();
return WorkspaceEdit(
changeAnnotations: changeAnnotations,
changes: changes,
@@ -44324,9 +44320,8 @@
/// If a client neither supports `documentChanges` nor
/// `workspace.workspaceEdit.resourceOperations` then only plain `TextEdit`s
/// using the `changes` property are supported.
- final Either2<
- List<Either4<CreateFile, DeleteFile, RenameFile, TextDocumentEdit>>,
- List<TextDocumentEdit>>? documentChanges;
+ final List<Either4<CreateFile, DeleteFile, RenameFile, TextDocumentEdit>>?
+ documentChanges;
Map<String, Object?> toJson() {
var __result = <String, Object?>{};
@@ -44379,17 +44374,14 @@
try {
final documentChanges = obj['documentChanges'];
if (documentChanges != null &&
- !(((documentChanges is List<Object?> &&
- (documentChanges.every((item) =>
- (CreateFile.canParse(item, reporter) ||
- DeleteFile.canParse(item, reporter) ||
- RenameFile.canParse(item, reporter) ||
- TextDocumentEdit.canParse(item, reporter))))) ||
- (documentChanges is List<Object?> &&
- (documentChanges.every((item) =>
+ !((documentChanges is List<Object?> &&
+ (documentChanges.every((item) =>
+ (CreateFile.canParse(item, reporter) ||
+ DeleteFile.canParse(item, reporter) ||
+ RenameFile.canParse(item, reporter) ||
TextDocumentEdit.canParse(item, reporter))))))) {
reporter.reportError(
- 'must be of type Either2<List<Either4<CreateFile, DeleteFile, RenameFile, TextDocumentEdit>>, List<TextDocumentEdit>>');
+ 'must be of type List<Either4<CreateFile, DeleteFile, RenameFile, TextDocumentEdit>>');
return false;
}
} finally {
@@ -44412,7 +44404,14 @@
other.changes,
(List<TextEdit> a, List<TextEdit> b) =>
listEqual(a, b, (TextEdit a, TextEdit b) => a == b)) &&
- documentChanges == other.documentChanges &&
+ listEqual(
+ documentChanges,
+ other.documentChanges,
+ (Either4<CreateFile, DeleteFile, RenameFile, TextDocumentEdit> a,
+ Either4<CreateFile, DeleteFile, RenameFile,
+ TextDocumentEdit>
+ b) =>
+ a == b) &&
true;
}
return false;
@@ -44422,7 +44421,7 @@
int get hashCode => Object.hash(
lspHashCode(changeAnnotations),
lspHashCode(changes),
- documentChanges,
+ lspHashCode(documentChanges),
);
@override
@@ -45918,7 +45917,7 @@
/// The parameters of a Workspace Symbol Request.
class WorkspaceSymbolParams
- implements WorkDoneProgressParams, PartialResultParams, ToJsonable {
+ implements PartialResultParams, WorkDoneProgressParams, ToJsonable {
static const jsonHandler = LspJsonHandler(
WorkspaceSymbolParams.canParse,
WorkspaceSymbolParams.fromJson,
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 9e9088d..c283fd2 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_rename.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_rename.dart
@@ -12,7 +12,7 @@
import 'package:analyzer/dart/element/element.dart';
class PrepareRenameHandler
- extends MessageHandler<TextDocumentPositionParams, RangeAndPlaceholder?> {
+ extends MessageHandler<TextDocumentPositionParams, PlaceholderAndRange?> {
PrepareRenameHandler(super.server);
@override
Method get handlesMessage => Method.textDocument_prepareRename;
@@ -22,7 +22,7 @@
TextDocumentPositionParams.jsonHandler;
@override
- Future<ErrorOr<RangeAndPlaceholder?>> handle(
+ Future<ErrorOr<PlaceholderAndRange?>> handle(
TextDocumentPositionParams params,
MessageInfo message,
CancellationToken token) async {
@@ -61,7 +61,7 @@
ServerErrorCodes.RenameNotValid, initStatus.problem!.message, null);
}
- return success(RangeAndPlaceholder(
+ return success(PlaceholderAndRange(
range: toRange(
unit.result.lineInfo,
// If the offset is set to -1 it means there is no location for the
diff --git a/pkg/analysis_server/lib/src/lsp/mapping.dart b/pkg/analysis_server/lib/src/lsp/mapping.dart
index ff0fc5e..9e0fef2 100644
--- a/pkg/analysis_server/lib/src/lsp/mapping.dart
+++ b/pkg/analysis_server/lib/src/lsp/mapping.dart
@@ -105,10 +105,7 @@
changes.add(renameUnion);
- final edit = WorkspaceEdit(
- documentChanges: Either2<
- List<Either4<CreateFile, DeleteFile, RenameFile, TextDocumentEdit>>,
- List<TextDocumentEdit>>.t1(changes));
+ final edit = WorkspaceEdit(documentChanges: changes);
return edit;
}
@@ -171,15 +168,8 @@
final textDocumentEditsAsUnion = Either4<lsp.CreateFile, lsp.DeleteFile,
lsp.RenameFile, lsp.TextDocumentEdit>.t4(textDocumentEdit);
- // Convert to the union that documentChanges is.
- final documentChanges = Either2<
- List<
- Either4<lsp.CreateFile, lsp.DeleteFile, lsp.RenameFile,
- lsp.TextDocumentEdit>>,
- List<lsp.TextDocumentEdit>>.t1([textDocumentEditsAsUnion]);
-
/// Add the textDocumentEdit to a WorkspaceEdit.
- return lsp.WorkspaceEdit(documentChanges: documentChanges);
+ return lsp.WorkspaceEdit(documentChanges: [textDocumentEditsAsUnion]);
}
lsp.CompletionItemKind? declarationKindToCompletionItemKind(
@@ -696,19 +686,10 @@
<Either4<CreateFile, DeleteFile, RenameFile, TextDocumentEdit>>[];
for (final edit in edits) {
- // Flatten the Either into just the Union side to get a flat list.
- final flatResourceChanges = edit.documentChanges!.map(
- (resources) => resources,
- (edits) => edits.map((e) =>
- Either4<CreateFile, DeleteFile, RenameFile, TextDocumentEdit>.t4(e)),
- );
- changes.addAll(flatResourceChanges);
+ changes.addAll(edit.documentChanges!);
}
- return WorkspaceEdit(
- documentChanges: Either2<
- List<Either4<CreateFile, DeleteFile, RenameFile, TextDocumentEdit>>,
- List<TextDocumentEdit>>.t1(changes));
+ return WorkspaceEdit(documentChanges: changes);
}
lsp.Location navigationTargetToLocation(
@@ -1612,12 +1593,7 @@
changes.add(textDocEditUnion);
}
- return lsp.WorkspaceEdit(
- documentChanges: Either2<
- List<
- Either4<lsp.CreateFile, lsp.DeleteFile, lsp.RenameFile,
- lsp.TextDocumentEdit>>,
- List<lsp.TextDocumentEdit>>.t1(changes));
+ return lsp.WorkspaceEdit(documentChanges: changes);
} else {
return lsp.WorkspaceEdit(changes: toWorkspaceEditChanges(edits));
}
diff --git a/pkg/analysis_server/test/lsp/code_actions_assists_test.dart b/pkg/analysis_server/test/lsp/code_actions_assists_test.dart
index ad18e28..efe9886 100644
--- a/pkg/analysis_server/test/lsp/code_actions_assists_test.dart
+++ b/pkg/analysis_server/test/lsp/code_actions_assists_test.dart
@@ -548,28 +548,20 @@
}
List<TextDocumentEdit> _extractTextDocumentEdits(
- Either2<
- List<
- Either4<CreateFile, DeleteFile, RenameFile,
- TextDocumentEdit>>,
- List<TextDocumentEdit>>
+ List<Either4<CreateFile, DeleteFile, RenameFile, TextDocumentEdit>>
documentChanges) =>
- documentChanges.map(
- // Extract TextDocumentEdits from union of resource changes
- (changes) => changes
- .map(
- (change) => change.map(
- (create) => null,
- (delete) => null,
- (rename) => null,
- (textDocEdit) => textDocEdit,
- ),
- )
- .whereNotNull()
- .toList(),
- // Already TextDocumentEdits
- (edits) => edits,
- );
+ // Extract TextDocumentEdits from union of resource changes
+ documentChanges
+ .map(
+ (change) => change.map(
+ (create) => null,
+ (delete) => null,
+ (rename) => null,
+ (textDocEdit) => textDocEdit,
+ ),
+ )
+ .whereNotNull()
+ .toList();
}
class _RawParams extends ToJsonable {
diff --git a/pkg/analysis_server/test/lsp/server_abstract.dart b/pkg/analysis_server/test/lsp/server_abstract.dart
index 273369b..ee7a836 100644
--- a/pkg/analysis_server/test/lsp/server_abstract.dart
+++ b/pkg/analysis_server/test/lsp/server_abstract.dart
@@ -684,8 +684,7 @@
void applyDocumentChanges(
Map<String, String> fileContents,
- Either2<List<Either4<CreateFile, DeleteFile, RenameFile, TextDocumentEdit>>,
- List<TextDocumentEdit>>
+ List<Either4<CreateFile, DeleteFile, RenameFile, TextDocumentEdit>>
documentChanges, {
Map<String, int>? expectedVersions,
}) {
@@ -694,10 +693,7 @@
if (expectedVersions != null) {
expectDocumentVersions(documentChanges, expectedVersions);
}
- documentChanges.map(
- (changes) => applyResourceChanges(fileContents, changes),
- (edits) => applyTextDocumentEdits(fileContents, edits),
- );
+ applyResourceChanges(fileContents, documentChanges);
}
void applyResourceChanges(
@@ -904,31 +900,20 @@
/// Validates the document versions for a set of edits match the versions in
/// the supplied map.
void expectDocumentVersions(
- Either2<List<Either4<CreateFile, DeleteFile, RenameFile, TextDocumentEdit>>,
- List<TextDocumentEdit>>
+ List<Either4<CreateFile, DeleteFile, RenameFile, TextDocumentEdit>>
documentChanges,
Map<String, int> expectedVersions,
) {
- documentChanges.map(
- // For resource changes, we only need to validate changes since
- // creates/renames/deletes do not supply versions.
- (changes) {
- for (var change in changes) {
- change.map(
- (create) => {},
- (delete) {},
- (rename) {},
- (edit) => expectDocumentVersion(edit, expectedVersions),
- );
- }
- },
- // Validate versions on simple doc edits
- (edits) {
- for (var edit in edits) {
- expectDocumentVersion(edit, expectedVersions);
- }
- },
- );
+ // For resource changes, we only need to validate changes since
+ // creates/renames/deletes do not supply versions.
+ for (var change in documentChanges) {
+ change.map(
+ (create) {},
+ (delete) {},
+ (rename) {},
+ (edit) => expectDocumentVersion(edit, expectedVersions),
+ );
+ }
}
Future<ShowMessageParams> expectErrorNotification(
@@ -1604,7 +1589,7 @@
return toPosition(lineInfo.getLocation(offset));
}
- Future<RangeAndPlaceholder?> prepareRename(Uri uri, Position pos) {
+ Future<PlaceholderAndRange?> prepareRename(Uri uri, Position pos) {
final request = makeRequest(
Method.textDocument_prepareRename,
TextDocumentPositionParams(
@@ -1612,7 +1597,7 @@
position: pos,
),
);
- return expectSuccessfulResponseTo(request, RangeAndPlaceholder.fromJson);
+ return expectSuccessfulResponseTo(request, PlaceholderAndRange.fromJson);
}
/// Calls the supplied function and responds to any `workspace/configuration`
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 52a6859..1af098a 100644
--- a/pkg/analysis_server/test/tool/lsp_spec/json_test.dart
+++ b/pkg/analysis_server/test/tool/lsp_spec/json_test.dart
@@ -306,7 +306,7 @@
expect(
reporter.errors.first,
equals(
- 'params.documentChanges must be of type Either2<List<Either4<CreateFile, DeleteFile, RenameFile, TextDocumentEdit>>, List<TextDocumentEdit>>'));
+ 'params.documentChanges must be of type List<Either4<CreateFile, DeleteFile, RenameFile, TextDocumentEdit>>'));
});
test('ResponseMessage can include a null result', () {
diff --git a/pkg/analysis_server/test/tool/lsp_spec/typescript_test.dart b/pkg/analysis_server/test/tool/lsp_spec/typescript_test.dart
index ebc92f9..386260e 100644
--- a/pkg/analysis_server/test/tool/lsp_spec/typescript_test.dart
+++ b/pkg/analysis_server/test/tool/lsp_spec/typescript_test.dart
@@ -334,9 +334,9 @@
expect(output.first, const TypeMatcher<Namespace>());
final enum_ = output.first as Namespace;
expect(enum_.members, hasLength(3));
- expect(enum_.members[0].name, equals('namespace'));
- expect(enum_.members[1].name, equals('class'));
- expect(enum_.members[2].name, equals('enum'));
+ expect(enum_.members[0].name, equals('class'));
+ expect(enum_.members[1].name, equals('enum'));
+ expect(enum_.members[2].name, equals('namespace'));
});
test('parses a tuple in an array', () {
diff --git a/pkg/analysis_server/tool/lsp_spec/codegen_dart.dart b/pkg/analysis_server/tool/lsp_spec/codegen_dart.dart
index e2463db..13931a9 100644
--- a/pkg/analysis_server/tool/lsp_spec/codegen_dart.dart
+++ b/pkg/analysis_server/tool/lsp_spec/codegen_dart.dart
@@ -63,6 +63,7 @@
types
.whereType<Namespace>()
.forEach((namespace) => _namespaces[namespace.name] = namespace);
+ _sortSubtypes();
}
/// Renames types that may have been generated with bad names.
@@ -223,6 +224,37 @@
});
}
+/// Sorts subtypes into a consistent order.
+///
+/// Subtypes will be sorted such that types with the most required fields appear
+/// first to ensure `fromJson` constructors delegate to the most specific type.
+void _sortSubtypes() {
+ int requiredFieldCount(String interfaceName) => _interfaces[interfaceName]!
+ .members
+ .whereType<Field>()
+ .where((field) => !field.allowsUndefined && !field.allowsNull)
+ .length;
+ int optionalFieldCount(String interfaceName) => _interfaces[interfaceName]!
+ .members
+ .whereType<Field>()
+ .where((field) => field.allowsUndefined || field.allowsNull)
+ .length;
+ for (final entry in _subtypes.entries) {
+ final subtypes = entry.value;
+ subtypes.sort((subtype1, subtype2) {
+ final requiredFields1 = requiredFieldCount(subtype1);
+ final requiredFields2 = requiredFieldCount(subtype2);
+ final optionalFields1 = optionalFieldCount(subtype1);
+ final optionalFields2 = optionalFieldCount(subtype2);
+ return requiredFields1 != requiredFields2
+ ? requiredFields2.compareTo(requiredFields1)
+ : optionalFields1 != optionalFields2
+ ? optionalFields2.compareTo(optionalFields1)
+ : subtype1.compareTo(subtype2);
+ });
+ }
+}
+
/// Returns a String representing the underlying Dart type for the provided
/// spec [type].
///
@@ -420,7 +452,7 @@
resolveTypeAlias(requiredValueType, resolveEnumClasses: true);
buffer
- ..writeln('class ${namespace.name} {')
+ ..writeln('class ${namespace.name} implements ToJsonable {')
..indent()
..writeIndentedln('const ${namespace.name}$constructorName(this._value);')
..writeIndentedln('const ${namespace.name}.fromJson(this._value);')
diff --git a/pkg/analysis_server/tool/lsp_spec/typescript_parser.dart b/pkg/analysis_server/tool/lsp_spec/typescript_parser.dart
index e4415a8..6cf66db 100644
--- a/pkg/analysis_server/tool/lsp_spec/typescript_parser.dart
+++ b/pkg/analysis_server/tool/lsp_spec/typescript_parser.dart
@@ -172,7 +172,10 @@
this.typeArgs,
this.baseTypes,
this.members,
- );
+ ) {
+ baseTypes.sortBy((type) => type.dartTypeWithTypeArgs.toLowerCase());
+ members.sortBy((member) => member.name.toLowerCase());
+ }
@override
String get name => nameToken.lexeme;
@@ -238,7 +241,9 @@
super.comment,
this.nameToken,
this.members,
- );
+ ) {
+ members.sortBy((member) => member.name.toLowerCase());
+ }
@override
String get name => nameToken.lexeme;
@@ -531,6 +536,18 @@
return uniqueTypes.firstWhere(isAnyType);
}
+ // Special case to simplify a complex type in the TypeScript spec that is
+ // hard to detect generically and is already simplified in the JSON model.
+ // The first type in the union is fully representable in the second and can
+ // be dropped.
+ // TODO(dantup): Remove this when switching to the JSON model.
+ if (uniqueTypes.length == 2 &&
+ uniqueTypes[0].dartTypeWithTypeArgs == 'List<TextDocumentEdit>' &&
+ uniqueTypes[1].dartTypeWithTypeArgs ==
+ 'List<Either4<CreateFile, DeleteFile, RenameFile, TextDocumentEdit>>') {
+ return uniqueTypes[1];
+ }
+
return uniqueTypes.length == 1
? uniqueTypes.single
: uniqueTypes.every(isLiteralType)
diff --git a/pkg/analyzer/lib/dart/element/element.dart b/pkg/analyzer/lib/dart/element/element.dart
index 97af71b..024d39b 100644
--- a/pkg/analyzer/lib/dart/element/element.dart
+++ b/pkg/analyzer/lib/dart/element/element.dart
@@ -49,8 +49,21 @@
import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer/src/generated/utilities_dart.dart';
import 'package:analyzer/src/task/api/model.dart' show AnalysisTarget;
+import 'package:meta/meta.dart';
import 'package:pub_semver/pub_semver.dart';
+/// A library augmentation import directive within a library.
+///
+/// Clients may not extend, implement or mix-in this class.
+@experimental
+abstract class AugmentationImportElement implements UriReferencedElement {
+ /// Returns the augmentation library that this element imports.
+ LibraryAugmentationElement get augmentation;
+
+ @override
+ LibraryOrAugmentationElement get enclosingElement;
+}
+
/// An element that represents a class or a mixin. The class can be defined by
/// either a class declaration (with a class body), a mixin application (without
/// a class body), a mixin declaration, or an enum declaration.
@@ -1292,17 +1305,20 @@
String get name;
}
+/// A library augmentation.
+///
+/// Clients may not extend, implement or mix-in this class.
+@experimental
+abstract class LibraryAugmentationElement extends LibraryOrAugmentationElement {
+ /// Returns the library that is augmented by this augmentation.
+ LibraryOrAugmentationElement get augmented;
+}
+
/// A library.
///
/// Clients may not extend, implement or mix-in this class.
-abstract class LibraryElement implements _ExistingElement {
- /// Returns a list containing all of the extension elements accessible within
- /// this library.
- List<ExtensionElement> get accessibleExtensions;
-
- /// Return the compilation unit that defines this library.
- CompilationUnitElement get definingCompilationUnit;
-
+abstract class LibraryElement
+ implements LibraryOrAugmentationElement, _ExistingElement {
/// Return the entry point for this library, or `null` if this library does
/// not have an entry point. The entry point is defined to be a zero argument
/// top-level function whose name is `main`.
@@ -1315,16 +1331,6 @@
/// The export [Namespace] of this library.
Namespace get exportNamespace;
- /// Return a list containing all of the exports defined in this library.
- List<ExportElement> get exports;
-
- /// The set of features available to this library.
- ///
- /// Determined by the combination of the language version for the enclosing
- /// package, enabled experiments, and the presence of a `// @dart` language
- /// version override comment at the top of the file.
- FeatureSet get featureSet;
-
/// Return an identifier that uniquely identifies this element among the
/// children of this element's parent.
String get identifier;
@@ -1334,9 +1340,6 @@
/// prefix and those that are imported without a prefix.
List<LibraryElement> get importedLibraries;
- /// Return a list containing all of the imports defined in this library.
- List<ImportElement> get imports;
-
/// Return `true` if this library is an application that can be run in the
/// browser.
bool get isBrowserApplication;
@@ -1350,11 +1353,6 @@
/// Return `true` if this library is part of the SDK.
bool get isInSdk;
- bool get isNonNullableByDefault;
-
- /// The language version for this library.
- LibraryLanguageVersion get languageVersion;
-
/// Return the element representing the synthetic function `loadLibrary` that
/// is implicitly defined for this library if the library is imported using a
/// deferred import.
@@ -1370,32 +1368,14 @@
/// compilation unit that contains the `part` directives.
List<CompilationUnitElement> get parts;
- /// Return a list containing elements for each of the prefixes used to
- /// `import` libraries into this library. Each prefix can be used in more
- /// than one `import` directive.
- List<PrefixElement> get prefixes;
-
/// The public [Namespace] of this library.
Namespace get publicNamespace;
- /// Return the name lookup scope for this library. It consists of elements
- /// that are either declared in the library, or imported into it.
- Scope get scope;
-
- @override
- AnalysisSession get session;
-
/// Return the top-level elements defined in each of the compilation units
/// that are included in this library. This includes both public and private
/// elements, but does not include imports, exports, or synthetic elements.
Iterable<Element> get topLevelElements;
- /// Return the [TypeProvider] that is used in this library.
- TypeProvider get typeProvider;
-
- /// Return the [TypeSystem] that is used in this library.
- TypeSystem get typeSystem;
-
/// Return a list containing all of the compilation units this library
/// consists of. This includes the defining compilation unit and units
/// included using the `part` directive.
@@ -1436,6 +1416,59 @@
}
}
+/// Shared interface between [LibraryElement] and [LibraryAugmentationElement].
+///
+/// Clients may not extend, implement or mix-in this class.
+@experimental
+abstract class LibraryOrAugmentationElement implements Element {
+ /// Returns a list containing all of the extension elements accessible within
+ /// this library.
+ List<ExtensionElement> get accessibleExtensions;
+
+ /// Returns the augmentation imports specified in this library.
+ @experimental
+ List<AugmentationImportElement> get augmentationImports;
+
+ /// Return the compilation unit that defines this library.
+ CompilationUnitElement get definingCompilationUnit;
+
+ /// Return a list containing all of the exports defined in this library.
+ List<ExportElement> get exports;
+
+ /// The set of features available to this library.
+ ///
+ /// Determined by the combination of the language version for the enclosing
+ /// package, enabled experiments, and the presence of a `// @dart` language
+ /// version override comment at the top of the file.
+ FeatureSet get featureSet;
+
+ /// Return a list containing all of the imports defined in this library.
+ List<ImportElement> get imports;
+
+ bool get isNonNullableByDefault;
+
+ /// The language version for this library.
+ LibraryLanguageVersion get languageVersion;
+
+ /// Return a list containing elements for each of the prefixes used to
+ /// `import` libraries into this library. Each prefix can be used in more
+ /// than one `import` directive.
+ List<PrefixElement> get prefixes;
+
+ /// Return the name lookup scope for this library. It consists of elements
+ /// that are either declared in the library, or imported into it.
+ Scope get scope;
+
+ @override
+ AnalysisSession get session;
+
+ /// Return the [TypeProvider] that is used in this library.
+ TypeProvider get typeProvider;
+
+ /// Return the [TypeSystem] that is used in this library.
+ TypeSystem get typeSystem;
+}
+
/// An element that can be (but is not required to be) defined within a method
/// or function (an [ExecutableElement]).
///
diff --git a/pkg/analyzer/lib/src/dart/element/element.dart b/pkg/analyzer/lib/src/dart/element/element.dart
index 3d1e18c..392afd4 100644
--- a/pkg/analyzer/lib/src/dart/element/element.dart
+++ b/pkg/analyzer/lib/src/dart/element/element.dart
@@ -3709,6 +3709,12 @@
List<ExtensionElement> get accessibleExtensions => scope.extensions;
@override
+ List<AugmentationImportElement> get augmentationImports {
+ // TODO(scheglov): implement augmentationImports
+ throw UnimplementedError();
+ }
+
+ @override
CompilationUnitElementImpl get definingCompilationUnit =>
_definingCompilationUnit;
diff --git a/pkg/analyzer/lib/src/dart/element/member.dart b/pkg/analyzer/lib/src/dart/element/member.dart
index 73aebd1..882ea16 100644
--- a/pkg/analyzer/lib/src/dart/element/member.dart
+++ b/pkg/analyzer/lib/src/dart/element/member.dart
@@ -24,7 +24,7 @@
/// Initialize a newly created element to represent a constructor, based on
/// the [declaration], and applied [substitution].
ConstructorMember(
- TypeProviderImpl typeProvider,
+ TypeProviderImpl? typeProvider,
ConstructorElement declaration,
MapSubstitution substitution,
bool isLegacy,
@@ -138,7 +138,7 @@
/// their bounds. The [substitution] includes replacing [declaration] type
/// parameters with the provided fresh [typeParameters].
ExecutableMember(
- TypeProviderImpl typeProvider,
+ TypeProviderImpl? typeProvider,
ExecutableElement declaration,
MapSubstitution substitution,
bool isLegacy,
@@ -179,6 +179,12 @@
bool get isSynchronous => declaration.isSynchronous;
@override
+ LibraryElement get library => _declaration.library!;
+
+ @override
+ Source get librarySource => _declaration.librarySource!;
+
+ @override
List<ParameterElement> get parameters {
return declaration.parameters.map<ParameterElement>((p) {
if (p is FieldFormalParameterElement) {
@@ -220,7 +226,7 @@
ExecutableElement element,
MapSubstitution substitution,
) {
- TypeProviderImpl typeProvider;
+ TypeProviderImpl? typeProvider;
var isLegacy = false;
var combined = substitution;
if (element is ExecutableMember) {
@@ -261,7 +267,7 @@
class FieldFormalParameterMember extends ParameterMember
implements FieldFormalParameterElement {
factory FieldFormalParameterMember(
- TypeProviderImpl typeProvider,
+ TypeProviderImpl? typeProvider,
FieldFormalParameterElement declaration,
MapSubstitution substitution,
bool isLegacy,
@@ -280,7 +286,7 @@
}
FieldFormalParameterMember._(
- TypeProviderImpl typeProvider,
+ TypeProviderImpl? typeProvider,
FieldFormalParameterElement declaration,
MapSubstitution substitution,
bool isLegacy,
@@ -320,7 +326,7 @@
/// Initialize a newly created element to represent a field, based on the
/// [declaration], with applied [substitution].
FieldMember(
- TypeProviderImpl typeProvider,
+ TypeProviderImpl? typeProvider,
FieldElement declaration,
MapSubstitution substitution,
bool isLegacy,
@@ -361,6 +367,9 @@
bool get isExternal => declaration.isExternal;
@override
+ LibraryElement get library => _declaration.library!;
+
+ @override
String get name => declaration.name;
@override
@@ -406,8 +415,8 @@
}
class FunctionMember extends ExecutableMember implements FunctionElement {
- FunctionMember(
- TypeProviderImpl typeProvider, FunctionElement declaration, bool isLegacy)
+ FunctionMember(TypeProviderImpl? typeProvider, FunctionElement declaration,
+ bool isLegacy)
: super(
typeProvider,
declaration,
@@ -441,7 +450,7 @@
/// parameters are known.
abstract class Member implements Element {
/// A type provider (might be legacy, might be null-safe).
- final TypeProviderImpl _typeProvider;
+ final TypeProviderImpl? _typeProvider;
/// The element on which the parameterized element was created.
final Element _declaration;
@@ -459,6 +468,10 @@
if (_declaration is Member) {
throw StateError('Members must be created from a declarations.');
}
+ if (_typeProvider == null && isLegacy) {
+ throw StateError(
+ 'A type provider must be supplied for legacy conversion');
+ }
}
@override
@@ -552,10 +565,10 @@
ElementKind get kind => _declaration.kind;
@override
- LibraryElement get library => _declaration.library!;
+ LibraryElement? get library => _declaration.library;
@override
- Source get librarySource => _declaration.librarySource!;
+ Source? get librarySource => _declaration.librarySource;
@override
ElementLocation get location => _declaration.location!;
@@ -642,7 +655,7 @@
/// Otherwise, return the type unchanged.
DartType _toLegacyType(DartType type) {
if (isLegacy) {
- return NullabilityEliminator.perform(_typeProvider, type);
+ return NullabilityEliminator.perform(_typeProvider!, type);
} else {
return type;
}
@@ -720,7 +733,7 @@
/// type parameters are known.
class MethodMember extends ExecutableMember implements MethodElement {
factory MethodMember(
- TypeProviderImpl typeProvider,
+ TypeProviderImpl? typeProvider,
MethodElement declaration,
MapSubstitution substitution,
bool isLegacy,
@@ -739,7 +752,7 @@
}
MethodMember._(
- TypeProviderImpl typeProvider,
+ TypeProviderImpl? typeProvider,
MethodElement declaration,
MapSubstitution substitution,
bool isLegacy,
@@ -799,7 +812,7 @@
final List<TypeParameterElement> typeParameters;
factory ParameterMember(
- TypeProviderImpl typeProvider,
+ TypeProviderImpl? typeProvider,
ParameterElement declaration,
MapSubstitution substitution,
bool isLegacy,
@@ -820,7 +833,7 @@
/// Initialize a newly created element to represent a parameter, based on the
/// [declaration], with applied [substitution].
ParameterMember._(
- TypeProviderImpl typeProvider,
+ TypeProviderImpl? typeProvider,
ParameterElement declaration,
MapSubstitution substitution,
bool isLegacy,
@@ -887,6 +900,33 @@
super.visitChildren(visitor);
safelyVisitChildren(parameters, visitor);
}
+
+ static ParameterElement from(
+ ParameterElement element, MapSubstitution substitution) {
+ TypeProviderImpl? typeProvider;
+ var isLegacy = false;
+ var combined = substitution;
+ if (element is ParameterMember) {
+ var member = element;
+ element = member.declaration;
+ typeProvider = member._typeProvider;
+
+ isLegacy = member.isLegacy;
+
+ var map = <TypeParameterElement, DartType>{};
+ for (var entry in member._substitution.map.entries) {
+ map[entry.key] = substitution.substituteType(entry.value);
+ }
+ map.addAll(substitution.map);
+ combined = Substitution.fromMap(map);
+ }
+
+ if (!isLegacy && combined.map.isEmpty) {
+ return element;
+ }
+
+ return ParameterMember(typeProvider, element, combined, isLegacy);
+ }
}
/// A property accessor element defined in a parameterized type where the values
@@ -894,7 +934,7 @@
class PropertyAccessorMember extends ExecutableMember
implements PropertyAccessorElement {
factory PropertyAccessorMember(
- TypeProviderImpl typeProvider,
+ TypeProviderImpl? typeProvider,
PropertyAccessorElement declaration,
MapSubstitution substitution,
bool isLegacy,
@@ -913,7 +953,7 @@
}
PropertyAccessorMember._(
- TypeProviderImpl typeProvider,
+ TypeProviderImpl? typeProvider,
PropertyAccessorElement declaration,
MapSubstitution substitution,
bool isLegacy,
@@ -1005,7 +1045,7 @@
class SuperFormalParameterMember extends ParameterMember
implements SuperFormalParameterElement {
factory SuperFormalParameterMember(
- TypeProviderImpl typeProvider,
+ TypeProviderImpl? typeProvider,
SuperFormalParameterElement declaration,
MapSubstitution substitution,
bool isLegacy,
@@ -1024,7 +1064,7 @@
}
SuperFormalParameterMember._(
- TypeProviderImpl typeProvider,
+ TypeProviderImpl? typeProvider,
SuperFormalParameterElement declaration,
MapSubstitution substitution,
bool isLegacy,
@@ -1063,7 +1103,7 @@
class TopLevelVariableMember extends VariableMember
implements TopLevelVariableElement {
TopLevelVariableMember(
- TypeProviderImpl typeProvider,
+ TypeProviderImpl? typeProvider,
VariableElement declaration,
MapSubstitution substitution,
bool isLegacy,
@@ -1093,6 +1133,9 @@
bool get isExternal => declaration.isExternal;
@override
+ LibraryElement get library => _declaration.library!;
+
+ @override
String get name => declaration.name;
@override
@@ -1119,7 +1162,7 @@
/// Initialize a newly created element to represent a variable, based on the
/// [declaration], with applied [substitution].
VariableMember(
- TypeProviderImpl typeProvider,
+ TypeProviderImpl? typeProvider,
VariableElement declaration,
MapSubstitution substitution,
bool isLegacy,
diff --git a/pkg/analyzer/lib/src/dart/element/type.dart b/pkg/analyzer/lib/src/dart/element/type.dart
index 113b883..bd1c52f 100644
--- a/pkg/analyzer/lib/src/dart/element/type.dart
+++ b/pkg/analyzer/lib/src/dart/element/type.dart
@@ -10,7 +10,6 @@
import 'package:analyzer/src/dart/analysis/session.dart';
import 'package:analyzer/src/dart/element/display_string_builder.dart';
import 'package:analyzer/src/dart/element/element.dart';
-import 'package:analyzer/src/dart/element/extensions.dart';
import 'package:analyzer/src/dart/element/inheritance_manager3.dart';
import 'package:analyzer/src/dart/element/member.dart';
import 'package:analyzer/src/dart/element/type_algebra.dart';
@@ -224,9 +223,8 @@
return FunctionTypeImpl(
returnType: substitution.substituteType(returnType),
typeFormals: const [],
- parameters: parameters
- .map((p) => p.copyWith(type: substitution.substituteType(p.type)))
- .toList(),
+ parameters:
+ parameters.map((p) => ParameterMember.from(p, substitution)).toList(),
nullabilitySuffix: nullabilitySuffix,
);
}
diff --git a/pkg/analyzer/lib/src/test_utilities/mock_sdk.dart b/pkg/analyzer/lib/src/test_utilities/mock_sdk.dart
index b462020..29af7d3 100644
--- a/pkg/analyzer/lib/src/test_utilities/mock_sdk.dart
+++ b/pkg/analyzer/lib/src/test_utilities/mock_sdk.dart
@@ -591,6 +591,9 @@
void addAll(Iterable<E> elements);
bool remove(Object? value);
E? lookup(Object? object);
+
+ static Set<T> castFrom<S, T>(Set<S> source, {Set<R> Function<R>()? newSet}) =>
+ throw '';
}
class StackTrace {}
diff --git a/pkg/analyzer/test/generated/non_error_resolver_test.dart b/pkg/analyzer/test/generated/non_error_resolver_test.dart
index e0fb10a..00a42fb 100644
--- a/pkg/analyzer/test/generated/non_error_resolver_test.dart
+++ b/pkg/analyzer/test/generated/non_error_resolver_test.dart
@@ -1458,10 +1458,8 @@
''');
var x = findNode.namedExpression('arg: true');
var y = x.staticParameterElement!;
- // Note: the staticParameterElement is synthetic; see
- // https://github.com/dart-lang/sdk/issues/48500
- expect(y, isNot(TypeMatcher<ParameterMember>()));
- expect(y.enclosingElement, isNull);
+ expect(y.enclosingElement, isNotNull);
+ expect(y.declaration, findElement.parameter('arg'));
}
test_generic_staticParameterElement_methodCall_implicitTypeArg() async {
@@ -1473,10 +1471,8 @@
''');
var x = findNode.namedExpression('arg: true');
var y = x.staticParameterElement!;
- // Note: the staticParameterElement is synthetic; see
- // https://github.com/dart-lang/sdk/issues/48500
- expect(y, isNot(TypeMatcher<ParameterMember>()));
- expect(y.enclosingElement, isNull);
+ expect(y.enclosingElement, isNotNull);
+ expect(y.declaration, findElement.parameter('arg'));
}
test_genericTypeAlias_castsAndTypeChecks_hasTypeParameters() async {
@@ -2258,6 +2254,21 @@
''');
}
+ test_librarySource_of_type_substituted_synthetic_parameter() async {
+ await assertErrorsInCode('''
+Map<int, T> f<T>(T t) => throw '';
+Map<double, T> g<T>(T t) => throw '';
+h(bool b) {
+ Map<num, String> m = (b ? f : g)('x');
+}
+''', [
+ error(HintCode.UNUSED_LOCAL_VARIABLE, 104, 1),
+ ]);
+ var parameter = findNode.stringLiteral("'x'").staticParameterElement;
+ expect(parameter!.library, isNull);
+ expect(parameter.librarySource, isNull);
+ }
+
test_loadLibraryDefined() async {
newFile('$testPackageLibPath/lib.dart', r'''
library lib;
@@ -3310,6 +3321,24 @@
@reflectiveTest
class NonErrorResolverWithoutNullSafetyTest extends PubPackageResolutionTest
with WithoutNullSafetyMixin, NonErrorResolverTestCases {
+ test_castFrom() async {
+ // This test exercises a corner case of legacy erasure: due to the type
+ // substitution in the `newSet` parameter of `Set.castFrom`, we wind up with
+ // a synthetic `ParameterMember` that belongs to no library. We need to
+ // make sure this doesn't lead to a crash.
+ await assertErrorsInCode('''
+class C {}
+
+void testNewSet(Set<C> setEls) {
+ var customNewSet;
+ Set.castFrom<C, Object>(setEls,
+ newSet: <T>() => customNewSet = new Set<T>());
+}
+''', [
+ error(HintCode.UNUSED_LOCAL_VARIABLE, 51, 12),
+ ]);
+ }
+
test_conflictingStaticGetterAndInstanceSetter_thisClass() async {
await assertNoErrorsInCode(r'''
class A {
diff --git a/pkg/analyzer/test/src/dart/resolution/constructor_reference_test.dart b/pkg/analyzer/test/src/dart/resolution/constructor_reference_test.dart
index 61f308b..b06ac22 100644
--- a/pkg/analyzer/test/src/dart/resolution/constructor_reference_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/constructor_reference_test.dart
@@ -242,6 +242,21 @@
''');
}
+ test_alias_generic_with_inferred_type_parameter() async {
+ await assertErrorsInCode('''
+class C<T> {
+ final T x;
+ C(this.x);
+}
+typedef Direct<T> = C<T>;
+void main() {
+ var x = const <C<int> Function(int)>[Direct.new];
+}
+''', [
+ error(HintCode.UNUSED_LOCAL_VARIABLE, 87, 1),
+ ]);
+ }
+
test_alias_genericWithBound_unnamed() async {
await assertNoErrorsInCode('''
class A<T> {
diff --git a/pkg/analyzer_plugin/CHANGELOG.md b/pkg/analyzer_plugin/CHANGELOG.md
index ca17b41..d691820 100644
--- a/pkg/analyzer_plugin/CHANGELOG.md
+++ b/pkg/analyzer_plugin/CHANGELOG.md
@@ -1,3 +1,6 @@
+## 0.10.0
+- Support version `4.x` of the `analyzer` package
+
## 0.9.0
- Support version `3.x` of the `analyzer` package
diff --git a/pkg/analyzer_plugin/pubspec.yaml b/pkg/analyzer_plugin/pubspec.yaml
index 60a7d22..946fd7e 100644
--- a/pkg/analyzer_plugin/pubspec.yaml
+++ b/pkg/analyzer_plugin/pubspec.yaml
@@ -1,13 +1,13 @@
name: analyzer_plugin
description: A framework and support code for building plugins for the analysis server.
-version: 0.9.0
+version: 0.10.0
repository: https://github.com/dart-lang/sdk/tree/main/pkg/analyzer_plugin
environment:
sdk: '>=2.14.0 <3.0.0'
dependencies:
- analyzer: ^3.0.0
+ analyzer: ^4.0.0
collection: ^1.15.0
dart_style: ^2.2.1
pub_semver: ^2.0.0
diff --git a/pkg/compiler/pubspec.yaml b/pkg/compiler/pubspec.yaml
index cb44cf3..d2e8bbb 100644
--- a/pkg/compiler/pubspec.yaml
+++ b/pkg/compiler/pubspec.yaml
@@ -98,9 +98,9 @@
protobuf:
path: ../../third_party/pkg/protobuf/protobuf
shelf:
- path: ../../third_party/pkg/shelf
+ path: ../../third_party/pkg/shelf/pkgs/shelf
shelf_static:
- path: ../../third_party/pkg/shelf_static
+ path: ../../third_party/pkg/shelf/pkgs/shelf_static
source_span:
path: ../../third_party/pkg/source_span
stack_trace:
diff --git a/pkg/dev_compiler/pubspec.yaml b/pkg/dev_compiler/pubspec.yaml
index 90c1a69..9ff430c 100644
--- a/pkg/dev_compiler/pubspec.yaml
+++ b/pkg/dev_compiler/pubspec.yaml
@@ -52,6 +52,6 @@
meta:
path: ../meta
shelf:
- path: ../../third_party/pkg/shelf
+ path: ../../third_party/pkg/shelf/pkgs/shelf
http_multi_server:
path: ../../third_party/pkg/http_multi_server
diff --git a/pkg/front_end/test/spell_checking_list_code.txt b/pkg/front_end/test/spell_checking_list_code.txt
index 9b124a58..b143afe 100644
--- a/pkg/front_end/test/spell_checking_list_code.txt
+++ b/pkg/front_end/test/spell_checking_list_code.txt
@@ -892,6 +892,7 @@
parallel
param
parameter's
+parameterized
parametrized
params
paren
diff --git a/runtime/vm/app_snapshot.cc b/runtime/vm/app_snapshot.cc
index 178aedf..c5b8120 100644
--- a/runtime/vm/app_snapshot.cc
+++ b/runtime/vm/app_snapshot.cc
@@ -2631,6 +2631,16 @@
d->set_position(restore_position);
}
+
+#if defined(DART_PRECOMPILED_RUNTIME) && \
+ (!defined(PRODUCT) || defined(FORCE_INCLUDE_DISASSEMBLER))
+ if (FLAG_disassemble) {
+ ObjectPool& pool = ObjectPool::Handle(
+ d->isolate_group()->object_store()->global_object_pool());
+ THR_Print("Global object pool:\n");
+ pool.DebugPrint();
+ }
+#endif
}
private:
@@ -4743,6 +4753,80 @@
};
#if !defined(DART_PRECOMPILED_RUNTIME)
+class Simd128SerializationCluster : public SerializationCluster {
+ public:
+ explicit Simd128SerializationCluster(intptr_t cid, bool is_canonical)
+ : SerializationCluster("Simd128",
+ cid,
+ compiler::target::Int32x4::InstanceSize(),
+ is_canonical) {
+ ASSERT_EQUAL(compiler::target::Int32x4::InstanceSize(),
+ compiler::target::Float32x4::InstanceSize());
+ ASSERT_EQUAL(compiler::target::Int32x4::InstanceSize(),
+ compiler::target::Float64x2::InstanceSize());
+ }
+ ~Simd128SerializationCluster() {}
+
+ void Trace(Serializer* s, ObjectPtr object) { objects_.Add(object); }
+
+ void WriteAlloc(Serializer* s) {
+ const intptr_t count = objects_.length();
+ s->WriteUnsigned(count);
+ for (intptr_t i = 0; i < count; i++) {
+ ObjectPtr vector = objects_[i];
+ s->AssignRef(vector);
+ }
+ }
+
+ void WriteFill(Serializer* s) {
+ const intptr_t count = objects_.length();
+ for (intptr_t i = 0; i < count; i++) {
+ ObjectPtr vector = objects_[i];
+ AutoTraceObject(vector);
+ ASSERT_EQUAL(Int32x4::value_offset(), Float32x4::value_offset());
+ ASSERT_EQUAL(Int32x4::value_offset(), Float64x2::value_offset());
+ s->WriteBytes(&(static_cast<Int32x4Ptr>(vector)->untag()->value_),
+ sizeof(simd128_value_t));
+ }
+ }
+
+ private:
+ GrowableArray<ObjectPtr> objects_;
+};
+#endif // !DART_PRECOMPILED_RUNTIME
+
+class Simd128DeserializationCluster
+ : public AbstractInstanceDeserializationCluster {
+ public:
+ explicit Simd128DeserializationCluster(intptr_t cid, bool is_canonical)
+ : AbstractInstanceDeserializationCluster("Simd128", is_canonical),
+ cid_(cid) {}
+ ~Simd128DeserializationCluster() {}
+
+ void ReadAlloc(Deserializer* d) {
+ ASSERT_EQUAL(Int32x4::InstanceSize(), Float32x4::InstanceSize());
+ ASSERT_EQUAL(Int32x4::InstanceSize(), Float64x2::InstanceSize());
+ ReadAllocFixedSize(d, Int32x4::InstanceSize());
+ }
+
+ void ReadFill(Deserializer* d_, bool primary) {
+ Deserializer::Local d(d_);
+ const intptr_t cid = cid_;
+ const bool mark_canonical = primary && is_canonical();
+ for (intptr_t id = start_index_, n = stop_index_; id < n; id++) {
+ ObjectPtr vector = d.Ref(id);
+ Deserializer::InitializeHeader(vector, cid, Int32x4::InstanceSize(),
+ mark_canonical);
+ d.ReadBytes(&(static_cast<Int32x4Ptr>(vector)->untag()->value_),
+ sizeof(simd128_value_t));
+ }
+ }
+
+ private:
+ intptr_t cid_;
+};
+
+#if !defined(DART_PRECOMPILED_RUNTIME)
class GrowableObjectArraySerializationCluster : public SerializationCluster {
public:
GrowableObjectArraySerializationCluster()
@@ -6796,6 +6880,10 @@
return new (Z) MintSerializationCluster(is_canonical);
case kDoubleCid:
return new (Z) DoubleSerializationCluster(is_canonical);
+ case kInt32x4Cid:
+ case kFloat32x4Cid:
+ case kFloat64x2Cid:
+ return new (Z) Simd128SerializationCluster(cid, is_canonical);
case kGrowableObjectArrayCid:
return new (Z) GrowableObjectArraySerializationCluster();
case kStackTraceCid:
@@ -7950,6 +8038,10 @@
return new (Z) MintDeserializationCluster(is_canonical);
case kDoubleCid:
return new (Z) DoubleDeserializationCluster(is_canonical);
+ case kInt32x4Cid:
+ case kFloat32x4Cid:
+ case kFloat64x2Cid:
+ return new (Z) Simd128DeserializationCluster(cid, is_canonical);
case kGrowableObjectArrayCid:
ASSERT(!is_canonical);
return new (Z) GrowableObjectArrayDeserializationCluster();
diff --git a/runtime/vm/app_snapshot.h b/runtime/vm/app_snapshot.h
index 0356e09..8d16572 100644
--- a/runtime/vm/app_snapshot.h
+++ b/runtime/vm/app_snapshot.h
@@ -334,7 +334,7 @@
stream_->WriteWordWith32BitWrites(value);
}
- void WriteBytes(const uint8_t* addr, intptr_t len) {
+ void WriteBytes(const void* addr, intptr_t len) {
stream_->WriteBytes(addr, len);
}
void Align(intptr_t alignment) { stream_->Align(alignment); }
diff --git a/runtime/vm/compiler/aot/precompiler.cc b/runtime/vm/compiler/aot/precompiler.cc
index 4e9be6f..ee450a6 100644
--- a/runtime/vm/compiler/aot/precompiler.cc
+++ b/runtime/vm/compiler/aot/precompiler.cc
@@ -68,7 +68,6 @@
false,
"Print per-phase breakdown of time spent precompiling");
DEFINE_FLAG(bool, print_unique_targets, false, "Print unique dynamic targets");
-DEFINE_FLAG(bool, print_gop, false, "Print global object pool");
DEFINE_FLAG(charp,
print_object_layout_to,
nullptr,
@@ -586,7 +585,7 @@
IG->object_store()->set_global_object_pool(pool);
global_object_pool_builder()->Reset();
- if (FLAG_print_gop) {
+ if (FLAG_disassemble) {
THR_Print("Global object pool:\n");
pool.DebugPrint();
}
diff --git a/runtime/vm/compiler/assembler/assembler_arm64.h b/runtime/vm/compiler/assembler/assembler_arm64.h
index e11ed94..9c31f77 100644
--- a/runtime/vm/compiler/assembler/assembler_arm64.h
+++ b/runtime/vm/compiler/assembler/assembler_arm64.h
@@ -1415,11 +1415,11 @@
void fcvtds(VRegister vd, VRegister vn) { EmitFPOneSourceOp(FCVTDS, vd, vn); }
void fldrq(VRegister vt, Address a) {
ASSERT(a.type() != Address::PCOffset);
- EmitLoadStoreReg(FLDRQ, static_cast<Register>(vt), a, kByte);
+ EmitLoadStoreReg(FLDRQ, static_cast<Register>(vt), a, kQWord);
}
void fstrq(VRegister vt, Address a) {
ASSERT(a.type() != Address::PCOffset);
- EmitLoadStoreReg(FSTRQ, static_cast<Register>(vt), a, kByte);
+ EmitLoadStoreReg(FSTRQ, static_cast<Register>(vt), a, kQWord);
}
void fldrd(VRegister vt, Address a) {
ASSERT(a.type() != Address::PCOffset);
diff --git a/runtime/vm/compiler/assembler/assembler_ia32.cc b/runtime/vm/compiler/assembler/assembler_ia32.cc
index 2ead117..3be2b7c 100644
--- a/runtime/vm/compiler/assembler/assembler_ia32.cc
+++ b/runtime/vm/compiler/assembler/assembler_ia32.cc
@@ -2207,6 +2207,16 @@
addl(ESP, Immediate(2 * target::kWordSize));
}
+void Assembler::LoadQImmediate(XmmRegister dst, simd128_value_t value) {
+ // TODO(5410843): Need to have a code constants table.
+ pushl(Immediate(value.int_storage[3]));
+ pushl(Immediate(value.int_storage[2]));
+ pushl(Immediate(value.int_storage[1]));
+ pushl(Immediate(value.int_storage[0]));
+ movups(dst, Address(ESP, 0));
+ addl(ESP, Immediate(4 * target::kWordSize));
+}
+
void Assembler::FloatNegate(XmmRegister f) {
static const struct ALIGN16 {
uint32_t a;
diff --git a/runtime/vm/compiler/assembler/assembler_ia32.h b/runtime/vm/compiler/assembler/assembler_ia32.h
index 48f6a49..d15f736 100644
--- a/runtime/vm/compiler/assembler/assembler_ia32.h
+++ b/runtime/vm/compiler/assembler/assembler_ia32.h
@@ -748,6 +748,7 @@
}
void LoadDImmediate(XmmRegister dst, double value);
+ void LoadQImmediate(XmmRegister dst, simd128_value_t value);
void Drop(intptr_t stack_elements);
diff --git a/runtime/vm/compiler/assembler/assembler_riscv.cc b/runtime/vm/compiler/assembler/assembler_riscv.cc
index 643bb80..668c019 100644
--- a/runtime/vm/compiler/assembler/assembler_riscv.cc
+++ b/runtime/vm/compiler/assembler/assembler_riscv.cc
@@ -3295,13 +3295,32 @@
}
void Assembler::LoadImmediate(Register reg, intx_t imm) {
- intx_t lo = imm << (XLEN - 12) >> (XLEN - 12);
- intx_t hi = (imm - lo) << (XLEN - 32) >> (XLEN - 32);
-
#if XLEN > 32
if (!Utils::IsInt(32, imm)) {
- LoadImmediate(reg, (imm - lo) >> 12);
- slli(reg, reg, 12);
+ int shift = Utils::CountTrailingZeros64(imm);
+ if (IsITypeImm(imm >> shift)) {
+ li(reg, imm >> shift);
+ slli(reg, reg, shift);
+ return;
+ }
+ if ((shift >= 12) && IsUTypeImm(imm >> (shift - 12))) {
+ lui(reg, imm >> (shift - 12));
+ slli(reg, reg, shift - 12);
+ return;
+ }
+
+ if (constant_pool_allowed()) {
+ intptr_t index = object_pool_builder().FindImmediate(imm);
+ LoadWordFromPoolIndex(reg, index);
+ return;
+ }
+
+ intx_t lo = imm << (XLEN - 12) >> (XLEN - 12);
+ intx_t hi = imm - lo;
+ shift = Utils::CountTrailingZeros64(hi);
+ ASSERT(shift != 0);
+ LoadImmediate(reg, hi >> shift);
+ slli(reg, reg, shift);
if (lo != 0) {
addi(reg, reg, lo);
}
@@ -3309,6 +3328,8 @@
}
#endif
+ intx_t lo = imm << (XLEN - 12) >> (XLEN - 12);
+ intx_t hi = (imm - lo) << (XLEN - 32) >> (XLEN - 32);
if (hi == 0) {
addi(reg, ZR, lo);
} else {
diff --git a/runtime/vm/compiler/assembler/assembler_riscv_test.cc b/runtime/vm/compiler/assembler/assembler_riscv_test.cc
index 9f25743..34c1060 100644
--- a/runtime/vm/compiler/assembler/assembler_riscv_test.cc
+++ b/runtime/vm/compiler/assembler/assembler_riscv_test.cc
@@ -6128,33 +6128,89 @@
}
ASSEMBLER_TEST_RUN(LoadImmediate_MinInt64, test) {
EXPECT_DISASSEMBLY(
- "f8000537 lui a0, -134217728\n"
- " 0532 slli a0, a0, 12\n"
- " 0532 slli a0, a0, 12\n"
- " 0532 slli a0, a0, 12\n"
+ " 557d li a0, -1\n"
+ "03f51513 slli a0, a0, 0x3f\n"
" 8082 ret\n");
EXPECT_EQ(kMinInt64, Call(test->entry()));
}
-ASSEMBLER_TEST_GENERATE(LoadImmediate_Large, assembler) {
+ASSEMBLER_TEST_GENERATE(LoadImmediate_Full, assembler) {
FLAG_use_compressed_instructions = true;
__ SetExtensions(RV_GC);
__ LoadImmediate(A0, 0xABCDABCDABCDABCD);
__ ret();
}
-ASSEMBLER_TEST_RUN(LoadImmediate_Large, test) {
+ASSEMBLER_TEST_RUN(LoadImmediate_Full, test) {
EXPECT_DISASSEMBLY(
- "fabce537 lui a0, -88285184\n"
- "abd5051b addiw a0, a0, -1347\n"
+ "feaf3537 lui a0, -22073344\n"
+ "6af5051b addiw a0, a0, 1711\n"
" 0532 slli a0, a0, 12\n"
- "dac50513 addi a0, a0, -596\n"
- " 0532 slli a0, a0, 12\n"
+ "36b50513 addi a0, a0, 875\n"
+ " 053a slli a0, a0, 14\n"
"cdb50513 addi a0, a0, -805\n"
" 0532 slli a0, a0, 12\n"
"bcd50513 addi a0, a0, -1075\n"
" 8082 ret\n");
EXPECT_EQ(static_cast<int64_t>(0xABCDABCDABCDABCD), Call(test->entry()));
}
+
+ASSEMBLER_TEST_GENERATE(LoadImmediate_LuiAddiwSlli, assembler) {
+ FLAG_use_compressed_instructions = true;
+ __ SetExtensions(RV_GC);
+ __ LoadImmediate(A0, 0x7BCDABCD00000);
+ __ ret();
+}
+ASSEMBLER_TEST_RUN(LoadImmediate_LuiAddiwSlli, test) {
+ EXPECT_DISASSEMBLY(
+ "7bcdb537 lui a0, 2077077504\n"
+ "bcd5051b addiw a0, a0, -1075\n"
+ " 0552 slli a0, a0, 20\n"
+ " 8082 ret\n");
+ EXPECT_EQ(static_cast<int64_t>(0x7BCDABCD00000), Call(test->entry()));
+}
+
+ASSEMBLER_TEST_GENERATE(LoadImmediate_LuiSlli, assembler) {
+ FLAG_use_compressed_instructions = true;
+ __ SetExtensions(RV_GC);
+ __ LoadImmediate(A0, 0xABCDE00000000000);
+ __ ret();
+}
+ASSEMBLER_TEST_RUN(LoadImmediate_LuiSlli, test) {
+ EXPECT_DISASSEMBLY(
+ "d5e6f537 lui a0, -706285568\n"
+ "02151513 slli a0, a0, 0x21\n"
+ " 8082 ret\n");
+ EXPECT_EQ(static_cast<int64_t>(0xABCDE00000000000), Call(test->entry()));
+}
+
+ASSEMBLER_TEST_GENERATE(LoadImmediate_LiSlli, assembler) {
+ FLAG_use_compressed_instructions = true;
+ __ SetExtensions(RV_GC);
+ __ LoadImmediate(A0, 0xABC00000000000);
+ __ ret();
+}
+ASSEMBLER_TEST_RUN(LoadImmediate_LiSlli, test) {
+ EXPECT_DISASSEMBLY(
+ "2af00513 li a0, 687\n"
+ "02e51513 slli a0, a0, 0x2e\n"
+ " 8082 ret\n");
+ EXPECT_EQ(static_cast<int64_t>(0xABC00000000000), Call(test->entry()));
+}
+
+ASSEMBLER_TEST_GENERATE(LoadImmediate_LiSlliAddi, assembler) {
+ FLAG_use_compressed_instructions = true;
+ __ SetExtensions(RV_GC);
+ __ LoadImmediate(A0, 0xFF000000000000FF);
+ __ ret();
+}
+ASSEMBLER_TEST_RUN(LoadImmediate_LiSlliAddi, test) {
+ EXPECT_DISASSEMBLY(
+ " 557d li a0, -1\n"
+ "03851513 slli a0, a0, 0x38\n"
+ "0ff50513 addi a0, a0, 255\n"
+ " 8082 ret\n");
+ EXPECT_EQ(static_cast<int64_t>(0xFF000000000000FF), Call(test->entry()));
+}
#endif
ASSEMBLER_TEST_GENERATE(AddImmediateBranchOverflow, assembler) {
diff --git a/runtime/vm/compiler/assembler/disassembler.cc b/runtime/vm/compiler/assembler/disassembler.cc
index e376b04..11484f1 100644
--- a/runtime/vm/compiler/assembler/disassembler.cc
+++ b/runtime/vm/compiler/assembler/disassembler.cc
@@ -225,7 +225,7 @@
#endif
if (FLAG_precompiled_mode) {
- THR_Print("(No object pool for bare instructions.)\n");
+ // Global object pool emitted after it is finalized instead of per-function.
} else {
const ObjectPool& object_pool =
ObjectPool::Handle(zone, code.GetObjectPool());
diff --git a/runtime/vm/compiler/backend/il.cc b/runtime/vm/compiler/backend/il.cc
index a6b8720..93cf612 100644
--- a/runtime/vm/compiler/backend/il.cc
+++ b/runtime/vm/compiler/backend/il.cc
@@ -2988,6 +2988,22 @@
return unbox_defn->value()->definition();
}
+ if (value()->BindsToConstant()) {
+ switch (representation()) {
+ case kUnboxedFloat64x2:
+ ASSERT(value()->BoundConstant().IsFloat64x2());
+ return flow_graph->GetConstant(value()->BoundConstant(), kTagged);
+ case kUnboxedFloat32x4:
+ ASSERT(value()->BoundConstant().IsFloat32x4());
+ return flow_graph->GetConstant(value()->BoundConstant(), kTagged);
+ case kUnboxedInt32x4:
+ ASSERT(value()->BoundConstant().IsInt32x4());
+ return flow_graph->GetConstant(value()->BoundConstant(), kTagged);
+ default:
+ return this;
+ }
+ }
+
return this;
}
@@ -7258,6 +7274,53 @@
return simd_op_information[kind()].has_mask;
}
+Definition* SimdOpInstr::Canonicalize(FlowGraph* flow_graph) {
+ if ((kind() == SimdOpInstr::kFloat64x2FromDoubles) &&
+ InputAt(0)->BindsToConstant() && InputAt(1)->BindsToConstant()) {
+ const Object& x = InputAt(0)->BoundConstant();
+ const Object& y = InputAt(1)->BoundConstant();
+ if (x.IsDouble() && y.IsDouble()) {
+ Float64x2& result = Float64x2::ZoneHandle(Float64x2::New(
+ Double::Cast(x).value(), Double::Cast(y).value(), Heap::kOld));
+ result ^= result.Canonicalize(Thread::Current());
+ return flow_graph->GetConstant(result, kUnboxedFloat64x2);
+ }
+ }
+ if ((kind() == SimdOpInstr::kFloat32x4FromDoubles) &&
+ InputAt(0)->BindsToConstant() && InputAt(1)->BindsToConstant() &&
+ InputAt(2)->BindsToConstant() && InputAt(3)->BindsToConstant()) {
+ const Object& x = InputAt(0)->BoundConstant();
+ const Object& y = InputAt(1)->BoundConstant();
+ const Object& z = InputAt(2)->BoundConstant();
+ const Object& w = InputAt(3)->BoundConstant();
+ if (x.IsDouble() && y.IsDouble() && z.IsDouble() && w.IsDouble()) {
+ Float32x4& result = Float32x4::Handle(Float32x4::New(
+ Double::Cast(x).value(), Double::Cast(y).value(),
+ Double::Cast(z).value(), Double::Cast(w).value(), Heap::kOld));
+ result ^= result.Canonicalize(Thread::Current());
+ return flow_graph->GetConstant(result, kUnboxedFloat32x4);
+ }
+ }
+ if ((kind() == SimdOpInstr::kInt32x4FromInts) &&
+ InputAt(0)->BindsToConstant() && InputAt(1)->BindsToConstant() &&
+ InputAt(2)->BindsToConstant() && InputAt(3)->BindsToConstant()) {
+ const Object& x = InputAt(0)->BoundConstant();
+ const Object& y = InputAt(1)->BoundConstant();
+ const Object& z = InputAt(2)->BoundConstant();
+ const Object& w = InputAt(3)->BoundConstant();
+ if (x.IsInteger() && y.IsInteger() && z.IsInteger() && w.IsInteger()) {
+ Int32x4& result = Int32x4::Handle(Int32x4::New(
+ Integer::Cast(x).AsInt64Value(), Integer::Cast(y).AsInt64Value(),
+ Integer::Cast(z).AsInt64Value(), Integer::Cast(w).AsInt64Value(),
+ Heap::kOld));
+ result ^= result.Canonicalize(Thread::Current());
+ return flow_graph->GetConstant(result, kUnboxedInt32x4);
+ }
+ }
+
+ return this;
+}
+
LocationSummary* Call1ArgStubInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 1;
diff --git a/runtime/vm/compiler/backend/il.h b/runtime/vm/compiler/backend/il.h
index 55899ac..5369c46 100644
--- a/runtime/vm/compiler/backend/il.h
+++ b/runtime/vm/compiler/backend/il.h
@@ -9531,6 +9531,8 @@
(!HasMask() || mask() == other_op->mask());
}
+ virtual Definition* Canonicalize(FlowGraph* flow_graph);
+
DECLARE_INSTRUCTION(SimdOp)
PRINT_OPERANDS_TO_SUPPORT
diff --git a/runtime/vm/compiler/backend/il_arm.cc b/runtime/vm/compiler/backend/il_arm.cc
index 0f1784c..12d26f5 100644
--- a/runtime/vm/compiler/backend/il_arm.cc
+++ b/runtime/vm/compiler/backend/il_arm.cc
@@ -696,25 +696,48 @@
__ LoadObject(destination.reg(), value_);
}
} else if (destination.IsFpuRegister()) {
- const DRegister dst = EvenDRegisterOf(destination.fpu_reg());
- if (Utils::DoublesBitEqual(Double::Cast(value_).value(), 0.0) &&
- TargetCPUFeatures::neon_supported()) {
- QRegister qdst = destination.fpu_reg();
- __ veorq(qdst, qdst, qdst);
- } else {
- ASSERT(tmp != kNoRegister);
- __ LoadDImmediate(dst, Double::Cast(value_).value(), tmp);
+ switch (representation()) {
+ case kUnboxedDouble:
+ ASSERT(tmp != kNoRegister);
+ __ LoadDImmediate(EvenDRegisterOf(destination.fpu_reg()),
+ Double::Cast(value_).value(), tmp);
+ break;
+ case kUnboxedFloat64x2:
+ __ LoadQImmediate(destination.fpu_reg(),
+ Float64x2::Cast(value_).value());
+ break;
+ case kUnboxedFloat32x4:
+ __ LoadQImmediate(destination.fpu_reg(),
+ Float32x4::Cast(value_).value());
+ break;
+ case kUnboxedInt32x4:
+ __ LoadQImmediate(destination.fpu_reg(), Int32x4::Cast(value_).value());
+ break;
+ default:
+ UNREACHABLE();
}
} else if (destination.IsDoubleStackSlot()) {
- if (Utils::DoublesBitEqual(Double::Cast(value_).value(), 0.0) &&
- TargetCPUFeatures::neon_supported()) {
- __ veorq(QTMP, QTMP, QTMP);
- } else {
- ASSERT(tmp != kNoRegister);
- __ LoadDImmediate(DTMP, Double::Cast(value_).value(), tmp);
- }
+ ASSERT(tmp != kNoRegister);
+ __ LoadDImmediate(DTMP, Double::Cast(value_).value(), tmp);
const intptr_t dest_offset = destination.ToStackSlotOffset();
__ StoreDToOffset(DTMP, destination.base_reg(), dest_offset);
+ } else if (destination.IsQuadStackSlot()) {
+ switch (representation()) {
+ case kUnboxedFloat64x2:
+ __ LoadQImmediate(QTMP, Float64x2::Cast(value_).value());
+ break;
+ case kUnboxedFloat32x4:
+ __ LoadQImmediate(QTMP, Float32x4::Cast(value_).value());
+ break;
+ case kUnboxedInt32x4:
+ __ LoadQImmediate(QTMP, Int32x4::Cast(value_).value());
+ break;
+ default:
+ UNREACHABLE();
+ }
+ const intptr_t dest_offset = destination.ToStackSlotOffset();
+ __ StoreMultipleDToOffset(EvenDRegisterOf(QTMP), 2, destination.base_reg(),
+ dest_offset);
} else {
ASSERT(destination.IsStackSlot());
ASSERT(tmp != kNoRegister);
diff --git a/runtime/vm/compiler/backend/il_arm64.cc b/runtime/vm/compiler/backend/il_arm64.cc
index ac442ee..a49d693 100644
--- a/runtime/vm/compiler/backend/il_arm64.cc
+++ b/runtime/vm/compiler/backend/il_arm64.cc
@@ -612,17 +612,42 @@
__ LoadObject(destination.reg(), value_);
}
} else if (destination.IsFpuRegister()) {
- const VRegister dst = destination.fpu_reg();
- if (Utils::DoublesBitEqual(Double::Cast(value_).value(), 0.0)) {
- __ veor(dst, dst, dst);
- } else {
- __ LoadDImmediate(dst, Double::Cast(value_).value());
+ switch (representation()) {
+ case kUnboxedDouble:
+ __ LoadDImmediate(destination.fpu_reg(), Double::Cast(value_).value());
+ break;
+ case kUnboxedFloat64x2:
+ __ LoadQImmediate(destination.fpu_reg(),
+ Float64x2::Cast(value_).value());
+ break;
+ case kUnboxedFloat32x4:
+ __ LoadQImmediate(destination.fpu_reg(),
+ Float32x4::Cast(value_).value());
+ break;
+ case kUnboxedInt32x4:
+ __ LoadQImmediate(destination.fpu_reg(), Int32x4::Cast(value_).value());
+ break;
+ default:
+ UNREACHABLE();
}
} else if (destination.IsDoubleStackSlot()) {
- if (Utils::DoublesBitEqual(Double::Cast(value_).value(), 0.0)) {
- __ veor(VTMP, VTMP, VTMP);
- } else {
- __ LoadDImmediate(VTMP, Double::Cast(value_).value());
+ ASSERT(representation() == kUnboxedDouble);
+ __ LoadDImmediate(VTMP, Double::Cast(value_).value());
+ const intptr_t dest_offset = destination.ToStackSlotOffset();
+ __ StoreDToOffset(VTMP, destination.base_reg(), dest_offset);
+ } else if (destination.IsQuadStackSlot()) {
+ switch (representation()) {
+ case kUnboxedFloat64x2:
+ __ LoadQImmediate(VTMP, Float64x2::Cast(value_).value());
+ break;
+ case kUnboxedFloat32x4:
+ __ LoadQImmediate(VTMP, Float32x4::Cast(value_).value());
+ break;
+ case kUnboxedInt32x4:
+ __ LoadQImmediate(VTMP, Int32x4::Cast(value_).value());
+ break;
+ default:
+ UNREACHABLE();
}
const intptr_t dest_offset = destination.ToStackSlotOffset();
__ StoreDToOffset(VTMP, destination.base_reg(), dest_offset);
diff --git a/runtime/vm/compiler/backend/il_ia32.cc b/runtime/vm/compiler/backend/il_ia32.cc
index 1915491..5b044a0 100644
--- a/runtime/vm/compiler/backend/il_ia32.cc
+++ b/runtime/vm/compiler/backend/il_ia32.cc
@@ -420,18 +420,36 @@
__ LoadObjectSafely(destination.reg(), value_);
}
} else if (destination.IsFpuRegister()) {
- const double value_as_double = Double::Cast(value_).value();
- uword addr = FindDoubleConstant(value_as_double);
- if (addr == 0) {
- __ pushl(EAX);
- __ LoadObject(EAX, value_);
- __ movsd(destination.fpu_reg(),
- compiler::FieldAddress(EAX, Double::value_offset()));
- __ popl(EAX);
- } else if (Utils::DoublesBitEqual(value_as_double, 0.0)) {
- __ xorps(destination.fpu_reg(), destination.fpu_reg());
- } else {
- __ movsd(destination.fpu_reg(), compiler::Address::Absolute(addr));
+ switch (representation()) {
+ case kUnboxedDouble: {
+ const double value_as_double = Double::Cast(value_).value();
+ uword addr = FindDoubleConstant(value_as_double);
+ if (addr == 0) {
+ __ pushl(EAX);
+ __ LoadObject(EAX, value_);
+ __ movsd(destination.fpu_reg(),
+ compiler::FieldAddress(EAX, Double::value_offset()));
+ __ popl(EAX);
+ } else if (Utils::DoublesBitEqual(value_as_double, 0.0)) {
+ __ xorps(destination.fpu_reg(), destination.fpu_reg());
+ } else {
+ __ movsd(destination.fpu_reg(), compiler::Address::Absolute(addr));
+ }
+ break;
+ }
+ case kUnboxedFloat64x2:
+ __ LoadQImmediate(destination.fpu_reg(),
+ Float64x2::Cast(value_).value());
+ break;
+ case kUnboxedFloat32x4:
+ __ LoadQImmediate(destination.fpu_reg(),
+ Float32x4::Cast(value_).value());
+ break;
+ case kUnboxedInt32x4:
+ __ LoadQImmediate(destination.fpu_reg(), Int32x4::Cast(value_).value());
+ break;
+ default:
+ UNREACHABLE();
}
} else if (destination.IsDoubleStackSlot()) {
const double value_as_double = Double::Cast(value_).value();
@@ -447,6 +465,21 @@
__ movsd(FpuTMP, compiler::Address::Absolute(addr));
}
__ movsd(LocationToStackSlotAddress(destination), FpuTMP);
+ } else if (destination.IsQuadStackSlot()) {
+ switch (representation()) {
+ case kUnboxedFloat64x2:
+ __ LoadQImmediate(FpuTMP, Float64x2::Cast(value_).value());
+ break;
+ case kUnboxedFloat32x4:
+ __ LoadQImmediate(FpuTMP, Float32x4::Cast(value_).value());
+ break;
+ case kUnboxedInt32x4:
+ __ LoadQImmediate(FpuTMP, Int32x4::Cast(value_).value());
+ break;
+ default:
+ UNREACHABLE();
+ }
+ __ movups(LocationToStackSlotAddress(destination), FpuTMP);
} else {
ASSERT(destination.IsStackSlot());
if (RepresentationUtils::IsUnboxedInteger(representation())) {
diff --git a/runtime/vm/compiler/backend/il_x64.cc b/runtime/vm/compiler/backend/il_x64.cc
index b6b58ce..e086250 100644
--- a/runtime/vm/compiler/backend/il_x64.cc
+++ b/runtime/vm/compiler/backend/il_x64.cc
@@ -566,10 +566,43 @@
__ LoadObject(destination.reg(), value_);
}
} else if (destination.IsFpuRegister()) {
- __ LoadDImmediate(destination.fpu_reg(), Double::Cast(value_).value());
+ switch (representation()) {
+ case kUnboxedDouble:
+ __ LoadDImmediate(destination.fpu_reg(), Double::Cast(value_).value());
+ break;
+ case kUnboxedFloat64x2:
+ __ LoadQImmediate(destination.fpu_reg(),
+ Float64x2::Cast(value_).value());
+ break;
+ case kUnboxedFloat32x4:
+ __ LoadQImmediate(destination.fpu_reg(),
+ Float32x4::Cast(value_).value());
+ break;
+ case kUnboxedInt32x4:
+ __ LoadQImmediate(destination.fpu_reg(), Int32x4::Cast(value_).value());
+ break;
+ default:
+ UNREACHABLE();
+ }
} else if (destination.IsDoubleStackSlot()) {
+ ASSERT(representation() == kUnboxedDouble);
__ LoadDImmediate(FpuTMP, Double::Cast(value_).value());
__ movsd(LocationToStackSlotAddress(destination), FpuTMP);
+ } else if (destination.IsQuadStackSlot()) {
+ switch (representation()) {
+ case kUnboxedFloat64x2:
+ __ LoadQImmediate(FpuTMP, Float64x2::Cast(value_).value());
+ break;
+ case kUnboxedFloat32x4:
+ __ LoadQImmediate(FpuTMP, Float32x4::Cast(value_).value());
+ break;
+ case kUnboxedInt32x4:
+ __ LoadQImmediate(FpuTMP, Int32x4::Cast(value_).value());
+ break;
+ default:
+ UNREACHABLE();
+ }
+ __ movups(LocationToStackSlotAddress(destination), FpuTMP);
} else {
ASSERT(destination.IsStackSlot());
if (RepresentationUtils::IsUnboxedInteger(representation())) {
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 278ebda..5b11a2b 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -14915,11 +14915,19 @@
void ObjectPool::DebugPrint() const {
THR_Print("ObjectPool len:%" Pd " {\n", Length());
for (intptr_t i = 0; i < Length(); i++) {
- intptr_t offset = OffsetFromIndex(i);
-#if defined(TARGET_ARCH_RISCV32) || defined(TARGET_ARCH_RISCV64)
- THR_Print(" %" Pd "(pp) ", offset + kHeapObjectTag);
+#if defined(DART_PRECOMPILED_RUNTIME)
+ intptr_t offset = ObjectPool::element_offset(i);
#else
- THR_Print(" [pp+0x%" Px "] ", offset);
+ intptr_t offset = compiler::target::ObjectPool::element_offset(i);
+#endif
+#if defined(TARGET_ARCH_RISCV32) || defined(TARGET_ARCH_RISCV64)
+ THR_Print(" %" Pd "(pp) ", offset); // PP is untagged
+#elif defined(TARGET_ARCH_ARM64)
+ THR_Print(" [pp, #%" Pd "] ", offset); // PP is untagged
+#elif defined(TARGET_ARCH_ARM32)
+ THR_Print(" [pp, #%" Pd "] ", offset - kHeapObjectTag); // PP is tagged
+#else
+ THR_Print(" [pp+0x%" Px "] ", offset - kHeapObjectTag); // PP is tagged
#endif
if (TypeAt(i) == EntryType::kTaggedObject) {
const Object& obj = Object::Handle(ObjectAt(i));
@@ -24946,6 +24954,16 @@
return untag()->value_[3];
}
+bool Float32x4::CanonicalizeEquals(const Instance& other) const {
+ return memcmp(&untag()->value_, Float32x4::Cast(other).untag()->value_,
+ sizeof(simd128_value_t)) == 0;
+}
+
+uint32_t Float32x4::CanonicalizeHash() const {
+ return HashBytes(reinterpret_cast<const uint8_t*>(&untag()->value_),
+ sizeof(simd128_value_t));
+}
+
const char* Float32x4::ToCString() const {
float _x = x();
float _y = y();
@@ -25034,6 +25052,16 @@
value);
}
+bool Int32x4::CanonicalizeEquals(const Instance& other) const {
+ return memcmp(&untag()->value_, Int32x4::Cast(other).untag()->value_,
+ sizeof(simd128_value_t)) == 0;
+}
+
+uint32_t Int32x4::CanonicalizeHash() const {
+ return HashBytes(reinterpret_cast<const uint8_t*>(&untag()->value_),
+ sizeof(simd128_value_t));
+}
+
const char* Int32x4::ToCString() const {
int32_t _x = x();
int32_t _y = y();
@@ -25098,6 +25126,16 @@
StoreSimd128(&untag()->value_[0], value);
}
+bool Float64x2::CanonicalizeEquals(const Instance& other) const {
+ return memcmp(&untag()->value_, Float64x2::Cast(other).untag()->value_,
+ sizeof(simd128_value_t)) == 0;
+}
+
+uint32_t Float64x2::CanonicalizeHash() const {
+ return HashBytes(reinterpret_cast<const uint8_t*>(&untag()->value_),
+ sizeof(simd128_value_t));
+}
+
const char* Float64x2::ToCString() const {
double _x = x();
double _y = y();
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index 6f226c3..d42fba8 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -10669,6 +10669,9 @@
return OFFSET_OF(UntaggedFloat32x4, value_);
}
+ virtual bool CanonicalizeEquals(const Instance& other) const;
+ virtual uint32_t CanonicalizeHash() const;
+
private:
FINAL_HEAP_OBJECT_IMPLEMENTATION(Float32x4, Instance);
friend class Class;
@@ -10702,6 +10705,9 @@
static intptr_t value_offset() { return OFFSET_OF(UntaggedInt32x4, value_); }
+ virtual bool CanonicalizeEquals(const Instance& other) const;
+ virtual uint32_t CanonicalizeHash() const;
+
private:
FINAL_HEAP_OBJECT_IMPLEMENTATION(Int32x4, Instance);
friend class Class;
@@ -10732,6 +10738,9 @@
return OFFSET_OF(UntaggedFloat64x2, value_);
}
+ virtual bool CanonicalizeEquals(const Instance& other) const;
+ virtual uint32_t CanonicalizeHash() const;
+
private:
FINAL_HEAP_OBJECT_IMPLEMENTATION(Float64x2, Instance);
friend class Class;
diff --git a/runtime/vm/raw_object.h b/runtime/vm/raw_object.h
index f490865..d7913cf 100644
--- a/runtime/vm/raw_object.h
+++ b/runtime/vm/raw_object.h
@@ -3157,8 +3157,10 @@
ALIGN8 int32_t value_[4];
- friend class Simd128MessageSerializationCluster;
+ friend class Simd128DeserializationCluster;
friend class Simd128MessageDeserializationCluster;
+ friend class Simd128MessageSerializationCluster;
+ friend class Simd128SerializationCluster;
public:
int32_t x() const { return value_[0]; }
diff --git a/tools/VERSION b/tools/VERSION
index aa824e2..b7332b4 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 18
PATCH 0
-PRERELEASE 109
+PRERELEASE 110
PRERELEASE_PATCH 0
\ No newline at end of file
diff --git a/tools/generate_package_config.dart b/tools/generate_package_config.dart
index 150f06f..536a5b6 100644
--- a/tools/generate_package_config.dart
+++ b/tools/generate_package_config.dart
@@ -20,6 +20,7 @@
...listSubdirectories(platform('third_party/pkg')),
...listSubdirectories(platform('third_party/pkg/file/packages')),
...listSubdirectories(platform('third_party/pkg/test/pkgs')),
+ ...listSubdirectories(platform('third_party/pkg/shelf/pkgs')),
platform('pkg/vm_service/test/test_package'),
platform('runtime/observatory_2'),
platform(