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

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

Issue 2564913002: Implement SearchEngine.searchAllSubtypes() with the analysis driver. (Closed)
Patch Set: Created 4 years 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 services.search_engine; 5 library services.search_engine;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analyzer/dart/element/element.dart'; 9 import 'package:analyzer/dart/element/element.dart';
10 import 'package:analyzer/src/generated/source.dart'; 10 import 'package:analyzer/src/generated/source.dart';
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 /** 55 /**
56 * The interface [SearchEngine] defines the behavior of objects that can be used 56 * The interface [SearchEngine] defines the behavior of objects that can be used
57 * to search for various pieces of information. 57 * to search for various pieces of information.
58 */ 58 */
59 abstract class SearchEngine { 59 abstract class SearchEngine {
60 /** 60 /**
61 * Returns all subtypes of the given [type]. 61 * Returns all subtypes of the given [type].
62 * 62 *
63 * [type] - the [ClassElement] being subtyped by the found matches. 63 * [type] - the [ClassElement] being subtyped by the found matches.
64 */ 64 */
65 Future<List<SearchMatch>> searchAllSubtypes(ClassElement type); 65 Future<Set<ClassElement>> searchAllSubtypes(ClassElement type);
66 66
67 /** 67 /**
68 * Returns declarations of class members with the given name. 68 * Returns declarations of class members with the given name.
69 * 69 *
70 * [name] - the name being declared by the found matches. 70 * [name] - the name being declared by the found matches.
71 */ 71 */
72 Future<List<SearchMatch>> searchMemberDeclarations(String name); 72 Future<List<SearchMatch>> searchMemberDeclarations(String name);
73 73
74 /** 74 /**
75 * Returns all resolved and unresolved qualified references to the class 75 * Returns all resolved and unresolved qualified references to the class
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 /** 157 /**
158 * Return elements of [matches] which has not-null elements. 158 * Return elements of [matches] which has not-null elements.
159 * 159 *
160 * When [SearchMatch.element] is not `null` we cache its value, so it cannot 160 * When [SearchMatch.element] is not `null` we cache its value, so it cannot
161 * become `null` later. 161 * become `null` later.
162 */ 162 */
163 static List<SearchMatch> withNotNullElement(List<SearchMatch> matches) { 163 static List<SearchMatch> withNotNullElement(List<SearchMatch> matches) {
164 return matches.where((match) => match.element != null).toList(); 164 return matches.where((match) => match.element != null).toList();
165 } 165 }
166 } 166 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698