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

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

Issue 2962023002: Add SearchEngine.membersOfSubtypes(). (Closed)
Patch Set: Created 3 years, 5 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/lib/src/services/search/search_engine_internal.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 import 'dart:async'; 5 import 'dart:async';
6 6
7 import 'package:analyzer/dart/element/element.dart'; 7 import 'package:analyzer/dart/element/element.dart';
8 import 'package:analyzer/src/generated/source.dart'; 8 import 'package:analyzer/src/generated/source.dart';
9 9
10 /** 10 /**
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 @override 49 @override
50 String toString() => name; 50 String toString() => name;
51 } 51 }
52 52
53 /** 53 /**
54 * The interface [SearchEngine] defines the behavior of objects that can be used 54 * The interface [SearchEngine] defines the behavior of objects that can be used
55 * to search for various pieces of information. 55 * to search for various pieces of information.
56 */ 56 */
57 abstract class SearchEngine { 57 abstract class SearchEngine {
58 /** 58 /**
59 * If the [type] has subtypes, return the set of names of members which these
60 * subtypes declare, possibly empty. If the [type] does not have subtypes,
61 * return `null`.
62 */
63 Future<Set<String>> membersOfSubtypes(ClassElement type);
64
65 /**
59 * Returns all subtypes of the given [type]. 66 * Returns all subtypes of the given [type].
60 * 67 *
61 * [type] - the [ClassElement] being subtyped by the found matches. 68 * [type] - the [ClassElement] being subtyped by the found matches.
62 */ 69 */
63 Future<Set<ClassElement>> searchAllSubtypes(ClassElement type); 70 Future<Set<ClassElement>> searchAllSubtypes(ClassElement type);
64 71
65 /** 72 /**
66 * Returns declarations of class members with the given name. 73 * Returns declarations of class members with the given name.
67 * 74 *
68 * [name] - the name being declared by the found matches. 75 * [name] - the name being declared by the found matches.
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 /** 162 /**
156 * Return elements of [matches] which has not-null elements. 163 * Return elements of [matches] which has not-null elements.
157 * 164 *
158 * When [SearchMatch.element] is not `null` we cache its value, so it cannot 165 * When [SearchMatch.element] is not `null` we cache its value, so it cannot
159 * become `null` later. 166 * become `null` later.
160 */ 167 */
161 static List<SearchMatch> withNotNullElement(List<SearchMatch> matches) { 168 static List<SearchMatch> withNotNullElement(List<SearchMatch> matches) {
162 return matches.where((match) => match.element != null).toList(); 169 return matches.where((match) => match.element != null).toList();
163 } 170 }
164 } 171 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/search/search_engine_internal.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698