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

Side by Side Diff: pkg/analysis_server/lib/src/computer/new_notifications.dart

Issue 2566223002: Implement 'analysis.occurrences' for the new analysis driver. (Closed)
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'package:analysis_server/plugin/protocol/protocol.dart' as protocol; 5 import 'package:analysis_server/plugin/protocol/protocol.dart' as protocol;
6 import 'package:analysis_server/src/analysis_server.dart' show AnalysisServer; 6 import 'package:analysis_server/src/analysis_server.dart' show AnalysisServer;
7 import 'package:analysis_server/src/domains/analysis/navigation.dart'; 7 import 'package:analysis_server/src/domains/analysis/navigation.dart';
8 import 'package:analysis_server/src/domains/analysis/navigation_dart.dart'; 8 import 'package:analysis_server/src/domains/analysis/navigation_dart.dart';
9 import 'package:analysis_server/src/domains/analysis/occurrences.dart';
10 import 'package:analysis_server/src/domains/analysis/occurrences_dart.dart';
9 import 'package:analysis_server/src/protocol_server.dart' as protocol; 11 import 'package:analysis_server/src/protocol_server.dart' as protocol;
10 import 'package:analyzer/error/error.dart'; 12 import 'package:analyzer/error/error.dart';
11 import 'package:analyzer/src/dart/analysis/driver.dart'; 13 import 'package:analyzer/src/dart/analysis/driver.dart';
12 14
13 void new_sendDartNotificationNavigation( 15 void new_sendDartNotificationNavigation(
14 AnalysisServer analysisServer, AnalysisResult result) { 16 AnalysisServer analysisServer, AnalysisResult result) {
15 var unit = result.unit; 17 var unit = result.unit;
16 if (unit != null) { 18 if (unit != null) {
17 NavigationCollectorImpl collector = new NavigationCollectorImpl(); 19 NavigationCollectorImpl collector = new NavigationCollectorImpl();
18 computeSimpleDartNavigation(collector, unit); 20 computeSimpleDartNavigation(collector, unit);
19 collector.createRegions(); 21 collector.createRegions();
20 var params = new protocol.AnalysisNavigationParams( 22 var params = new protocol.AnalysisNavigationParams(
21 result.path, collector.regions, collector.targets, collector.files); 23 result.path, collector.regions, collector.targets, collector.files);
22 analysisServer.sendNotification(params.toNotification()); 24 analysisServer.sendNotification(params.toNotification());
23 } 25 }
24 } 26 }
25 27
28 void new_sendDartNotificationOccurrences(
29 AnalysisServer analysisServer, AnalysisResult result) {
30 var unit = result.unit;
31 if (unit != null) {
32 OccurrencesCollectorImpl collector = new OccurrencesCollectorImpl();
33 addDartOccurrences(collector, unit);
34 var params = new protocol.AnalysisOccurrencesParams(
35 result.path, collector.allOccurrences);
36 analysisServer.sendNotification(params.toNotification());
37 }
38 }
39
26 void new_sendErrorNotification( 40 void new_sendErrorNotification(
27 AnalysisServer analysisServer, AnalysisResult result) { 41 AnalysisServer analysisServer, AnalysisResult result) {
28 var serverErrors = <protocol.AnalysisError>[]; 42 var serverErrors = <protocol.AnalysisError>[];
29 for (AnalysisError error in result.errors) { 43 for (AnalysisError error in result.errors) {
30 serverErrors 44 serverErrors
31 .add(protocol.newAnalysisError_fromEngine(result.lineInfo, error)); 45 .add(protocol.newAnalysisError_fromEngine(result.lineInfo, error));
32 } 46 }
33 var params = new protocol.AnalysisErrorsParams(result.path, serverErrors); 47 var params = new protocol.AnalysisErrorsParams(result.path, serverErrors);
34 analysisServer.sendNotification(params.toNotification()); 48 analysisServer.sendNotification(params.toNotification());
35 } 49 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/analysis_server.dart ('k') | pkg/analysis_server/lib/src/domains/analysis/occurrences_dart.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698