Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(479)

Side by Side Diff: pkg/analyzer/lib/src/dart/element/element.dart

Issue 2529473002: Implement search for other local elements. (Closed)
Patch Set: Add tests for function/method type parameters. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.src.dart.element.element; 5 library analyzer.src.dart.element.element;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import 'dart:math' show min; 8 import 'dart:math' show min;
9 9
10 import 'package:analyzer/dart/ast/ast.dart'; 10 import 'package:analyzer/dart/ast/ast.dart';
(...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after
1044 } 1044 }
1045 } 1045 }
1046 return true; 1046 return true;
1047 } 1047 }
1048 1048
1049 @override 1049 @override
1050 void visitChildren(ElementVisitor visitor) { 1050 void visitChildren(ElementVisitor visitor) {
1051 super.visitChildren(visitor); 1051 super.visitChildren(visitor);
1052 safelyVisitChildren(_constructors, visitor); 1052 safelyVisitChildren(_constructors, visitor);
1053 safelyVisitChildren(methods, visitor); 1053 safelyVisitChildren(methods, visitor);
1054 safelyVisitChildren(_typeParameters, visitor); 1054 safelyVisitChildren(typeParameters, visitor);
1055 } 1055 }
1056 1056
1057 void _collectAllSupertypes(List<InterfaceType> supertypes) { 1057 void _collectAllSupertypes(List<InterfaceType> supertypes) {
1058 List<InterfaceType> typesToVisit = new List<InterfaceType>(); 1058 List<InterfaceType> typesToVisit = new List<InterfaceType>();
1059 List<ClassElement> visitedClasses = new List<ClassElement>(); 1059 List<ClassElement> visitedClasses = new List<ClassElement>();
1060 typesToVisit.add(this.type); 1060 typesToVisit.add(this.type);
1061 while (!typesToVisit.isEmpty) { 1061 while (!typesToVisit.isEmpty) {
1062 InterfaceType currentType = typesToVisit.removeAt(0); 1062 InterfaceType currentType = typesToVisit.removeAt(0);
1063 ClassElement currentElement = currentType.element; 1063 ClassElement currentElement = currentType.element;
1064 if (!visitedClasses.contains(currentElement)) { 1064 if (!visitedClasses.contains(currentElement)) {
(...skipping 7422 matching lines...) Expand 10 before | Expand all | Expand 10 after
8487 8487
8488 @override 8488 @override
8489 void visitElement(Element element) { 8489 void visitElement(Element element) {
8490 int offset = element.nameOffset; 8490 int offset = element.nameOffset;
8491 if (offset != -1) { 8491 if (offset != -1) {
8492 map[offset] = element; 8492 map[offset] = element;
8493 } 8493 }
8494 super.visitElement(element); 8494 super.visitElement(element);
8495 } 8495 }
8496 } 8496 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/dart/analysis/search.dart ('k') | pkg/analyzer/test/src/dart/analysis/search_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698