| 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) {
|
|
|