| 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 18 matching lines...) Expand all Loading... |
| 29 } | 29 } |
| 30 } | 30 } |
| 31 | 31 |
| 32 /** | 32 /** |
| 33 * Schedules sending notifications for the given [file] using the resolved | 33 * Schedules sending notifications for the given [file] using the resolved |
| 34 * [resolvedDartUnit]. | 34 * [resolvedDartUnit]. |
| 35 */ | 35 */ |
| 36 void scheduleNotificationOperations(AnalysisServer server, String file, | 36 void scheduleNotificationOperations(AnalysisServer server, String file, |
| 37 LineInfo lineInfo, AnalysisContext context, CompilationUnit parsedDartUnit, | 37 LineInfo lineInfo, AnalysisContext context, CompilationUnit parsedDartUnit, |
| 38 CompilationUnit resolvedDartUnit, List<AnalysisError> errors) { | 38 CompilationUnit resolvedDartUnit, List<AnalysisError> errors) { |
| 39 // If the file belongs to any analysis root, check whether we're in it now. |
| 40 AnalysisContext containingContext = server.getContainingContext(file); |
| 41 if (containingContext != null && context != containingContext) { |
| 42 return; |
| 43 } |
| 39 // Dart | 44 // Dart |
| 40 CompilationUnit dartUnit = | 45 CompilationUnit dartUnit = |
| 41 resolvedDartUnit != null ? resolvedDartUnit : parsedDartUnit; | 46 resolvedDartUnit != null ? resolvedDartUnit : parsedDartUnit; |
| 42 if (resolvedDartUnit != null) { | 47 if (resolvedDartUnit != null) { |
| 43 if (server.hasAnalysisSubscription( | 48 if (server.hasAnalysisSubscription( |
| 44 protocol.AnalysisService.HIGHLIGHTS, file)) { | 49 protocol.AnalysisService.HIGHLIGHTS, file)) { |
| 45 server.scheduleOperation( | 50 server.scheduleOperation( |
| 46 new _DartHighlightsOperation(context, file, resolvedDartUnit)); | 51 new _DartHighlightsOperation(context, file, resolvedDartUnit)); |
| 47 } | 52 } |
| 48 if (server.hasAnalysisSubscription( | 53 if (server.hasAnalysisSubscription( |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 abstract class _SingleFileOperation extends SourceSensitiveOperation { | 409 abstract class _SingleFileOperation extends SourceSensitiveOperation { |
| 405 final String file; | 410 final String file; |
| 406 | 411 |
| 407 _SingleFileOperation(AnalysisContext context, this.file) : super(context); | 412 _SingleFileOperation(AnalysisContext context, this.file) : super(context); |
| 408 | 413 |
| 409 @override | 414 @override |
| 410 bool shouldBeDiscardedOnSourceChange(Source source) { | 415 bool shouldBeDiscardedOnSourceChange(Source source) { |
| 411 return source.fullName == file; | 416 return source.fullName == file; |
| 412 } | 417 } |
| 413 } | 418 } |
| OLD | NEW |