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

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

Issue 1343283004: Support for NAVIGATION/OCCURRENCES notifications for any source (such as HTML). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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/analyzer/lib/src/task/html_work_manager.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/analysis_server.dart
diff --git a/pkg/analysis_server/lib/src/analysis_server.dart b/pkg/analysis_server/lib/src/analysis_server.dart
index 1df76adad19b27289368025d692518f916ab2581..c8108b88b6089f19a6bc3b9ce164a978db7b5686 100644
--- a/pkg/analysis_server/lib/src/analysis_server.dart
+++ b/pkg/analysis_server/lib/src/analysis_server.dart
@@ -951,9 +951,23 @@ class AnalysisServer {
if (context == null) {
continue;
}
+ Source source = contextSource.source;
+ // Ensure that if the AST is flushed / not ready, it will be
+ // computed eventually.
+ if (AnalysisEngine.isDartFileName(file)) {
+ (context as InternalAnalysisContext).ensureResolvedDartUnits(source);
+ }
+ // Send notifications that don't directly take an AST.
+ switch (service) {
+ case AnalysisService.NAVIGATION:
+ sendAnalysisNotificationNavigation(this, context, source);
+ continue;
+ case AnalysisService.OCCURRENCES:
+ sendAnalysisNotificationOccurrences(this, context, source);
+ continue;
+ }
// Dart unit notifications.
if (AnalysisEngine.isDartFileName(file)) {
- Source source = contextSource.source;
// TODO(scheglov) This way to get resolved information is very Dart
// specific. OTOH as it is planned now Angular results are not
// flushable.
@@ -964,12 +978,6 @@ class AnalysisServer {
case AnalysisService.HIGHLIGHTS:
sendAnalysisNotificationHighlights(this, file, dartUnit);
break;
- case AnalysisService.NAVIGATION:
- sendAnalysisNotificationNavigation(this, context, source);
- break;
- case AnalysisService.OCCURRENCES:
- sendAnalysisNotificationOccurrences(this, context, source);
- break;
case AnalysisService.OUTLINE:
AnalysisContext context = dartUnit.element.context;
LineInfo lineInfo = context.getLineInfo(source);
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/task/html_work_manager.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698