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

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

Issue 703963002: Use Element's source paths instead of URIs as a key in the index. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | Annotate | Revision Log
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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 /** 58 /**
59 * Returns a [Set] with direct subclasses of [seed]. 59 * Returns a [Set] with direct subclasses of [seed].
60 */ 60 */
61 Future<Set<ClassElement>> getDirectSubClasses(SearchEngine searchEngine, 61 Future<Set<ClassElement>> getDirectSubClasses(SearchEngine searchEngine,
62 ClassElement seed) { 62 ClassElement seed) {
63 return searchEngine.searchSubtypes(seed).then((List<SearchMatch> matches) { 63 return searchEngine.searchSubtypes(seed).then((List<SearchMatch> matches) {
64 Set<ClassElement> subClasses = new HashSet<ClassElement>(); 64 Set<ClassElement> subClasses = new HashSet<ClassElement>();
65 for (SearchMatch match in matches) { 65 for (SearchMatch match in matches) {
66 ClassElement subClass = match.element; 66 ClassElement subClass = match.element;
67 if (subClass.context == seed.context) { 67 subClasses.add(subClass);
68 subClasses.add(subClass);
69 }
70 } 68 }
71 return subClasses; 69 return subClasses;
72 }); 70 });
73 } 71 }
74 72
75 73
76 /** 74 /**
77 * @return all implementations of the given {@link ClassMemberElement} is its su perclasses and 75 * @return all implementations of the given {@link ClassMemberElement} is its su perclasses and
78 * their subclasses. 76 * their subclasses.
79 */ 77 */
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 * its variable, otherwise returns [element]. 200 * its variable, otherwise returns [element].
203 */ 201 */
204 Element getSyntheticAccessorVariable(Element element) { 202 Element getSyntheticAccessorVariable(Element element) {
205 if (element is PropertyAccessorElement) { 203 if (element is PropertyAccessorElement) {
206 if (element.isSynthetic) { 204 if (element.isSynthetic) {
207 return element.variable; 205 return element.variable;
208 } 206 }
209 } 207 }
210 return element; 208 return element;
211 } 209 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698