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

Unified Diff: pkg/analysis_server/lib/src/services/search/search_engine_internal2.dart

Issue 1770083002: Search for direct and indirect subclasses. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/search/search_engine2_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/services/search/search_engine_internal2.dart
diff --git a/pkg/analysis_server/lib/src/services/search/search_engine_internal2.dart b/pkg/analysis_server/lib/src/services/search/search_engine_internal2.dart
index 9ae8a0a68f1198fdbe090b4c59e00ae751f46c26..4b179bcd7f32fcc4790af36c5f6b2bc4dc4a3d87 100644
--- a/pkg/analysis_server/lib/src/services/search/search_engine_internal2.dart
+++ b/pkg/analysis_server/lib/src/services/search/search_engine_internal2.dart
@@ -28,9 +28,11 @@ class SearchEngineImpl2 implements SearchEngine {
SearchEngineImpl2(this.context, this._index);
@override
- Future<List<SearchMatch>> searchAllSubtypes(ClassElement type) {
- // TODO: implement searchAllSubtypes
- throw new UnimplementedError();
+ Future<List<SearchMatch>> searchAllSubtypes(ClassElement type) async {
+ List<SearchMatch> matches = <SearchMatch>[];
+ await _addMatches(
+ matches, type, IndexRelationKind.IS_ANCESTOR_OF, MatchKind.DECLARATION);
+ return matches;
}
@override
@@ -81,9 +83,15 @@ class SearchEngineImpl2 implements SearchEngine {
}
@override
- Future<List<SearchMatch>> searchSubtypes(ClassElement type) {
- // TODO: implement searchSubtypes
- throw new UnimplementedError();
+ Future<List<SearchMatch>> searchSubtypes(ClassElement type) async {
+ List<SearchMatch> matches = <SearchMatch>[];
+ await _addMatches(
+ matches, type, IndexRelationKind.IS_EXTENDED_BY, MatchKind.REFERENCE);
+ await _addMatches(
+ matches, type, IndexRelationKind.IS_MIXED_IN_BY, MatchKind.REFERENCE);
+ await _addMatches(matches, type, IndexRelationKind.IS_IMPLEMENTED_BY,
+ MatchKind.REFERENCE);
+ return matches;
}
@override
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/search/search_engine2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698