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

Side by Side Diff: pkg/analysis_server/lib/src/services/search/hierarchy.dart

Issue 2176173004: Issue 26926. Don't search hierarchy for static class members. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 months 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
« no previous file with comments | « no previous file | pkg/analysis_server/test/search/element_references_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 services.hierarchy; 5 library services.hierarchy;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:analysis_server/src/services/search/element_visitors.dart'; 10 import 'package:analysis_server/src/services/search/element_visitors.dart';
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 }); 69 });
70 } 70 }
71 71
72 /** 72 /**
73 * @return all implementations of the given {@link ClassMemberElement} is its su perclasses and 73 * @return all implementations of the given {@link ClassMemberElement} is its su perclasses and
74 * their subclasses. 74 * their subclasses.
75 */ 75 */
76 Future<Set<ClassMemberElement>> getHierarchyMembers( 76 Future<Set<ClassMemberElement>> getHierarchyMembers(
77 SearchEngine searchEngine, ClassMemberElement member) { 77 SearchEngine searchEngine, ClassMemberElement member) {
78 Set<ClassMemberElement> result = new HashSet<ClassMemberElement>(); 78 Set<ClassMemberElement> result = new HashSet<ClassMemberElement>();
79 // constructor 79 // static elements
80 if (member is ConstructorElement) { 80 if (member.isStatic || member is ConstructorElement) {
81 result.add(member); 81 result.add(member);
82 return new Future.value(result); 82 return new Future.value(result);
83 } 83 }
84 // method, field, etc 84 // method, field, etc
85 String name = member.displayName; 85 String name = member.displayName;
86 ClassElement memberClass = member.enclosingElement; 86 ClassElement memberClass = member.enclosingElement;
87 List<Future> futures = <Future>[]; 87 List<Future> futures = <Future>[];
88 Set<ClassElement> searchClasses = getSuperClasses(memberClass); 88 Set<ClassElement> searchClasses = getSuperClasses(memberClass);
89 searchClasses.add(memberClass); 89 searchClasses.add(memberClass);
90 for (ClassElement superClass in searchClasses) { 90 for (ClassElement superClass in searchClasses) {
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 * its variable, otherwise returns [element]. 181 * its variable, otherwise returns [element].
182 */ 182 */
183 Element getSyntheticAccessorVariable(Element element) { 183 Element getSyntheticAccessorVariable(Element element) {
184 if (element is PropertyAccessorElement) { 184 if (element is PropertyAccessorElement) {
185 if (element.isSynthetic) { 185 if (element.isSynthetic) {
186 return element.variable; 186 return element.variable;
187 } 187 }
188 } 188 }
189 return element; 189 return element;
190 } 190 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/test/search/element_references_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698