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

Unified Diff: pkg/analysis_server/lib/src/domain_completion.dart

Issue 787553002: invoke computeCache when priority sources change (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 6 years 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/domain_completion.dart
diff --git a/pkg/analysis_server/lib/src/domain_completion.dart b/pkg/analysis_server/lib/src/domain_completion.dart
index a3ea628c4f48ee9cd4b807cfe9bf36b49290b313..dc6cc9e183466acda31b8841250ecaf50a6a4fdd 100644
--- a/pkg/analysis_server/lib/src/domain_completion.dart
+++ b/pkg/analysis_server/lib/src/domain_completion.dart
@@ -53,6 +53,7 @@ class CompletionDomainHandler implements RequestHandler {
*/
CompletionDomainHandler(this.server) {
server.onContextsChanged.listen(contextsChanged);
+ server.onPriorityChange.listen(priorityChanged);
}
/**
@@ -114,6 +115,22 @@ class CompletionDomainHandler implements RequestHandler {
}
/**
+ * If the set the priority files has changed, then pre-cache completion
+ * information related to the first priority file.
+ */
+ void priorityChanged(PriorityChangeEvent event) {
+ Source source = event.firstSource;
+ if (source == null) {
+ return;
+ }
+ AnalysisContext context = server.getAnalysisContextForSource(source);
+ if (context == null) {
+ return;
+ }
+ completionManagerFor(context, source).computeCache();
+ }
+
+ /**
* Process a `completion.getSuggestions` request.
*/
Response processRequest(Request request) {

Powered by Google App Engine
This is Rietveld 408576698