@@ -109,13 +109,9 @@ class ElementResolver {
109109
110110 TypeProviderImpl get _typeProvider => _resolver.typeProvider;
111111
112- void visitClassDeclaration (ClassDeclaration node) {
113- _resolveAnnotations (node.metadata);
114- }
112+ void visitClassDeclaration (ClassDeclaration node) {}
115113
116- void visitClassTypeAlias (ClassTypeAlias node) {
117- _resolveAnnotations (node.metadata);
118- }
114+ void visitClassTypeAlias (ClassTypeAlias node) {}
119115
120116 void visitCommentReference (CommentReference node) {
121117 _commentReferenceResolver.resolve (node);
@@ -137,7 +133,6 @@ class ElementResolver {
137133 }
138134 }
139135 }
140- _resolveAnnotations (node.metadata);
141136 }
142137
143138 void visitConstructorName (covariant ConstructorNameImpl node) {
@@ -161,9 +156,7 @@ class ElementResolver {
161156 }
162157 }
163158
164- void visitDeclaredIdentifier (DeclaredIdentifier node) {
165- _resolveAnnotations (node.metadata);
166- }
159+ void visitDeclaredIdentifier (DeclaredIdentifier node) {}
167160
168161 void visitDotShorthandConstructorInvocation (
169162 covariant DotShorthandConstructorInvocationImpl node,
@@ -197,13 +190,9 @@ class ElementResolver {
197190 );
198191 }
199192
200- void visitEnumConstantDeclaration (EnumConstantDeclaration node) {
201- _resolveAnnotations (node.metadata);
202- }
193+ void visitEnumConstantDeclaration (EnumConstantDeclaration node) {}
203194
204- void visitEnumDeclaration (EnumDeclaration node) {
205- _resolveAnnotations (node.metadata);
206- }
195+ void visitEnumDeclaration (EnumDeclaration node) {}
207196
208197 void visitExportDirective (ExportDirectiveImpl node) {
209198 var exportElement = node.libraryExport;
@@ -212,41 +201,24 @@ class ElementResolver {
212201 // TODO(brianwilkerson): Figure out whether the element can ever be
213202 // something other than an ExportElement
214203 _resolveCombinators (exportElement.exportedLibrary, node.combinators);
215- _resolveAnnotations (node.metadata);
216204 }
217205 }
218206
219- void visitExtensionDeclaration (ExtensionDeclaration node) {
220- _resolveAnnotations (node.metadata);
221- }
207+ void visitExtensionDeclaration (ExtensionDeclaration node) {}
222208
223- void visitExtensionTypeDeclaration (ExtensionTypeDeclaration node) {
224- _resolveAnnotations (node.metadata);
225- }
209+ void visitExtensionTypeDeclaration (ExtensionTypeDeclaration node) {}
226210
227- void visitFieldDeclaration (FieldDeclaration node) {
228- _resolveAnnotations (node.metadata);
229- }
211+ void visitFieldDeclaration (FieldDeclaration node) {}
230212
231- void visitFieldFormalParameter (FieldFormalParameter node) {
232- _resolveMetadataForParameter (node);
233- }
213+ void visitFieldFormalParameter (FieldFormalParameter node) {}
234214
235- void visitFunctionDeclaration (FunctionDeclaration node) {
236- _resolveAnnotations (node.metadata);
237- }
215+ void visitFunctionDeclaration (FunctionDeclaration node) {}
238216
239- void visitFunctionTypeAlias (FunctionTypeAlias node) {
240- _resolveAnnotations (node.metadata);
241- }
217+ void visitFunctionTypeAlias (FunctionTypeAlias node) {}
242218
243- void visitFunctionTypedFormalParameter (FunctionTypedFormalParameter node) {
244- _resolveMetadataForParameter (node);
245- }
219+ void visitFunctionTypedFormalParameter (FunctionTypedFormalParameter node) {}
246220
247- void visitGenericTypeAlias (GenericTypeAlias node) {
248- _resolveAnnotations (node.metadata);
249- }
221+ void visitGenericTypeAlias (GenericTypeAlias node) {}
250222
251223 void visitImportDirective (covariant ImportDirectiveImpl node) {
252224 var prefixNode = node.prefix;
@@ -269,7 +241,6 @@ class ElementResolver {
269241 if (library != null ) {
270242 _resolveCombinators (library, node.combinators);
271243 }
272- _resolveAnnotations (node.metadata);
273244 }
274245 }
275246
@@ -287,13 +258,9 @@ class ElementResolver {
287258 }
288259 }
289260
290- void visitLibraryDirective (LibraryDirective node) {
291- _resolveAnnotations (node.metadata);
292- }
261+ void visitLibraryDirective (LibraryDirective node) {}
293262
294- void visitMethodDeclaration (MethodDeclaration node) {
295- _resolveAnnotations (node.metadata);
296- }
263+ void visitMethodDeclaration (MethodDeclaration node) {}
297264
298265 /// Resolves the method invocation, [node] .
299266 ///
@@ -312,29 +279,19 @@ class ElementResolver {
312279 );
313280 }
314281
315- void visitMixinDeclaration (MixinDeclaration node) {
316- _resolveAnnotations (node.metadata);
317- }
282+ void visitMixinDeclaration (MixinDeclaration node) {}
318283
319- void visitPartDirective (PartDirective node) {
320- _resolveAnnotations (node.metadata);
321- }
284+ void visitPartDirective (PartDirective node) {}
322285
323- void visitPartOfDirective (PartOfDirective node) {
324- _resolveAnnotations (node.metadata);
325- }
286+ void visitPartOfDirective (PartOfDirective node) {}
326287
327288 void visitRecordTypeAnnotationNamedField (
328289 RecordTypeAnnotationNamedField node,
329- ) {
330- _resolveAnnotations (node.metadata);
331- }
290+ ) {}
332291
333292 void visitRecordTypeAnnotationPositionalField (
334293 RecordTypeAnnotationPositionalField node,
335- ) {
336- _resolveAnnotations (node.metadata);
337- }
294+ ) {}
338295
339296 void visitRedirectingConstructorInvocation (
340297 covariant RedirectingConstructorInvocationImpl node,
@@ -367,13 +324,9 @@ class ElementResolver {
367324 }
368325 }
369326
370- void visitRepresentationDeclaration (RepresentationDeclaration node) {
371- _resolveAnnotations (node.fieldMetadata);
372- }
327+ void visitRepresentationDeclaration (RepresentationDeclaration node) {}
373328
374- void visitSimpleFormalParameter (SimpleFormalParameter node) {
375- _resolveMetadataForParameter (node);
376- }
329+ void visitSimpleFormalParameter (SimpleFormalParameter node) {}
377330
378331 void visitSuperConstructorInvocation (
379332 covariant SuperConstructorInvocationImpl node,
@@ -466,17 +419,11 @@ class ElementResolver {
466419 }
467420 }
468421
469- void visitTopLevelVariableDeclaration (TopLevelVariableDeclaration node) {
470- _resolveAnnotations (node.metadata);
471- }
422+ void visitTopLevelVariableDeclaration (TopLevelVariableDeclaration node) {}
472423
473- void visitTypeParameter (TypeParameter node) {
474- _resolveAnnotations (node.metadata);
475- }
424+ void visitTypeParameter (TypeParameter node) {}
476425
477- void visitVariableDeclarationList (VariableDeclarationList node) {
478- _resolveAnnotations (node.metadata);
479- }
426+ void visitVariableDeclarationList (VariableDeclarationList node) {}
480427
481428 /// Given an [argumentList] and the [executableElement] that will be invoked
482429 /// using those argument, compute the list of parameters that correspond to
@@ -538,21 +485,4 @@ class ElementResolver {
538485 }
539486 }
540487 }
541-
542- /// Given a [node] that can have annotations associated with it, resolve the
543- /// annotations in the element model representing annotations to the node.
544- void _resolveMetadataForParameter (NormalFormalParameter node) {
545- _resolveAnnotations (node.metadata);
546- }
547-
548- /// Resolve each of the annotations in the given list of [annotations] .
549- static void _resolveAnnotations (NodeList <Annotation > annotations) {
550- for (Annotation annotation in annotations) {
551- var elementAnnotation =
552- annotation.elementAnnotation as ElementAnnotationImpl ? ;
553- if (elementAnnotation != null ) {
554- elementAnnotation.element = annotation.element;
555- }
556- }
557- }
558488}
0 commit comments