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

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

Issue 1783503004: Listen for context add/remove and unit invalidation to update the index. (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
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 2bb0d3361356562eb8b869bdcb15b4ccdc9d58cd..81cac320144ab161fd22bbe0724ba03f8a639ff7 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
@@ -22,10 +22,9 @@ import 'package:analyzer/src/summary/idl.dart';
* A [SearchEngine] implementation.
*/
class SearchEngineImpl2 implements SearchEngine {
- final AnalysisContext context;
final Index2 _index;
- SearchEngineImpl2(this.context, this._index);
+ SearchEngineImpl2(this._index);
@override
Future<List<SearchMatch>> searchAllSubtypes(ClassElement type) async {
@@ -111,7 +110,7 @@ class SearchEngineImpl2 implements SearchEngine {
SearchMatch _newMatchForLocation(Location location, MatchKind kind) =>
new SearchMatch(
- context,
+ location.context,
location.libraryUri,
location.unitUri,
kind,
@@ -176,6 +175,7 @@ class SearchEngineImpl2 implements SearchEngine {
List<SearchMatch> matches = <SearchMatch>[];
LibraryElement libraryElement = element.library;
Source librarySource = libraryElement.source;
+ AnalysisContext context = libraryElement.context;
for (CompilationUnitElement unitElement in libraryElement.units) {
Source unitSource = unitElement.source;
CompilationUnit unit =
@@ -193,6 +193,7 @@ class SearchEngineImpl2 implements SearchEngine {
List<SearchMatch> matches = <SearchMatch>[];
LibraryElement libraryElement = element.library;
Source librarySource = libraryElement.source;
+ AnalysisContext context = libraryElement.context;
for (CompilationUnitElement unitElement in libraryElement.parts) {
Source unitSource = unitElement.source;
CompilationUnit unit =
@@ -237,6 +238,7 @@ class SearchEngineImpl2 implements SearchEngine {
List<SearchMatch> matches = <SearchMatch>[];
LibraryElement libraryElement = element.library;
Source librarySource = libraryElement.source;
+ AnalysisContext context = libraryElement.context;
for (CompilationUnitElement unitElement in libraryElement.units) {
Source unitSource = unitElement.source;
CompilationUnit unit =
« no previous file with comments | « pkg/analysis_server/lib/src/services/index2/index2.dart ('k') | pkg/analysis_server/lib/src/status/get_handler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698