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

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

Issue 1764553002: Make SearchMatch usable for the new index - remove the element field. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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
Index: pkg/analysis_server/lib/src/services/search/search_engine_internal.dart
diff --git a/pkg/analysis_server/lib/src/services/search/search_engine_internal.dart b/pkg/analysis_server/lib/src/services/search/search_engine_internal.dart
index 12681f7c2a13f753ad6c94fd6817fbf8ed61d71f..957574672c1df4ed447a3c733420ed8a2f7de0af 100644
--- a/pkg/analysis_server/lib/src/services/search/search_engine_internal.dart
+++ b/pkg/analysis_server/lib/src/services/search/search_engine_internal.dart
@@ -119,8 +119,14 @@ class SearchEngineImpl implements SearchEngine {
_index.getTopLevelDeclarations((String name) => regExp.hasMatch(name));
List<SearchMatch> matches = <SearchMatch>[];
for (Element element in elements) {
- matches.add(new SearchMatch(MatchKind.DECLARATION, element,
- rangeElementName(element), true, false));
+ matches.add(new SearchMatch(
+ element.context,
+ element.library.source.uri.toString(),
+ element.source.uri.toString(),
+ MatchKind.DECLARATION,
+ rangeElementName(element),
+ true,
+ false));
}
return new Future.value(matches);
}
@@ -230,9 +236,12 @@ class _Requestor {
for (LocationImpl location in locations) {
IndexableObject indexable = location.indexable;
if (indexable is IndexableElement) {
+ Element element = indexable.element;
matches.add(new SearchMatch(
+ element.context,
+ element.library.source.uri.toString(),
+ element.source.uri.toString(),
kind,
- indexable.element,
new SourceRange(location.offset, location.length),
location.isResolved,
location.isQualified));

Powered by Google App Engine
This is Rietveld 408576698