OLD | NEW |
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 } |
OLD | NEW |