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

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

Issue 1044463004: Gracefully degrade if no source for completion (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Gracefully degrade if no source for completion Created 5 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/lib/src/protocol.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 affe17c46e87a27371072af69648e3c5025594a1..676b0f54e1a67927e2775b0357714cb23580f2ad 100644
--- a/pkg/analysis_server/lib/src/domain_completion.dart
+++ b/pkg/analysis_server/lib/src/domain_completion.dart
@@ -177,6 +177,9 @@ class CompletionDomainHandler implements RequestHandler {
ContextSourcePair contextSource = server.getContextSourcePair(params.file);
AnalysisContext context = contextSource.context;
Source source = contextSource.source;
+ if (!context.exists(source)) {
scheglov 2015/03/30 21:10:48 Actually it is not guaranteed that AnalysisContext
danrubel 2015/03/30 21:40:48 Good catch. Fixed.
+ return new Response.unknownSource(request);
+ }
recordRequest(performance, context, source, params.offset);
if (manager == null) {
manager = completionManagerFor(context, source);
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/protocol.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698