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'; |
| 8 import 'package:analysis_server/src/domains/analysis/navigation_dart.dart'; |
7 import 'package:analysis_server/src/protocol_server.dart' as protocol; | 9 import 'package:analysis_server/src/protocol_server.dart' as protocol; |
8 import 'package:analyzer/error/error.dart'; | 10 import 'package:analyzer/error/error.dart'; |
9 import 'package:analyzer/src/dart/analysis/driver.dart'; | 11 import 'package:analyzer/src/dart/analysis/driver.dart'; |
10 | 12 |
| 13 void new_sendDartNotificationNavigation( |
| 14 AnalysisServer analysisServer, AnalysisResult result) { |
| 15 var unit = result.unit; |
| 16 if (unit != null) { |
| 17 NavigationCollectorImpl collector = new NavigationCollectorImpl(); |
| 18 computeSimpleDartNavigation(collector, unit); |
| 19 collector.createRegions(); |
| 20 var params = new protocol.AnalysisNavigationParams( |
| 21 result.path, collector.regions, collector.targets, collector.files); |
| 22 analysisServer.sendNotification(params.toNotification()); |
| 23 } |
| 24 } |
| 25 |
11 void new_sendErrorNotification( | 26 void new_sendErrorNotification( |
12 AnalysisServer analysisServer, AnalysisResult result) { | 27 AnalysisServer analysisServer, AnalysisResult result) { |
13 var serverErrors = <protocol.AnalysisError>[]; | 28 var serverErrors = <protocol.AnalysisError>[]; |
14 for (AnalysisError error in result.errors) { | 29 for (AnalysisError error in result.errors) { |
15 serverErrors | 30 serverErrors |
16 .add(protocol.newAnalysisError_fromEngine(result.lineInfo, error)); | 31 .add(protocol.newAnalysisError_fromEngine(result.lineInfo, error)); |
17 } | 32 } |
18 var params = new protocol.AnalysisErrorsParams(result.path, serverErrors); | 33 var params = new protocol.AnalysisErrorsParams(result.path, serverErrors); |
19 analysisServer.sendNotification(params.toNotification()); | 34 analysisServer.sendNotification(params.toNotification()); |
20 } | 35 } |
OLD | NEW |