OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |