| 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 library operation.analysis; | 5 library operation.analysis; |
| 6 | 6 |
| 7 import 'package:analysis_server/src/analysis_server.dart'; | 7 import 'package:analysis_server/src/analysis_server.dart'; |
| 8 import 'package:analysis_server/src/computer/computer_highlights.dart'; | 8 import 'package:analysis_server/src/computer/computer_highlights.dart'; |
| 9 import 'package:analysis_server/src/computer/computer_navigation.dart'; | 9 import 'package:analysis_server/src/computer/computer_navigation.dart'; |
| 10 import 'package:analysis_server/src/computer/computer_occurrences.dart'; | 10 import 'package:analysis_server/src/computer/computer_occurrences.dart'; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 if (errors == null) { | 81 if (errors == null) { |
| 82 errors = <AnalysisError>[]; | 82 errors = <AnalysisError>[]; |
| 83 } | 83 } |
| 84 var serverErrors = | 84 var serverErrors = |
| 85 protocol.doAnalysisError_listFromEngine(lineInfo, errors); | 85 protocol.doAnalysisError_listFromEngine(lineInfo, errors); |
| 86 var params = new protocol.AnalysisErrorsParams(file, serverErrors); | 86 var params = new protocol.AnalysisErrorsParams(file, serverErrors); |
| 87 server.sendNotification(params.toNotification()); | 87 server.sendNotification(params.toNotification()); |
| 88 }); | 88 }); |
| 89 } | 89 } |
| 90 | 90 |
| 91 void sendAnalysisNotificationFlushResults( |
| 92 AnalysisServer server, List<String> files) { |
| 93 _sendNotification(server, () { |
| 94 if (files != null && files.isNotEmpty) { |
| 95 var params = new protocol.AnalysisFlushResultsParams(files); |
| 96 server.sendNotification(params.toNotification()); |
| 97 } |
| 98 }); |
| 99 } |
| 100 |
| 91 void sendAnalysisNotificationHighlights( | 101 void sendAnalysisNotificationHighlights( |
| 92 AnalysisServer server, String file, CompilationUnit dartUnit) { | 102 AnalysisServer server, String file, CompilationUnit dartUnit) { |
| 93 _sendNotification(server, () { | 103 _sendNotification(server, () { |
| 94 var regions = new DartUnitHighlightsComputer(dartUnit).compute(); | 104 var regions = new DartUnitHighlightsComputer(dartUnit).compute(); |
| 95 var params = new protocol.AnalysisHighlightsParams(file, regions); | 105 var params = new protocol.AnalysisHighlightsParams(file, regions); |
| 96 server.sendNotification(params.toNotification()); | 106 server.sendNotification(params.toNotification()); |
| 97 }); | 107 }); |
| 98 } | 108 } |
| 99 | 109 |
| 100 void sendAnalysisNotificationNavigation( | 110 void sendAnalysisNotificationNavigation( |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 abstract class _SingleFileOperation extends SourceSensitiveOperation { | 404 abstract class _SingleFileOperation extends SourceSensitiveOperation { |
| 395 final String file; | 405 final String file; |
| 396 | 406 |
| 397 _SingleFileOperation(AnalysisContext context, this.file) : super(context); | 407 _SingleFileOperation(AnalysisContext context, this.file) : super(context); |
| 398 | 408 |
| 399 @override | 409 @override |
| 400 bool shouldBeDiscardedOnSourceChange(Source source) { | 410 bool shouldBeDiscardedOnSourceChange(Source source) { |
| 401 return source.fullName == file; | 411 return source.fullName == file; |
| 402 } | 412 } |
| 403 } | 413 } |
| OLD | NEW |