mirror of
https://github.com/dart-lang/sdk
synced 2024-09-15 23:29:47 +00:00
Add MetadataAnnotation class and metadata fields to relevant objects
Bug: https://github.com/dart-lang/language/issues/1930 Change-Id: I3ba6facd4c0487b0af18108c8d1db21ee6d5a498 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313640 Auto-Submit: Jake Macdonald <jakemac@google.com> Reviewed-by: Bob Nystrom <rnystrom@google.com> Commit-Queue: Jake Macdonald <jakemac@google.com>
This commit is contained in:
parent
2a302a96ac
commit
4f8061da63
|
@ -9,6 +9,11 @@ part of '../api.dart';
|
||||||
/// Could be a [Declaration] or [Library].
|
/// Could be a [Declaration] or [Library].
|
||||||
abstract interface class MacroTarget {}
|
abstract interface class MacroTarget {}
|
||||||
|
|
||||||
|
/// The interface for things that can be annotated with [MetadataAnnotation]s.
|
||||||
|
abstract interface class Annotatable {
|
||||||
|
Iterable<MetadataAnnotation> get metadata;
|
||||||
|
}
|
||||||
|
|
||||||
/// A concrete reference to a named declaration, which may or may not yet be
|
/// A concrete reference to a named declaration, which may or may not yet be
|
||||||
/// resolved.
|
/// resolved.
|
||||||
///
|
///
|
||||||
|
@ -100,7 +105,7 @@ abstract interface class StaticType {
|
||||||
abstract interface class NamedStaticType implements StaticType {}
|
abstract interface class NamedStaticType implements StaticType {}
|
||||||
|
|
||||||
/// The interface for all declarations.
|
/// The interface for all declarations.
|
||||||
abstract interface class Declaration implements MacroTarget {
|
abstract interface class Declaration implements Annotatable, MacroTarget {
|
||||||
/// The library in which this declaration is defined.
|
/// The library in which this declaration is defined.
|
||||||
Library get library;
|
Library get library;
|
||||||
|
|
||||||
|
@ -297,7 +302,7 @@ abstract interface class FieldDeclaration
|
||||||
|
|
||||||
/// General parameter introspection information, see the subtypes
|
/// General parameter introspection information, see the subtypes
|
||||||
/// [FunctionTypeParameter] and [ParameterDeclaration].
|
/// [FunctionTypeParameter] and [ParameterDeclaration].
|
||||||
abstract interface class Parameter {
|
abstract interface class Parameter implements Annotatable {
|
||||||
/// The type of this parameter.
|
/// The type of this parameter.
|
||||||
TypeAnnotation get type;
|
TypeAnnotation get type;
|
||||||
|
|
||||||
|
@ -356,7 +361,7 @@ abstract interface class RecordFieldDeclaration implements Declaration {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Introspection information for a Library.
|
/// Introspection information for a Library.
|
||||||
abstract interface class Library implements MacroTarget {
|
abstract interface class Library implements Annotatable, MacroTarget {
|
||||||
/// The language version of this library.
|
/// The language version of this library.
|
||||||
LanguageVersion get languageVersion;
|
LanguageVersion get languageVersion;
|
||||||
|
|
||||||
|
@ -371,3 +376,26 @@ abstract interface class LanguageVersion {
|
||||||
|
|
||||||
int get minor;
|
int get minor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// A metadata annotation on a declaration or library directive.
|
||||||
|
abstract interface class MetadataAnnotation {}
|
||||||
|
|
||||||
|
/// A [MetadataAnnotation] which is a reference to a const value.
|
||||||
|
abstract interface class IdentifierMetadataAnnotation
|
||||||
|
implements MetadataAnnotation {
|
||||||
|
/// The [Identifier] for the const reference.
|
||||||
|
Identifier get identifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// A [Metadata] annotation which is a constructor call.
|
||||||
|
abstract interface class ConstructorMetadataAnnotation
|
||||||
|
implements MetadataAnnotation {
|
||||||
|
/// And [Identifier] referring to the type that is being constructed.
|
||||||
|
Identifier get type;
|
||||||
|
|
||||||
|
/// An [Identifier] referring to the specific constructor being called.
|
||||||
|
///
|
||||||
|
/// For unnamed constructors, the name of this identifier will be the empty
|
||||||
|
/// String.
|
||||||
|
Identifier get constructor;
|
||||||
|
}
|
||||||
|
|
|
@ -158,6 +158,7 @@ class RecordFieldDeclarationImpl extends DeclarationImpl
|
||||||
required super.id,
|
required super.id,
|
||||||
required super.identifier,
|
required super.identifier,
|
||||||
required super.library,
|
required super.library,
|
||||||
|
required super.metadata,
|
||||||
required this.name,
|
required this.name,
|
||||||
required this.type,
|
required this.type,
|
||||||
});
|
});
|
||||||
|
@ -253,6 +254,56 @@ class OmittedTypeAnnotationImpl extends TypeAnnotationImpl
|
||||||
RemoteInstanceKind get kind => RemoteInstanceKind.omittedTypeAnnotation;
|
RemoteInstanceKind get kind => RemoteInstanceKind.omittedTypeAnnotation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
abstract class MetadataAnnotationImpl extends RemoteInstance
|
||||||
|
implements MetadataAnnotation {
|
||||||
|
MetadataAnnotationImpl(super.id);
|
||||||
|
}
|
||||||
|
|
||||||
|
class IdentifierMetadataAnnotationImpl extends MetadataAnnotationImpl
|
||||||
|
implements IdentifierMetadataAnnotation {
|
||||||
|
@override
|
||||||
|
final IdentifierImpl identifier;
|
||||||
|
|
||||||
|
@override
|
||||||
|
RemoteInstanceKind get kind =>
|
||||||
|
RemoteInstanceKind.identifierMetadataAnnotation;
|
||||||
|
|
||||||
|
IdentifierMetadataAnnotationImpl({required int id, required this.identifier})
|
||||||
|
: super(id);
|
||||||
|
|
||||||
|
@override
|
||||||
|
void serializeUncached(Serializer serializer) {
|
||||||
|
super.serializeUncached(serializer);
|
||||||
|
|
||||||
|
identifier.serialize(serializer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ConstructorMetadataAnnotationImpl extends MetadataAnnotationImpl
|
||||||
|
implements ConstructorMetadataAnnotation {
|
||||||
|
@override
|
||||||
|
final IdentifierImpl constructor;
|
||||||
|
|
||||||
|
@override
|
||||||
|
final IdentifierImpl type;
|
||||||
|
|
||||||
|
@override
|
||||||
|
RemoteInstanceKind get kind =>
|
||||||
|
RemoteInstanceKind.constructorMetadataAnnotation;
|
||||||
|
|
||||||
|
ConstructorMetadataAnnotationImpl(
|
||||||
|
{required int id, required this.constructor, required this.type})
|
||||||
|
: super(id);
|
||||||
|
|
||||||
|
@override
|
||||||
|
void serializeUncached(Serializer serializer) {
|
||||||
|
super.serializeUncached(serializer);
|
||||||
|
|
||||||
|
constructor.serialize(serializer);
|
||||||
|
type.serialize(serializer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
abstract class DeclarationImpl extends RemoteInstance implements Declaration {
|
abstract class DeclarationImpl extends RemoteInstance implements Declaration {
|
||||||
@override
|
@override
|
||||||
final IdentifierImpl identifier;
|
final IdentifierImpl identifier;
|
||||||
|
@ -260,10 +311,14 @@ abstract class DeclarationImpl extends RemoteInstance implements Declaration {
|
||||||
@override
|
@override
|
||||||
final LibraryImpl library;
|
final LibraryImpl library;
|
||||||
|
|
||||||
|
@override
|
||||||
|
final List<MetadataAnnotationImpl> metadata;
|
||||||
|
|
||||||
DeclarationImpl({
|
DeclarationImpl({
|
||||||
required int id,
|
required int id,
|
||||||
required this.identifier,
|
required this.identifier,
|
||||||
required this.library,
|
required this.library,
|
||||||
|
required this.metadata,
|
||||||
}) : super(id);
|
}) : super(id);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -272,6 +327,11 @@ abstract class DeclarationImpl extends RemoteInstance implements Declaration {
|
||||||
|
|
||||||
identifier.serialize(serializer);
|
identifier.serialize(serializer);
|
||||||
library.serialize(serializer);
|
library.serialize(serializer);
|
||||||
|
serializer.startList();
|
||||||
|
for (MetadataAnnotationImpl annotation in metadata) {
|
||||||
|
annotation.serialize(serializer);
|
||||||
|
}
|
||||||
|
serializer.endList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -293,6 +353,7 @@ class ParameterDeclarationImpl extends DeclarationImpl
|
||||||
required super.id,
|
required super.id,
|
||||||
required super.identifier,
|
required super.identifier,
|
||||||
required super.library,
|
required super.library,
|
||||||
|
required super.metadata,
|
||||||
required this.isNamed,
|
required this.isNamed,
|
||||||
required this.isRequired,
|
required this.isRequired,
|
||||||
required this.type,
|
required this.type,
|
||||||
|
@ -322,6 +383,9 @@ class FunctionTypeParameterImpl extends RemoteInstance
|
||||||
@override
|
@override
|
||||||
final bool isRequired;
|
final bool isRequired;
|
||||||
|
|
||||||
|
@override
|
||||||
|
final List<MetadataAnnotationImpl> metadata;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
final String? name;
|
final String? name;
|
||||||
|
|
||||||
|
@ -335,6 +399,7 @@ class FunctionTypeParameterImpl extends RemoteInstance
|
||||||
required int id,
|
required int id,
|
||||||
required this.isNamed,
|
required this.isNamed,
|
||||||
required this.isRequired,
|
required this.isRequired,
|
||||||
|
required this.metadata,
|
||||||
required this.name,
|
required this.name,
|
||||||
required this.type,
|
required this.type,
|
||||||
}) : super(id);
|
}) : super(id);
|
||||||
|
@ -345,6 +410,12 @@ class FunctionTypeParameterImpl extends RemoteInstance
|
||||||
|
|
||||||
serializer.addBool(isNamed);
|
serializer.addBool(isNamed);
|
||||||
serializer.addBool(isRequired);
|
serializer.addBool(isRequired);
|
||||||
|
|
||||||
|
serializer.startList();
|
||||||
|
for (MetadataAnnotationImpl annotation in metadata) {
|
||||||
|
annotation.serialize(serializer);
|
||||||
|
}
|
||||||
|
serializer.endList();
|
||||||
serializer.addNullableString(name);
|
serializer.addNullableString(name);
|
||||||
type.serialize(serializer);
|
type.serialize(serializer);
|
||||||
}
|
}
|
||||||
|
@ -368,6 +439,7 @@ class TypeParameterDeclarationImpl extends DeclarationImpl
|
||||||
required super.id,
|
required super.id,
|
||||||
required super.identifier,
|
required super.identifier,
|
||||||
required super.library,
|
required super.library,
|
||||||
|
required super.metadata,
|
||||||
required this.bound,
|
required this.bound,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -424,6 +496,7 @@ class FunctionDeclarationImpl extends DeclarationImpl
|
||||||
required super.id,
|
required super.id,
|
||||||
required super.identifier,
|
required super.identifier,
|
||||||
required super.library,
|
required super.library,
|
||||||
|
required super.metadata,
|
||||||
required this.isAbstract,
|
required this.isAbstract,
|
||||||
required this.isExternal,
|
required this.isExternal,
|
||||||
required this.isGetter,
|
required this.isGetter,
|
||||||
|
@ -481,6 +554,7 @@ class MethodDeclarationImpl extends FunctionDeclarationImpl
|
||||||
required super.id,
|
required super.id,
|
||||||
required super.identifier,
|
required super.identifier,
|
||||||
required super.library,
|
required super.library,
|
||||||
|
required super.metadata,
|
||||||
// Function fields.
|
// Function fields.
|
||||||
required super.isAbstract,
|
required super.isAbstract,
|
||||||
required super.isExternal,
|
required super.isExternal,
|
||||||
|
@ -518,6 +592,7 @@ class ConstructorDeclarationImpl extends MethodDeclarationImpl
|
||||||
required super.id,
|
required super.id,
|
||||||
required super.identifier,
|
required super.identifier,
|
||||||
required super.library,
|
required super.library,
|
||||||
|
required super.metadata,
|
||||||
// Function fields.
|
// Function fields.
|
||||||
required super.isAbstract,
|
required super.isAbstract,
|
||||||
required super.isExternal,
|
required super.isExternal,
|
||||||
|
@ -565,6 +640,7 @@ class VariableDeclarationImpl extends DeclarationImpl
|
||||||
required super.id,
|
required super.id,
|
||||||
required super.identifier,
|
required super.identifier,
|
||||||
required super.library,
|
required super.library,
|
||||||
|
required super.metadata,
|
||||||
required this.isExternal,
|
required this.isExternal,
|
||||||
required this.isFinal,
|
required this.isFinal,
|
||||||
required this.isLate,
|
required this.isLate,
|
||||||
|
@ -596,6 +672,7 @@ class FieldDeclarationImpl extends VariableDeclarationImpl
|
||||||
required super.id,
|
required super.id,
|
||||||
required super.identifier,
|
required super.identifier,
|
||||||
required super.library,
|
required super.library,
|
||||||
|
required super.metadata,
|
||||||
// Variable fields.
|
// Variable fields.
|
||||||
required super.isExternal,
|
required super.isExternal,
|
||||||
required super.isFinal,
|
required super.isFinal,
|
||||||
|
@ -630,6 +707,7 @@ abstract class ParameterizedTypeDeclarationImpl extends DeclarationImpl
|
||||||
required super.id,
|
required super.id,
|
||||||
required super.identifier,
|
required super.identifier,
|
||||||
required super.library,
|
required super.library,
|
||||||
|
required super.metadata,
|
||||||
required this.typeParameters,
|
required this.typeParameters,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -695,6 +773,7 @@ class ClassDeclarationImpl extends ParameterizedTypeDeclarationImpl
|
||||||
required super.id,
|
required super.id,
|
||||||
required super.identifier,
|
required super.identifier,
|
||||||
required super.library,
|
required super.library,
|
||||||
|
required super.metadata,
|
||||||
// TypeDeclaration fields.
|
// TypeDeclaration fields.
|
||||||
required super.typeParameters,
|
required super.typeParameters,
|
||||||
// ClassDeclaration fields.
|
// ClassDeclaration fields.
|
||||||
|
@ -762,6 +841,7 @@ class EnumDeclarationImpl extends ParameterizedTypeDeclarationImpl
|
||||||
required super.id,
|
required super.id,
|
||||||
required super.identifier,
|
required super.identifier,
|
||||||
required super.library,
|
required super.library,
|
||||||
|
required super.metadata,
|
||||||
// TypeDeclaration fields.
|
// TypeDeclaration fields.
|
||||||
required super.typeParameters,
|
required super.typeParameters,
|
||||||
// EnumDeclaration fields.
|
// EnumDeclaration fields.
|
||||||
|
@ -799,6 +879,7 @@ class EnumValueDeclarationImpl extends DeclarationImpl
|
||||||
required super.id,
|
required super.id,
|
||||||
required super.identifier,
|
required super.identifier,
|
||||||
required super.library,
|
required super.library,
|
||||||
|
required super.metadata,
|
||||||
required this.definingEnum,
|
required this.definingEnum,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -836,6 +917,7 @@ class MixinDeclarationImpl extends ParameterizedTypeDeclarationImpl
|
||||||
required super.id,
|
required super.id,
|
||||||
required super.identifier,
|
required super.identifier,
|
||||||
required super.library,
|
required super.library,
|
||||||
|
required super.metadata,
|
||||||
// TypeDeclaration fields.
|
// TypeDeclaration fields.
|
||||||
required super.typeParameters,
|
required super.typeParameters,
|
||||||
// MixinDeclaration fields.
|
// MixinDeclaration fields.
|
||||||
|
@ -878,6 +960,7 @@ class TypeAliasDeclarationImpl extends ParameterizedTypeDeclarationImpl
|
||||||
required super.id,
|
required super.id,
|
||||||
required super.identifier,
|
required super.identifier,
|
||||||
required super.library,
|
required super.library,
|
||||||
|
required super.metadata,
|
||||||
// TypeDeclaration fields.
|
// TypeDeclaration fields.
|
||||||
required super.typeParameters,
|
required super.typeParameters,
|
||||||
// TypeAlias fields.
|
// TypeAlias fields.
|
||||||
|
@ -899,11 +982,17 @@ class LibraryImpl extends RemoteInstance implements Library {
|
||||||
@override
|
@override
|
||||||
final LanguageVersionImpl languageVersion;
|
final LanguageVersionImpl languageVersion;
|
||||||
|
|
||||||
|
@override
|
||||||
|
final List<MetadataAnnotationImpl> metadata;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
final Uri uri;
|
final Uri uri;
|
||||||
|
|
||||||
LibraryImpl(
|
LibraryImpl(
|
||||||
{required int id, required this.languageVersion, required this.uri})
|
{required int id,
|
||||||
|
required this.languageVersion,
|
||||||
|
required this.metadata,
|
||||||
|
required this.uri})
|
||||||
: super(id);
|
: super(id);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -911,6 +1000,11 @@ class LibraryImpl extends RemoteInstance implements Library {
|
||||||
super.serializeUncached(serializer);
|
super.serializeUncached(serializer);
|
||||||
|
|
||||||
languageVersion.serialize(serializer);
|
languageVersion.serialize(serializer);
|
||||||
|
serializer.startList();
|
||||||
|
for (MetadataAnnotationImpl annotation in metadata) {
|
||||||
|
annotation.serialize(serializer);
|
||||||
|
}
|
||||||
|
serializer.endList();
|
||||||
serializer.addUri(uri);
|
serializer.addUri(uri);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,6 +101,7 @@ class RemoteInstanceImpl extends RemoteInstance {
|
||||||
enum RemoteInstanceKind {
|
enum RemoteInstanceKind {
|
||||||
classDeclaration,
|
classDeclaration,
|
||||||
constructorDeclaration,
|
constructorDeclaration,
|
||||||
|
constructorMetadataAnnotation,
|
||||||
enumDeclaration,
|
enumDeclaration,
|
||||||
enumValueDeclaration,
|
enumValueDeclaration,
|
||||||
fieldDeclaration,
|
fieldDeclaration,
|
||||||
|
@ -108,6 +109,7 @@ enum RemoteInstanceKind {
|
||||||
functionTypeAnnotation,
|
functionTypeAnnotation,
|
||||||
functionTypeParameter,
|
functionTypeParameter,
|
||||||
identifier,
|
identifier,
|
||||||
|
identifierMetadataAnnotation,
|
||||||
identifierResolver,
|
identifierResolver,
|
||||||
introspectableClassDeclaration,
|
introspectableClassDeclaration,
|
||||||
introspectableEnumDeclaration,
|
introspectableEnumDeclaration,
|
||||||
|
|
|
@ -29,6 +29,8 @@ extension DeserializerExtensions on Deserializer {
|
||||||
new RemoteInstanceImpl(id: id, kind: kind),
|
new RemoteInstanceImpl(id: id, kind: kind),
|
||||||
RemoteInstanceKind.classDeclaration =>
|
RemoteInstanceKind.classDeclaration =>
|
||||||
(this..moveNext())._expectClassDeclaration(id),
|
(this..moveNext())._expectClassDeclaration(id),
|
||||||
|
RemoteInstanceKind.constructorMetadataAnnotation =>
|
||||||
|
(this..moveNext())._expectConstructorMetadataAnnotation(id),
|
||||||
RemoteInstanceKind.enumDeclaration =>
|
RemoteInstanceKind.enumDeclaration =>
|
||||||
(this..moveNext())._expectEnumDeclaration(id),
|
(this..moveNext())._expectEnumDeclaration(id),
|
||||||
RemoteInstanceKind.enumValueDeclaration =>
|
RemoteInstanceKind.enumValueDeclaration =>
|
||||||
|
@ -46,6 +48,8 @@ extension DeserializerExtensions on Deserializer {
|
||||||
RemoteInstanceKind.functionTypeParameter =>
|
RemoteInstanceKind.functionTypeParameter =>
|
||||||
(this..moveNext())._expectFunctionTypeParameter(id),
|
(this..moveNext())._expectFunctionTypeParameter(id),
|
||||||
RemoteInstanceKind.identifier => (this..moveNext())._expectIdentifier(id),
|
RemoteInstanceKind.identifier => (this..moveNext())._expectIdentifier(id),
|
||||||
|
RemoteInstanceKind.identifierMetadataAnnotation =>
|
||||||
|
(this..moveNext())._expectIdentifierMetadataAnnotation(id),
|
||||||
RemoteInstanceKind.introspectableClassDeclaration =>
|
RemoteInstanceKind.introspectableClassDeclaration =>
|
||||||
(this..moveNext())._expectIntrospectableClassDeclaration(id),
|
(this..moveNext())._expectIntrospectableClassDeclaration(id),
|
||||||
RemoteInstanceKind.introspectableEnumDeclaration =>
|
RemoteInstanceKind.introspectableEnumDeclaration =>
|
||||||
|
@ -117,6 +121,7 @@ extension DeserializerExtensions on Deserializer {
|
||||||
id: id,
|
id: id,
|
||||||
isNamed: expectBool(),
|
isNamed: expectBool(),
|
||||||
isRequired: (this..moveNext()).expectBool(),
|
isRequired: (this..moveNext()).expectBool(),
|
||||||
|
metadata: (this..moveNext())._expectRemoteInstanceList(),
|
||||||
name: (this..moveNext()).expectNullableString(),
|
name: (this..moveNext()).expectNullableString(),
|
||||||
type: RemoteInstance.deserialize(this),
|
type: RemoteInstance.deserialize(this),
|
||||||
);
|
);
|
||||||
|
@ -131,6 +136,7 @@ extension DeserializerExtensions on Deserializer {
|
||||||
id: id,
|
id: id,
|
||||||
identifier: expectRemoteInstance(),
|
identifier: expectRemoteInstance(),
|
||||||
library: RemoteInstance.deserialize(this),
|
library: RemoteInstance.deserialize(this),
|
||||||
|
metadata: (this..moveNext())._expectRemoteInstanceList(),
|
||||||
isNamed: (this..moveNext()).expectBool(),
|
isNamed: (this..moveNext()).expectBool(),
|
||||||
isRequired: (this..moveNext()).expectBool(),
|
isRequired: (this..moveNext()).expectBool(),
|
||||||
type: RemoteInstance.deserialize(this),
|
type: RemoteInstance.deserialize(this),
|
||||||
|
@ -141,6 +147,7 @@ extension DeserializerExtensions on Deserializer {
|
||||||
id: id,
|
id: id,
|
||||||
identifier: expectRemoteInstance(),
|
identifier: expectRemoteInstance(),
|
||||||
library: RemoteInstance.deserialize(this),
|
library: RemoteInstance.deserialize(this),
|
||||||
|
metadata: (this..moveNext())._expectRemoteInstanceList(),
|
||||||
name: (this..moveNext()).expectNullableString(),
|
name: (this..moveNext()).expectNullableString(),
|
||||||
type: (this..moveNext()).expectRemoteInstance());
|
type: (this..moveNext()).expectRemoteInstance());
|
||||||
|
|
||||||
|
@ -157,6 +164,7 @@ extension DeserializerExtensions on Deserializer {
|
||||||
id: id,
|
id: id,
|
||||||
identifier: expectRemoteInstance(),
|
identifier: expectRemoteInstance(),
|
||||||
library: RemoteInstance.deserialize(this),
|
library: RemoteInstance.deserialize(this),
|
||||||
|
metadata: (this..moveNext())._expectRemoteInstanceList(),
|
||||||
bound: (this..moveNext()).checkNull() ? null : expectRemoteInstance(),
|
bound: (this..moveNext()).checkNull() ? null : expectRemoteInstance(),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -165,6 +173,7 @@ extension DeserializerExtensions on Deserializer {
|
||||||
id: id,
|
id: id,
|
||||||
identifier: expectRemoteInstance(),
|
identifier: expectRemoteInstance(),
|
||||||
library: RemoteInstance.deserialize(this),
|
library: RemoteInstance.deserialize(this),
|
||||||
|
metadata: (this..moveNext())._expectRemoteInstanceList(),
|
||||||
isAbstract: (this..moveNext()).expectBool(),
|
isAbstract: (this..moveNext()).expectBool(),
|
||||||
isExternal: (this..moveNext()).expectBool(),
|
isExternal: (this..moveNext()).expectBool(),
|
||||||
isGetter: (this..moveNext()).expectBool(),
|
isGetter: (this..moveNext()).expectBool(),
|
||||||
|
@ -181,6 +190,7 @@ extension DeserializerExtensions on Deserializer {
|
||||||
id: id,
|
id: id,
|
||||||
identifier: expectRemoteInstance(),
|
identifier: expectRemoteInstance(),
|
||||||
library: RemoteInstance.deserialize(this),
|
library: RemoteInstance.deserialize(this),
|
||||||
|
metadata: (this..moveNext())._expectRemoteInstanceList(),
|
||||||
isAbstract: (this..moveNext()).expectBool(),
|
isAbstract: (this..moveNext()).expectBool(),
|
||||||
isExternal: (this..moveNext()).expectBool(),
|
isExternal: (this..moveNext()).expectBool(),
|
||||||
isGetter: (this..moveNext()).expectBool(),
|
isGetter: (this..moveNext()).expectBool(),
|
||||||
|
@ -199,6 +209,7 @@ extension DeserializerExtensions on Deserializer {
|
||||||
id: id,
|
id: id,
|
||||||
identifier: expectRemoteInstance(),
|
identifier: expectRemoteInstance(),
|
||||||
library: RemoteInstance.deserialize(this),
|
library: RemoteInstance.deserialize(this),
|
||||||
|
metadata: (this..moveNext())._expectRemoteInstanceList(),
|
||||||
isAbstract: (this..moveNext()).expectBool(),
|
isAbstract: (this..moveNext()).expectBool(),
|
||||||
isExternal: (this..moveNext()).expectBool(),
|
isExternal: (this..moveNext()).expectBool(),
|
||||||
isGetter: (this..moveNext()).expectBool(),
|
isGetter: (this..moveNext()).expectBool(),
|
||||||
|
@ -223,6 +234,7 @@ extension DeserializerExtensions on Deserializer {
|
||||||
id: id,
|
id: id,
|
||||||
identifier: expectRemoteInstance(),
|
identifier: expectRemoteInstance(),
|
||||||
library: RemoteInstance.deserialize(this),
|
library: RemoteInstance.deserialize(this),
|
||||||
|
metadata: (this..moveNext())._expectRemoteInstanceList(),
|
||||||
isExternal: (this..moveNext()).expectBool(),
|
isExternal: (this..moveNext()).expectBool(),
|
||||||
isFinal: (this..moveNext()).expectBool(),
|
isFinal: (this..moveNext()).expectBool(),
|
||||||
isLate: (this..moveNext()).expectBool(),
|
isLate: (this..moveNext()).expectBool(),
|
||||||
|
@ -234,6 +246,7 @@ extension DeserializerExtensions on Deserializer {
|
||||||
id: id,
|
id: id,
|
||||||
identifier: expectRemoteInstance(),
|
identifier: expectRemoteInstance(),
|
||||||
library: RemoteInstance.deserialize(this),
|
library: RemoteInstance.deserialize(this),
|
||||||
|
metadata: (this..moveNext())._expectRemoteInstanceList(),
|
||||||
isExternal: (this..moveNext()).expectBool(),
|
isExternal: (this..moveNext()).expectBool(),
|
||||||
isFinal: (this..moveNext()).expectBool(),
|
isFinal: (this..moveNext()).expectBool(),
|
||||||
isLate: (this..moveNext()).expectBool(),
|
isLate: (this..moveNext()).expectBool(),
|
||||||
|
@ -247,6 +260,7 @@ extension DeserializerExtensions on Deserializer {
|
||||||
id: id,
|
id: id,
|
||||||
identifier: expectRemoteInstance(),
|
identifier: expectRemoteInstance(),
|
||||||
library: RemoteInstance.deserialize(this),
|
library: RemoteInstance.deserialize(this),
|
||||||
|
metadata: (this..moveNext())._expectRemoteInstanceList(),
|
||||||
typeParameters: (this..moveNext())._expectRemoteInstanceList(),
|
typeParameters: (this..moveNext())._expectRemoteInstanceList(),
|
||||||
interfaces: (this..moveNext())._expectRemoteInstanceList(),
|
interfaces: (this..moveNext())._expectRemoteInstanceList(),
|
||||||
hasAbstract: (this..moveNext()).expectBool(),
|
hasAbstract: (this..moveNext()).expectBool(),
|
||||||
|
@ -261,12 +275,27 @@ extension DeserializerExtensions on Deserializer {
|
||||||
(this..moveNext()).checkNull() ? null : expectRemoteInstance(),
|
(this..moveNext()).checkNull() ? null : expectRemoteInstance(),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
ConstructorMetadataAnnotationImpl _expectConstructorMetadataAnnotation(
|
||||||
|
int id) =>
|
||||||
|
new ConstructorMetadataAnnotationImpl(
|
||||||
|
id: id,
|
||||||
|
constructor: expectRemoteInstance(),
|
||||||
|
type: RemoteInstance.deserialize(this));
|
||||||
|
|
||||||
|
IdentifierMetadataAnnotationImpl _expectIdentifierMetadataAnnotation(
|
||||||
|
int id) =>
|
||||||
|
new IdentifierMetadataAnnotationImpl(
|
||||||
|
id: id,
|
||||||
|
identifier: expectRemoteInstance(),
|
||||||
|
);
|
||||||
|
|
||||||
IntrospectableClassDeclarationImpl _expectIntrospectableClassDeclaration(
|
IntrospectableClassDeclarationImpl _expectIntrospectableClassDeclaration(
|
||||||
int id) =>
|
int id) =>
|
||||||
new IntrospectableClassDeclarationImpl(
|
new IntrospectableClassDeclarationImpl(
|
||||||
id: id,
|
id: id,
|
||||||
identifier: expectRemoteInstance(),
|
identifier: expectRemoteInstance(),
|
||||||
library: RemoteInstance.deserialize(this),
|
library: RemoteInstance.deserialize(this),
|
||||||
|
metadata: (this..moveNext())._expectRemoteInstanceList(),
|
||||||
typeParameters: (this..moveNext())._expectRemoteInstanceList(),
|
typeParameters: (this..moveNext())._expectRemoteInstanceList(),
|
||||||
interfaces: (this..moveNext())._expectRemoteInstanceList(),
|
interfaces: (this..moveNext())._expectRemoteInstanceList(),
|
||||||
hasAbstract: (this..moveNext()).expectBool(),
|
hasAbstract: (this..moveNext()).expectBool(),
|
||||||
|
@ -285,6 +314,7 @@ extension DeserializerExtensions on Deserializer {
|
||||||
id: id,
|
id: id,
|
||||||
identifier: expectRemoteInstance(),
|
identifier: expectRemoteInstance(),
|
||||||
library: RemoteInstance.deserialize(this),
|
library: RemoteInstance.deserialize(this),
|
||||||
|
metadata: (this..moveNext())._expectRemoteInstanceList(),
|
||||||
typeParameters: (this..moveNext())._expectRemoteInstanceList(),
|
typeParameters: (this..moveNext())._expectRemoteInstanceList(),
|
||||||
interfaces: (this..moveNext())._expectRemoteInstanceList(),
|
interfaces: (this..moveNext())._expectRemoteInstanceList(),
|
||||||
mixins: (this..moveNext())._expectRemoteInstanceList(),
|
mixins: (this..moveNext())._expectRemoteInstanceList(),
|
||||||
|
@ -296,6 +326,7 @@ extension DeserializerExtensions on Deserializer {
|
||||||
id: id,
|
id: id,
|
||||||
identifier: expectRemoteInstance(),
|
identifier: expectRemoteInstance(),
|
||||||
library: RemoteInstance.deserialize(this),
|
library: RemoteInstance.deserialize(this),
|
||||||
|
metadata: (this..moveNext())._expectRemoteInstanceList(),
|
||||||
typeParameters: (this..moveNext())._expectRemoteInstanceList(),
|
typeParameters: (this..moveNext())._expectRemoteInstanceList(),
|
||||||
interfaces: (this..moveNext())._expectRemoteInstanceList(),
|
interfaces: (this..moveNext())._expectRemoteInstanceList(),
|
||||||
mixins: (this..moveNext())._expectRemoteInstanceList(),
|
mixins: (this..moveNext())._expectRemoteInstanceList(),
|
||||||
|
@ -306,6 +337,7 @@ extension DeserializerExtensions on Deserializer {
|
||||||
id: id,
|
id: id,
|
||||||
identifier: expectRemoteInstance(),
|
identifier: expectRemoteInstance(),
|
||||||
library: RemoteInstance.deserialize(this),
|
library: RemoteInstance.deserialize(this),
|
||||||
|
metadata: (this..moveNext())._expectRemoteInstanceList(),
|
||||||
typeParameters: (this..moveNext())._expectRemoteInstanceList(),
|
typeParameters: (this..moveNext())._expectRemoteInstanceList(),
|
||||||
hasBase: (this..moveNext()).expectBool(),
|
hasBase: (this..moveNext()).expectBool(),
|
||||||
interfaces: (this..moveNext())._expectRemoteInstanceList(),
|
interfaces: (this..moveNext())._expectRemoteInstanceList(),
|
||||||
|
@ -318,6 +350,7 @@ extension DeserializerExtensions on Deserializer {
|
||||||
id: id,
|
id: id,
|
||||||
identifier: expectRemoteInstance(),
|
identifier: expectRemoteInstance(),
|
||||||
library: RemoteInstance.deserialize(this),
|
library: RemoteInstance.deserialize(this),
|
||||||
|
metadata: (this..moveNext())._expectRemoteInstanceList(),
|
||||||
typeParameters: (this..moveNext())._expectRemoteInstanceList(),
|
typeParameters: (this..moveNext())._expectRemoteInstanceList(),
|
||||||
hasBase: (this..moveNext()).expectBool(),
|
hasBase: (this..moveNext()).expectBool(),
|
||||||
interfaces: (this..moveNext())._expectRemoteInstanceList(),
|
interfaces: (this..moveNext())._expectRemoteInstanceList(),
|
||||||
|
@ -329,6 +362,7 @@ extension DeserializerExtensions on Deserializer {
|
||||||
id: id,
|
id: id,
|
||||||
identifier: expectRemoteInstance(),
|
identifier: expectRemoteInstance(),
|
||||||
library: RemoteInstance.deserialize(this),
|
library: RemoteInstance.deserialize(this),
|
||||||
|
metadata: (this..moveNext())._expectRemoteInstanceList(),
|
||||||
definingEnum: RemoteInstance.deserialize(this),
|
definingEnum: RemoteInstance.deserialize(this),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -337,6 +371,7 @@ extension DeserializerExtensions on Deserializer {
|
||||||
id: id,
|
id: id,
|
||||||
identifier: expectRemoteInstance(),
|
identifier: expectRemoteInstance(),
|
||||||
library: RemoteInstance.deserialize(this),
|
library: RemoteInstance.deserialize(this),
|
||||||
|
metadata: (this..moveNext())._expectRemoteInstanceList(),
|
||||||
typeParameters: (this..moveNext())._expectRemoteInstanceList(),
|
typeParameters: (this..moveNext())._expectRemoteInstanceList(),
|
||||||
aliasedType: RemoteInstance.deserialize(this),
|
aliasedType: RemoteInstance.deserialize(this),
|
||||||
);
|
);
|
||||||
|
@ -345,6 +380,7 @@ extension DeserializerExtensions on Deserializer {
|
||||||
id: id,
|
id: id,
|
||||||
languageVersion: new LanguageVersionImpl(
|
languageVersion: new LanguageVersionImpl(
|
||||||
this.expectInt(), (this..moveNext()).expectInt()),
|
this.expectInt(), (this..moveNext()).expectInt()),
|
||||||
|
metadata: (this..moveNext())._expectRemoteInstanceList(),
|
||||||
uri: (this..moveNext()).expectUri(),
|
uri: (this..moveNext()).expectUri(),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@ void main() {
|
||||||
id: RemoteInstance.uniqueId,
|
id: RemoteInstance.uniqueId,
|
||||||
identifier: identifier,
|
identifier: identifier,
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
typeParameters: [],
|
typeParameters: [],
|
||||||
interfaces: [],
|
interfaces: [],
|
||||||
hasAbstract: false,
|
hasAbstract: false,
|
||||||
|
@ -331,6 +332,7 @@ void main() {
|
||||||
uri: Uri.parse('a.dart'),
|
uri: Uri.parse('a.dart'),
|
||||||
staticScope: null),
|
staticScope: null),
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
typeParameters: [],
|
typeParameters: [],
|
||||||
interfaces: [],
|
interfaces: [],
|
||||||
mixins: [],
|
mixins: [],
|
||||||
|
@ -344,6 +346,7 @@ void main() {
|
||||||
uri: Uri.parse('a.dart'),
|
uri: Uri.parse('a.dart'),
|
||||||
staticScope: null),
|
staticScope: null),
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
definingType: myEnum.identifier,
|
definingType: myEnum.identifier,
|
||||||
isExternal: false,
|
isExternal: false,
|
||||||
isFinal: true,
|
isFinal: true,
|
||||||
|
@ -395,6 +398,7 @@ void main() {
|
||||||
identifier:
|
identifier:
|
||||||
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'MyClass'),
|
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'MyClass'),
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
typeParameters: [],
|
typeParameters: [],
|
||||||
interfaces: [],
|
interfaces: [],
|
||||||
hasAbstract: hasKeywords,
|
hasAbstract: hasKeywords,
|
||||||
|
|
|
@ -161,11 +161,13 @@ void main() {
|
||||||
identifier:
|
identifier:
|
||||||
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'foo'),
|
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'foo'),
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
type: fooType);
|
type: fooType);
|
||||||
final fooNamedFunctionTypeParam = FunctionTypeParameterImpl(
|
final fooNamedFunctionTypeParam = FunctionTypeParameterImpl(
|
||||||
id: RemoteInstance.uniqueId,
|
id: RemoteInstance.uniqueId,
|
||||||
isNamed: true,
|
isNamed: true,
|
||||||
isRequired: true,
|
isRequired: true,
|
||||||
|
metadata: [],
|
||||||
name: 'foo',
|
name: 'foo',
|
||||||
type: fooType);
|
type: fooType);
|
||||||
|
|
||||||
|
@ -176,11 +178,13 @@ void main() {
|
||||||
identifier:
|
identifier:
|
||||||
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'bar'),
|
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'bar'),
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
type: barType);
|
type: barType);
|
||||||
final barPositionalFunctionTypeParam = FunctionTypeParameterImpl(
|
final barPositionalFunctionTypeParam = FunctionTypeParameterImpl(
|
||||||
id: RemoteInstance.uniqueId,
|
id: RemoteInstance.uniqueId,
|
||||||
isNamed: true,
|
isNamed: true,
|
||||||
isRequired: true,
|
isRequired: true,
|
||||||
|
metadata: [],
|
||||||
name: 'bar',
|
name: 'bar',
|
||||||
type: fooType);
|
type: fooType);
|
||||||
|
|
||||||
|
@ -188,6 +192,7 @@ void main() {
|
||||||
id: RemoteInstance.uniqueId,
|
id: RemoteInstance.uniqueId,
|
||||||
isNamed: true,
|
isNamed: true,
|
||||||
isRequired: true,
|
isRequired: true,
|
||||||
|
metadata: [],
|
||||||
name: null,
|
name: null,
|
||||||
type: fooType);
|
type: fooType);
|
||||||
|
|
||||||
|
@ -196,6 +201,7 @@ void main() {
|
||||||
identifier:
|
identifier:
|
||||||
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'Zap'),
|
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'Zap'),
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
bound: barType);
|
bound: barType);
|
||||||
|
|
||||||
// Transitively tests `TypeParameterDeclaration` and
|
// Transitively tests `TypeParameterDeclaration` and
|
||||||
|
@ -222,6 +228,7 @@ void main() {
|
||||||
identifier:
|
identifier:
|
||||||
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'name'),
|
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'name'),
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
isAbstract: true,
|
isAbstract: true,
|
||||||
isExternal: false,
|
isExternal: false,
|
||||||
isGetter: true,
|
isGetter: true,
|
||||||
|
@ -241,6 +248,7 @@ void main() {
|
||||||
identifier:
|
identifier:
|
||||||
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'zorp'),
|
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'zorp'),
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
isAbstract: false,
|
isAbstract: false,
|
||||||
isExternal: false,
|
isExternal: false,
|
||||||
isGetter: false,
|
isGetter: false,
|
||||||
|
@ -262,6 +270,7 @@ void main() {
|
||||||
identifier:
|
identifier:
|
||||||
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'new'),
|
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'new'),
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
isAbstract: false,
|
isAbstract: false,
|
||||||
isExternal: false,
|
isExternal: false,
|
||||||
isGetter: false,
|
isGetter: false,
|
||||||
|
@ -284,6 +293,7 @@ void main() {
|
||||||
identifier:
|
identifier:
|
||||||
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'bar'),
|
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'bar'),
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
isExternal: true,
|
isExternal: true,
|
||||||
isFinal: false,
|
isFinal: false,
|
||||||
isLate: true,
|
isLate: true,
|
||||||
|
@ -299,6 +309,7 @@ void main() {
|
||||||
identifier:
|
identifier:
|
||||||
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'bar'),
|
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'bar'),
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
isExternal: false,
|
isExternal: false,
|
||||||
isFinal: true,
|
isFinal: true,
|
||||||
isLate: false,
|
isLate: false,
|
||||||
|
@ -332,6 +343,7 @@ void main() {
|
||||||
identifier:
|
identifier:
|
||||||
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'Foo'),
|
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'Foo'),
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
interfaces: [barType],
|
interfaces: [barType],
|
||||||
hasAbstract: boolValue,
|
hasAbstract: boolValue,
|
||||||
hasBase: boolValue,
|
hasBase: boolValue,
|
||||||
|
@ -355,6 +367,7 @@ void main() {
|
||||||
identifier:
|
identifier:
|
||||||
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'MyEnum'),
|
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'MyEnum'),
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
interfaces: [barType],
|
interfaces: [barType],
|
||||||
mixins: [serializableType],
|
mixins: [serializableType],
|
||||||
typeParameters: [zapTypeParam],
|
typeParameters: [zapTypeParam],
|
||||||
|
@ -368,6 +381,7 @@ void main() {
|
||||||
id: RemoteInstance.uniqueId,
|
id: RemoteInstance.uniqueId,
|
||||||
identifier: IdentifierImpl(id: RemoteInstance.uniqueId, name: 'a'),
|
identifier: IdentifierImpl(id: RemoteInstance.uniqueId, name: 'a'),
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
definingEnum:
|
definingEnum:
|
||||||
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'MyEnum'),
|
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'MyEnum'),
|
||||||
);
|
);
|
||||||
|
@ -382,6 +396,7 @@ void main() {
|
||||||
identifier:
|
identifier:
|
||||||
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'MyMixin'),
|
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'MyMixin'),
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
hasBase: base,
|
hasBase: base,
|
||||||
interfaces: [barType],
|
interfaces: [barType],
|
||||||
superclassConstraints: [serializableType],
|
superclassConstraints: [serializableType],
|
||||||
|
@ -398,6 +413,7 @@ void main() {
|
||||||
identifier:
|
identifier:
|
||||||
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'FooOfBar'),
|
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'FooOfBar'),
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
typeParameters: [zapTypeParam],
|
typeParameters: [zapTypeParam],
|
||||||
aliasedType: NamedTypeAnnotationImpl(
|
aliasedType: NamedTypeAnnotationImpl(
|
||||||
id: RemoteInstance.uniqueId,
|
id: RemoteInstance.uniqueId,
|
||||||
|
@ -421,6 +437,7 @@ void main() {
|
||||||
identifier:
|
identifier:
|
||||||
IdentifierImpl(id: RemoteInstance.uniqueId, name: r'hello'),
|
IdentifierImpl(id: RemoteInstance.uniqueId, name: r'hello'),
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
name: 'hello',
|
name: 'hello',
|
||||||
type: barType,
|
type: barType,
|
||||||
),
|
),
|
||||||
|
@ -431,6 +448,7 @@ void main() {
|
||||||
identifier:
|
identifier:
|
||||||
IdentifierImpl(id: RemoteInstance.uniqueId, name: r'$1'),
|
IdentifierImpl(id: RemoteInstance.uniqueId, name: r'$1'),
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
name: null,
|
name: null,
|
||||||
type: fooType,
|
type: fooType,
|
||||||
),
|
),
|
||||||
|
@ -572,6 +590,34 @@ void main() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
group('metadata annotations can be serialized and deserialized', () {
|
||||||
|
for (var mode in [SerializationMode.byteData, SerializationMode.json]) {
|
||||||
|
group('with mode $mode', () {
|
||||||
|
test('identifiers', () {
|
||||||
|
final identifierMetadata = IdentifierMetadataAnnotationImpl(
|
||||||
|
id: RemoteInstance.uniqueId,
|
||||||
|
identifier: IdentifierImpl(
|
||||||
|
id: RemoteInstance.uniqueId, name: 'singleton'));
|
||||||
|
|
||||||
|
expectSerializationEquality<IdentifierMetadataAnnotationImpl>(
|
||||||
|
identifierMetadata, mode, RemoteInstance.deserialize);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('constructor invocations', () {
|
||||||
|
final constructorMetadata = ConstructorMetadataAnnotationImpl(
|
||||||
|
id: RemoteInstance.uniqueId,
|
||||||
|
type: IdentifierImpl(
|
||||||
|
id: RemoteInstance.uniqueId, name: 'Singleton'),
|
||||||
|
constructor: IdentifierImpl(
|
||||||
|
id: RemoteInstance.uniqueId, name: 'someName'));
|
||||||
|
|
||||||
|
expectSerializationEquality<ConstructorMetadataAnnotationImpl>(
|
||||||
|
constructorMetadata, mode, RemoteInstance.deserialize);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Serializes [serializable] in server mode, then deserializes it in client
|
/// Serializes [serializable] in server mode, then deserializes it in client
|
||||||
|
@ -600,6 +646,8 @@ void expectSerializationEquality<T extends Serializable>(T serializable,
|
||||||
TypeAnnotation() =>
|
TypeAnnotation() =>
|
||||||
deepEqualsTypeAnnotation(deserialized as TypeAnnotation),
|
deepEqualsTypeAnnotation(deserialized as TypeAnnotation),
|
||||||
Arguments() => deepEqualsArguments(deserialized),
|
Arguments() => deepEqualsArguments(deserialized),
|
||||||
|
MetadataAnnotation() =>
|
||||||
|
deepEqualsMetadataAnnotation(deserialized as MetadataAnnotation),
|
||||||
_ => throw new UnsupportedError(
|
_ => throw new UnsupportedError(
|
||||||
'Unsupported object type $deserialized'),
|
'Unsupported object type $deserialized'),
|
||||||
});
|
});
|
||||||
|
|
|
@ -196,6 +196,10 @@ Matcher deepEqualsTypeAnnotation(TypeAnnotation declaration) =>
|
||||||
Matcher deepEqualsArguments(Arguments arguments) =>
|
Matcher deepEqualsArguments(Arguments arguments) =>
|
||||||
_DeepEqualityMatcher(arguments);
|
_DeepEqualityMatcher(arguments);
|
||||||
|
|
||||||
|
/// Checks if two [MetadataAnnotation]s are identical
|
||||||
|
Matcher deepEqualsMetadataAnnotation(MetadataAnnotation metadata) =>
|
||||||
|
_DeepEqualityMatcher(metadata);
|
||||||
|
|
||||||
/// Checks if two [Declaration]s, [TypeAnnotation]s, or [Code] objects are of
|
/// Checks if two [Declaration]s, [TypeAnnotation]s, or [Code] objects are of
|
||||||
/// the same type and all their fields are equal.
|
/// the same type and all their fields are equal.
|
||||||
class _DeepEqualityMatcher extends Matcher {
|
class _DeepEqualityMatcher extends Matcher {
|
||||||
|
@ -213,7 +217,9 @@ class _DeepEqualityMatcher extends Matcher {
|
||||||
if (!equals(item.runtimeType).matches(instance.runtimeType, matchState)) {
|
if (!equals(item.runtimeType).matches(instance.runtimeType, matchState)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (instance is Declaration || instance is TypeAnnotation) {
|
if (instance is Declaration ||
|
||||||
|
instance is TypeAnnotation ||
|
||||||
|
instance is MetadataAnnotation) {
|
||||||
var instanceReflector = reflect(instance);
|
var instanceReflector = reflect(instance);
|
||||||
var itemReflector = reflect(item);
|
var itemReflector = reflect(item);
|
||||||
|
|
||||||
|
@ -285,6 +291,7 @@ class Fixtures {
|
||||||
static final library = LibraryImpl(
|
static final library = LibraryImpl(
|
||||||
id: RemoteInstance.uniqueId,
|
id: RemoteInstance.uniqueId,
|
||||||
languageVersion: LanguageVersionImpl(3, 0),
|
languageVersion: LanguageVersionImpl(3, 0),
|
||||||
|
metadata: [],
|
||||||
uri: Uri.parse('package:foo/bar.dart'));
|
uri: Uri.parse('package:foo/bar.dart'));
|
||||||
static final nullableBoolType = NamedTypeAnnotationImpl(
|
static final nullableBoolType = NamedTypeAnnotationImpl(
|
||||||
id: RemoteInstance.uniqueId,
|
id: RemoteInstance.uniqueId,
|
||||||
|
@ -311,6 +318,7 @@ class Fixtures {
|
||||||
identifier:
|
identifier:
|
||||||
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'world'),
|
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'world'),
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
name: 'world',
|
name: 'world',
|
||||||
type: stringType),
|
type: stringType),
|
||||||
],
|
],
|
||||||
|
@ -320,6 +328,7 @@ class Fixtures {
|
||||||
identifier:
|
identifier:
|
||||||
IdentifierImpl(id: RemoteInstance.uniqueId, name: r'$1'),
|
IdentifierImpl(id: RemoteInstance.uniqueId, name: r'$1'),
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
name: null,
|
name: null,
|
||||||
type: stringType),
|
type: stringType),
|
||||||
RecordFieldDeclarationImpl(
|
RecordFieldDeclarationImpl(
|
||||||
|
@ -327,6 +336,7 @@ class Fixtures {
|
||||||
identifier:
|
identifier:
|
||||||
IdentifierImpl(id: RemoteInstance.uniqueId, name: r'$2'),
|
IdentifierImpl(id: RemoteInstance.uniqueId, name: r'$2'),
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
name: 'hello',
|
name: 'hello',
|
||||||
type: nullableBoolType),
|
type: nullableBoolType),
|
||||||
]);
|
]);
|
||||||
|
@ -337,6 +347,7 @@ class Fixtures {
|
||||||
identifier:
|
identifier:
|
||||||
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'myFunction'),
|
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'myFunction'),
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
isAbstract: false,
|
isAbstract: false,
|
||||||
isExternal: false,
|
isExternal: false,
|
||||||
isGetter: false,
|
isGetter: false,
|
||||||
|
@ -351,6 +362,7 @@ class Fixtures {
|
||||||
identifier:
|
identifier:
|
||||||
IdentifierImpl(id: RemoteInstance.uniqueId, name: '_myVariable'),
|
IdentifierImpl(id: RemoteInstance.uniqueId, name: '_myVariable'),
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
isExternal: false,
|
isExternal: false,
|
||||||
isFinal: true,
|
isFinal: true,
|
||||||
isLate: false,
|
isLate: false,
|
||||||
|
@ -360,6 +372,7 @@ class Fixtures {
|
||||||
identifier:
|
identifier:
|
||||||
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'myVariable'),
|
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'myVariable'),
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
isAbstract: false,
|
isAbstract: false,
|
||||||
isExternal: false,
|
isExternal: false,
|
||||||
isGetter: true,
|
isGetter: true,
|
||||||
|
@ -374,6 +387,7 @@ class Fixtures {
|
||||||
identifier:
|
identifier:
|
||||||
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'myVariable'),
|
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'myVariable'),
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
isAbstract: false,
|
isAbstract: false,
|
||||||
isExternal: false,
|
isExternal: false,
|
||||||
isGetter: false,
|
isGetter: false,
|
||||||
|
@ -386,6 +400,7 @@ class Fixtures {
|
||||||
identifier:
|
identifier:
|
||||||
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'value'),
|
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'value'),
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
isNamed: false,
|
isNamed: false,
|
||||||
isRequired: true,
|
isRequired: true,
|
||||||
type: stringType)
|
type: stringType)
|
||||||
|
@ -397,6 +412,7 @@ class Fixtures {
|
||||||
id: RemoteInstance.uniqueId,
|
id: RemoteInstance.uniqueId,
|
||||||
identifier: IdentifierImpl(id: RemoteInstance.uniqueId, name: 'library'),
|
identifier: IdentifierImpl(id: RemoteInstance.uniqueId, name: 'library'),
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
isExternal: false,
|
isExternal: false,
|
||||||
isFinal: true,
|
isFinal: true,
|
||||||
isLate: false,
|
isLate: false,
|
||||||
|
@ -434,6 +450,7 @@ class Fixtures {
|
||||||
id: RemoteInstance.uniqueId,
|
id: RemoteInstance.uniqueId,
|
||||||
identifier: myClassType.identifier,
|
identifier: myClassType.identifier,
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
typeParameters: [],
|
typeParameters: [],
|
||||||
interfaces: [myInterfaceType],
|
interfaces: [myInterfaceType],
|
||||||
hasAbstract: false,
|
hasAbstract: false,
|
||||||
|
@ -450,6 +467,7 @@ class Fixtures {
|
||||||
identifier:
|
identifier:
|
||||||
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'myConstructor'),
|
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'myConstructor'),
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
isAbstract: false,
|
isAbstract: false,
|
||||||
isExternal: false,
|
isExternal: false,
|
||||||
isGetter: false,
|
isGetter: false,
|
||||||
|
@ -462,6 +480,7 @@ class Fixtures {
|
||||||
identifier:
|
identifier:
|
||||||
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'myField'),
|
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'myField'),
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
isNamed: false,
|
isNamed: false,
|
||||||
isRequired: true,
|
isRequired: true,
|
||||||
type: TestOmittedTypeAnnotation(myField.type))
|
type: TestOmittedTypeAnnotation(myField.type))
|
||||||
|
@ -474,6 +493,7 @@ class Fixtures {
|
||||||
id: RemoteInstance.uniqueId,
|
id: RemoteInstance.uniqueId,
|
||||||
identifier: IdentifierImpl(id: RemoteInstance.uniqueId, name: 'myField'),
|
identifier: IdentifierImpl(id: RemoteInstance.uniqueId, name: 'myField'),
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
isExternal: false,
|
isExternal: false,
|
||||||
isFinal: false,
|
isFinal: false,
|
||||||
isLate: false,
|
isLate: false,
|
||||||
|
@ -484,6 +504,7 @@ class Fixtures {
|
||||||
id: RemoteInstance.uniqueId,
|
id: RemoteInstance.uniqueId,
|
||||||
identifier: myInterfaceType.identifier,
|
identifier: myInterfaceType.identifier,
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
typeParameters: [],
|
typeParameters: [],
|
||||||
interfaces: [],
|
interfaces: [],
|
||||||
hasAbstract: false,
|
hasAbstract: false,
|
||||||
|
@ -499,6 +520,7 @@ class Fixtures {
|
||||||
id: RemoteInstance.uniqueId,
|
id: RemoteInstance.uniqueId,
|
||||||
identifier: IdentifierImpl(id: RemoteInstance.uniqueId, name: 'myMethod'),
|
identifier: IdentifierImpl(id: RemoteInstance.uniqueId, name: 'myMethod'),
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
isAbstract: false,
|
isAbstract: false,
|
||||||
isExternal: false,
|
isExternal: false,
|
||||||
isGetter: false,
|
isGetter: false,
|
||||||
|
@ -514,6 +536,7 @@ class Fixtures {
|
||||||
id: RemoteInstance.uniqueId,
|
id: RemoteInstance.uniqueId,
|
||||||
identifier: mySuperclassType.identifier,
|
identifier: mySuperclassType.identifier,
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
typeParameters: [],
|
typeParameters: [],
|
||||||
interfaces: [],
|
interfaces: [],
|
||||||
hasAbstract: false,
|
hasAbstract: false,
|
||||||
|
@ -538,6 +561,7 @@ class Fixtures {
|
||||||
id: RemoteInstance.uniqueId,
|
id: RemoteInstance.uniqueId,
|
||||||
identifier: myEnumType.identifier,
|
identifier: myEnumType.identifier,
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
typeParameters: [],
|
typeParameters: [],
|
||||||
interfaces: [],
|
interfaces: [],
|
||||||
mixins: []);
|
mixins: []);
|
||||||
|
@ -546,6 +570,7 @@ class Fixtures {
|
||||||
id: RemoteInstance.uniqueId,
|
id: RemoteInstance.uniqueId,
|
||||||
identifier: IdentifierImpl(id: RemoteInstance.uniqueId, name: 'a'),
|
identifier: IdentifierImpl(id: RemoteInstance.uniqueId, name: 'a'),
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
definingEnum: myEnum.identifier,
|
definingEnum: myEnum.identifier,
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
@ -554,6 +579,7 @@ class Fixtures {
|
||||||
identifier: IdentifierImpl(
|
identifier: IdentifierImpl(
|
||||||
id: RemoteInstance.uniqueId, name: 'myEnumConstructor'),
|
id: RemoteInstance.uniqueId, name: 'myEnumConstructor'),
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
isAbstract: false,
|
isAbstract: false,
|
||||||
isExternal: false,
|
isExternal: false,
|
||||||
isGetter: false,
|
isGetter: false,
|
||||||
|
@ -566,6 +592,7 @@ class Fixtures {
|
||||||
identifier:
|
identifier:
|
||||||
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'myField'),
|
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'myField'),
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
isNamed: false,
|
isNamed: false,
|
||||||
isRequired: true,
|
isRequired: true,
|
||||||
type: stringType)
|
type: stringType)
|
||||||
|
@ -579,6 +606,7 @@ class Fixtures {
|
||||||
id: RemoteInstance.uniqueId,
|
id: RemoteInstance.uniqueId,
|
||||||
identifier: myMixinType.identifier,
|
identifier: myMixinType.identifier,
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
typeParameters: [],
|
typeParameters: [],
|
||||||
hasBase: false,
|
hasBase: false,
|
||||||
interfaces: [],
|
interfaces: [],
|
||||||
|
@ -589,6 +617,7 @@ class Fixtures {
|
||||||
identifier:
|
identifier:
|
||||||
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'myMixinMethod'),
|
IdentifierImpl(id: RemoteInstance.uniqueId, name: 'myMixinMethod'),
|
||||||
library: Fixtures.library,
|
library: Fixtures.library,
|
||||||
|
metadata: [],
|
||||||
isAbstract: false,
|
isAbstract: false,
|
||||||
isExternal: false,
|
isExternal: false,
|
||||||
isGetter: false,
|
isGetter: false,
|
||||||
|
|
|
@ -19,6 +19,7 @@ class ClassDeclarationImpl extends macro.ClassDeclarationImpl {
|
||||||
required super.id,
|
required super.id,
|
||||||
required super.identifier,
|
required super.identifier,
|
||||||
required super.library,
|
required super.library,
|
||||||
|
required super.metadata,
|
||||||
required super.typeParameters,
|
required super.typeParameters,
|
||||||
required super.interfaces,
|
required super.interfaces,
|
||||||
required super.hasAbstract,
|
required super.hasAbstract,
|
||||||
|
@ -102,6 +103,8 @@ class DeclarationBuilderFromElement {
|
||||||
id: macro.RemoteInstance.uniqueId,
|
id: macro.RemoteInstance.uniqueId,
|
||||||
languageVersion:
|
languageVersion:
|
||||||
macro.LanguageVersionImpl(version.major, version.minor),
|
macro.LanguageVersionImpl(version.major, version.minor),
|
||||||
|
// TODO: Provide metadata annotations.
|
||||||
|
metadata: const [],
|
||||||
uri: element.library!.source.uri,
|
uri: element.library!.source.uri,
|
||||||
element: element);
|
element: element);
|
||||||
_libraryMap[element.library!] = library;
|
_libraryMap[element.library!] = library;
|
||||||
|
@ -143,6 +146,8 @@ class DeclarationBuilderFromElement {
|
||||||
id: macro.RemoteInstance.uniqueId,
|
id: macro.RemoteInstance.uniqueId,
|
||||||
identifier: identifier(element),
|
identifier: identifier(element),
|
||||||
library: library(element),
|
library: library(element),
|
||||||
|
// TODO: Provide metadata annotations.
|
||||||
|
metadata: const [],
|
||||||
isExternal: element.isExternal,
|
isExternal: element.isExternal,
|
||||||
isFinal: element.isFinal,
|
isFinal: element.isFinal,
|
||||||
isLate: element.isLate,
|
isLate: element.isLate,
|
||||||
|
@ -159,6 +164,8 @@ class DeclarationBuilderFromElement {
|
||||||
id: macro.RemoteInstance.uniqueId,
|
id: macro.RemoteInstance.uniqueId,
|
||||||
identifier: identifier(element),
|
identifier: identifier(element),
|
||||||
library: library(element),
|
library: library(element),
|
||||||
|
// TODO: Provide metadata annotations.
|
||||||
|
metadata: const [],
|
||||||
typeParameters: element.typeParameters.map(_typeParameter).toList(),
|
typeParameters: element.typeParameters.map(_typeParameter).toList(),
|
||||||
interfaces: element.interfaces
|
interfaces: element.interfaces
|
||||||
.map(_dartType)
|
.map(_dartType)
|
||||||
|
@ -187,6 +194,8 @@ class DeclarationBuilderFromElement {
|
||||||
id: macro.RemoteInstance.uniqueId,
|
id: macro.RemoteInstance.uniqueId,
|
||||||
identifier: identifier(element),
|
identifier: identifier(element),
|
||||||
library: library(element),
|
library: library(element),
|
||||||
|
// TODO: Provide metadata annotations.
|
||||||
|
metadata: const [],
|
||||||
bound: element.bound.mapOrNull(_dartType),
|
bound: element.bound.mapOrNull(_dartType),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -215,6 +224,8 @@ class DeclarationBuilderFromNode {
|
||||||
id: macro.RemoteInstance.uniqueId,
|
id: macro.RemoteInstance.uniqueId,
|
||||||
languageVersion:
|
languageVersion:
|
||||||
macro.LanguageVersionImpl(version.major, version.minor),
|
macro.LanguageVersionImpl(version.major, version.minor),
|
||||||
|
// TODO: Provide metadata annotations.
|
||||||
|
metadata: const [],
|
||||||
uri: element.library!.source.uri,
|
uri: element.library!.source.uri,
|
||||||
element: element);
|
element: element);
|
||||||
_libraryMap[element.library!] = library;
|
_libraryMap[element.library!] = library;
|
||||||
|
@ -249,6 +260,8 @@ class DeclarationBuilderFromNode {
|
||||||
isNamed: node.isNamed,
|
isNamed: node.isNamed,
|
||||||
isRequired: node.isRequired,
|
isRequired: node.isRequired,
|
||||||
name: node.name?.lexeme,
|
name: node.name?.lexeme,
|
||||||
|
// TODO: Provide metadata annotations.
|
||||||
|
metadata: const [],
|
||||||
type: typeAnnotation,
|
type: typeAnnotation,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -261,6 +274,8 @@ class DeclarationBuilderFromNode {
|
||||||
id: macro.RemoteInstance.uniqueId,
|
id: macro.RemoteInstance.uniqueId,
|
||||||
identifier: _declaredIdentifier(node.name, node.declaredElement!),
|
identifier: _declaredIdentifier(node.name, node.declaredElement!),
|
||||||
library: library(node.declaredElement!),
|
library: library(node.declaredElement!),
|
||||||
|
// TODO: Provide metadata annotations.
|
||||||
|
metadata: const [],
|
||||||
typeParameters: _typeParameters(node.typeParameters),
|
typeParameters: _typeParameters(node.typeParameters),
|
||||||
interfaces: _typeAnnotations(node.implementsClause?.interfaces),
|
interfaces: _typeAnnotations(node.implementsClause?.interfaces),
|
||||||
hasAbstract: node.abstractKeyword != null,
|
hasAbstract: node.abstractKeyword != null,
|
||||||
|
@ -336,6 +351,8 @@ class DeclarationBuilderFromNode {
|
||||||
id: macro.RemoteInstance.uniqueId,
|
id: macro.RemoteInstance.uniqueId,
|
||||||
identifier: _declaredIdentifier(node.name, node.declaredElement!),
|
identifier: _declaredIdentifier(node.name, node.declaredElement!),
|
||||||
library: library(node.declaredElement!),
|
library: library(node.declaredElement!),
|
||||||
|
// TODO: Provide metadata annotations.
|
||||||
|
metadata: const [],
|
||||||
bound: node.bound.mapOrNull(_typeAnnotation),
|
bound: node.bound.mapOrNull(_typeAnnotation),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -356,6 +373,7 @@ class FieldDeclarationImpl extends macro.FieldDeclarationImpl {
|
||||||
required super.id,
|
required super.id,
|
||||||
required super.identifier,
|
required super.identifier,
|
||||||
required super.library,
|
required super.library,
|
||||||
|
required super.metadata,
|
||||||
required super.isExternal,
|
required super.isExternal,
|
||||||
required super.isFinal,
|
required super.isFinal,
|
||||||
required super.isLate,
|
required super.isLate,
|
||||||
|
@ -393,6 +411,7 @@ class IntrospectableClassDeclarationImpl
|
||||||
required super.id,
|
required super.id,
|
||||||
required super.identifier,
|
required super.identifier,
|
||||||
required super.library,
|
required super.library,
|
||||||
|
required super.metadata,
|
||||||
required super.typeParameters,
|
required super.typeParameters,
|
||||||
required super.interfaces,
|
required super.interfaces,
|
||||||
required super.hasAbstract,
|
required super.hasAbstract,
|
||||||
|
@ -411,6 +430,7 @@ abstract class LibraryImpl extends macro.LibraryImpl {
|
||||||
LibraryImpl({
|
LibraryImpl({
|
||||||
required super.id,
|
required super.id,
|
||||||
required super.languageVersion,
|
required super.languageVersion,
|
||||||
|
required super.metadata,
|
||||||
required super.uri,
|
required super.uri,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -424,6 +444,7 @@ class LibraryImplFromElement extends LibraryImpl {
|
||||||
LibraryImplFromElement({
|
LibraryImplFromElement({
|
||||||
required super.id,
|
required super.id,
|
||||||
required super.languageVersion,
|
required super.languageVersion,
|
||||||
|
required super.metadata,
|
||||||
required super.uri,
|
required super.uri,
|
||||||
required this.element,
|
required this.element,
|
||||||
});
|
});
|
||||||
|
|
|
@ -803,7 +803,9 @@ class MacroApplications {
|
||||||
id: macro.RemoteInstance.uniqueId,
|
id: macro.RemoteInstance.uniqueId,
|
||||||
uri: builder.importUri,
|
uri: builder.importUri,
|
||||||
languageVersion:
|
languageVersion:
|
||||||
new macro.LanguageVersionImpl(version.major, version.minor));
|
new macro.LanguageVersionImpl(version.major, version.minor),
|
||||||
|
// TODO: Provide metadata annotations.
|
||||||
|
metadata: const []);
|
||||||
}();
|
}();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -849,6 +851,8 @@ class MacroApplications {
|
||||||
id: macro.RemoteInstance.uniqueId,
|
id: macro.RemoteInstance.uniqueId,
|
||||||
identifier: identifier,
|
identifier: identifier,
|
||||||
library: library,
|
library: library,
|
||||||
|
// TODO: Provide metadata annotations.
|
||||||
|
metadata: const [],
|
||||||
typeParameters: typeParameters,
|
typeParameters: typeParameters,
|
||||||
hasBase: builder.isBase,
|
hasBase: builder.isBase,
|
||||||
interfaces: interfaces,
|
interfaces: interfaces,
|
||||||
|
@ -861,6 +865,8 @@ class MacroApplications {
|
||||||
id: macro.RemoteInstance.uniqueId,
|
id: macro.RemoteInstance.uniqueId,
|
||||||
identifier: identifier,
|
identifier: identifier,
|
||||||
library: library,
|
library: library,
|
||||||
|
// TODO: Provide metadata annotations.
|
||||||
|
metadata: const [],
|
||||||
typeParameters: typeParameters,
|
typeParameters: typeParameters,
|
||||||
interfaces: interfaces,
|
interfaces: interfaces,
|
||||||
hasAbstract: builder.isAbstract,
|
hasAbstract: builder.isAbstract,
|
||||||
|
@ -891,6 +897,8 @@ class MacroApplications {
|
||||||
id: macro.RemoteInstance.uniqueId,
|
id: macro.RemoteInstance.uniqueId,
|
||||||
name: builder.name),
|
name: builder.name),
|
||||||
library: library,
|
library: library,
|
||||||
|
// TODO: Provide metadata annotations.
|
||||||
|
metadata: const [],
|
||||||
// TODO(johnniwinther): Support typeParameters
|
// TODO(johnniwinther): Support typeParameters
|
||||||
typeParameters: [],
|
typeParameters: [],
|
||||||
aliasedType:
|
aliasedType:
|
||||||
|
@ -921,6 +929,8 @@ class MacroApplications {
|
||||||
id: macro.RemoteInstance.uniqueId,
|
id: macro.RemoteInstance.uniqueId,
|
||||||
identifier: identifier,
|
identifier: identifier,
|
||||||
library: library,
|
library: library,
|
||||||
|
// TODO: Provide metadata annotations.
|
||||||
|
metadata: const [],
|
||||||
isRequired: formal.isRequiredNamed,
|
isRequired: formal.isRequiredNamed,
|
||||||
isNamed: true,
|
isNamed: true,
|
||||||
type: type,
|
type: type,
|
||||||
|
@ -930,6 +940,8 @@ class MacroApplications {
|
||||||
id: macro.RemoteInstance.uniqueId,
|
id: macro.RemoteInstance.uniqueId,
|
||||||
identifier: identifier,
|
identifier: identifier,
|
||||||
library: library,
|
library: library,
|
||||||
|
// TODO: Provide metadata annotations.
|
||||||
|
metadata: const [],
|
||||||
isRequired: formal.isRequiredPositional,
|
isRequired: formal.isRequiredPositional,
|
||||||
isNamed: false,
|
isNamed: false,
|
||||||
type: type,
|
type: type,
|
||||||
|
@ -958,6 +970,8 @@ class MacroApplications {
|
||||||
id: macro.RemoteInstance.uniqueId,
|
id: macro.RemoteInstance.uniqueId,
|
||||||
name: builder.name),
|
name: builder.name),
|
||||||
library: _libraryFor(builder.libraryBuilder),
|
library: _libraryFor(builder.libraryBuilder),
|
||||||
|
// TODO: Provide metadata annotations.
|
||||||
|
metadata: const [],
|
||||||
definingType: definingClass.identifier as macro.IdentifierImpl,
|
definingType: definingClass.identifier as macro.IdentifierImpl,
|
||||||
isFactory: builder.isFactory,
|
isFactory: builder.isFactory,
|
||||||
isAbstract: builder.isAbstract,
|
isAbstract: builder.isAbstract,
|
||||||
|
@ -988,6 +1002,8 @@ class MacroApplications {
|
||||||
id: macro.RemoteInstance.uniqueId,
|
id: macro.RemoteInstance.uniqueId,
|
||||||
name: builder.name),
|
name: builder.name),
|
||||||
library: _libraryFor(builder.libraryBuilder),
|
library: _libraryFor(builder.libraryBuilder),
|
||||||
|
// TODO: Provide metadata annotations.
|
||||||
|
metadata: const [],
|
||||||
definingType: definingClass.identifier as macro.IdentifierImpl,
|
definingType: definingClass.identifier as macro.IdentifierImpl,
|
||||||
isFactory: builder.isFactory,
|
isFactory: builder.isFactory,
|
||||||
isAbstract: builder.isAbstract,
|
isAbstract: builder.isAbstract,
|
||||||
|
@ -1025,6 +1041,8 @@ class MacroApplications {
|
||||||
id: macro.RemoteInstance.uniqueId,
|
id: macro.RemoteInstance.uniqueId,
|
||||||
name: builder.name),
|
name: builder.name),
|
||||||
library: library,
|
library: library,
|
||||||
|
// TODO: Provide metadata annotations.
|
||||||
|
metadata: const [],
|
||||||
definingType: definingClass.identifier as macro.IdentifierImpl,
|
definingType: definingClass.identifier as macro.IdentifierImpl,
|
||||||
isAbstract: builder.isAbstract,
|
isAbstract: builder.isAbstract,
|
||||||
isExternal: builder.isExternal,
|
isExternal: builder.isExternal,
|
||||||
|
@ -1046,6 +1064,8 @@ class MacroApplications {
|
||||||
id: macro.RemoteInstance.uniqueId,
|
id: macro.RemoteInstance.uniqueId,
|
||||||
name: builder.name),
|
name: builder.name),
|
||||||
library: library,
|
library: library,
|
||||||
|
// TODO: Provide metadata annotations.
|
||||||
|
metadata: const [],
|
||||||
isAbstract: builder.isAbstract,
|
isAbstract: builder.isAbstract,
|
||||||
isExternal: builder.isExternal,
|
isExternal: builder.isExternal,
|
||||||
isGetter: builder.isGetter,
|
isGetter: builder.isGetter,
|
||||||
|
@ -1078,6 +1098,8 @@ class MacroApplications {
|
||||||
id: macro.RemoteInstance.uniqueId,
|
id: macro.RemoteInstance.uniqueId,
|
||||||
name: builder.name),
|
name: builder.name),
|
||||||
library: library,
|
library: library,
|
||||||
|
// TODO: Provide metadata annotations.
|
||||||
|
metadata: const [],
|
||||||
definingType: definingClass.identifier as macro.IdentifierImpl,
|
definingType: definingClass.identifier as macro.IdentifierImpl,
|
||||||
isExternal: builder.isExternal,
|
isExternal: builder.isExternal,
|
||||||
isFinal: builder.isFinal,
|
isFinal: builder.isFinal,
|
||||||
|
@ -1092,6 +1114,8 @@ class MacroApplications {
|
||||||
id: macro.RemoteInstance.uniqueId,
|
id: macro.RemoteInstance.uniqueId,
|
||||||
name: builder.name),
|
name: builder.name),
|
||||||
library: library,
|
library: library,
|
||||||
|
// TODO: Provide metadata annotations.
|
||||||
|
metadata: const [],
|
||||||
isExternal: builder.isExternal,
|
isExternal: builder.isExternal,
|
||||||
isFinal: builder.isFinal,
|
isFinal: builder.isFinal,
|
||||||
isLate: builder.isLate,
|
isLate: builder.isLate,
|
||||||
|
|
Loading…
Reference in a new issue