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

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

Issue 314493002: Navigation computer and two variants of tests for it. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add navigation subscription. Created 6 years, 7 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 | « pkg/analysis_server/lib/src/computers.dart ('k') | pkg/analysis_server/test/analysis_abstract_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/operation/operation_analysis.dart
diff --git a/pkg/analysis_server/lib/src/operation/operation_analysis.dart b/pkg/analysis_server/lib/src/operation/operation_analysis.dart
index ceac59de6167675b5e4a24c2f712df5ee646b64e..ed8cfd87d6879e58606c2799f4b7ae5c48b5e53a 100644
--- a/pkg/analysis_server/lib/src/operation/operation_analysis.dart
+++ b/pkg/analysis_server/lib/src/operation/operation_analysis.dart
@@ -72,6 +72,9 @@ class PerformAnalysisOperation extends ServerOperation {
if (server.hasAnalysisSubscription(AnalysisService.HIGHLIGHTS, file)) {
sendAnalysisNotificationHighlights(server, file, dartUnit);
}
+ if (server.hasAnalysisSubscription(AnalysisService.NAVIGATION, file)) {
+ sendAnalysisNotificationNavigation(server, file, dartUnit);
+ }
}
if (!source.isInSystemLibrary) {
sendAnalysisNotificationErrors(server, file, notice.errors);
@@ -98,6 +101,16 @@ void sendAnalysisNotificationHighlights(AnalysisServer server,
server.sendNotification(notification);
}
+void sendAnalysisNotificationNavigation(AnalysisServer server,
+ String file, CompilationUnit dartUnit) {
+ Notification notification = new Notification(NOTIFICATION_NAVIGATION);
+ notification.setParameter(FILE, file);
+ notification.setParameter(
+ REGIONS,
+ new DartUnitNavigationComputer(dartUnit).compute());
+ server.sendNotification(notification);
+}
+
Map<String, Object> errorToJson(AnalysisError analysisError) {
// TODO(paulberry): move this function into the AnalysisError class.
ErrorCode errorCode = analysisError.errorCode;
« no previous file with comments | « pkg/analysis_server/lib/src/computers.dart ('k') | pkg/analysis_server/test/analysis_abstract_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698