| 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_highlights2.dart'; | 9 import 'package:analysis_server/src/computer/computer_highlights2.dart'; |
| 10 import 'package:analysis_server/src/computer/computer_outline.dart'; | 10 import 'package:analysis_server/src/computer/computer_outline.dart'; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 */ | 28 */ |
| 29 runWithActiveContext(AnalysisContext context, f()) { | 29 runWithActiveContext(AnalysisContext context, f()) { |
| 30 if (context is InternalAnalysisContext && !context.isActive) { | 30 if (context is InternalAnalysisContext && !context.isActive) { |
| 31 context.isActive = true; | 31 context.isActive = true; |
| 32 try { | 32 try { |
| 33 return f(); | 33 return f(); |
| 34 } finally { | 34 } finally { |
| 35 context.isActive = false; | 35 context.isActive = false; |
| 36 } | 36 } |
| 37 } else { | 37 } else { |
| 38 f(); | 38 return f(); |
| 39 } | 39 } |
| 40 } | 40 } |
| 41 | 41 |
| 42 scheduleImplementedNotification( | 42 scheduleImplementedNotification( |
| 43 AnalysisServer server, Iterable<String> files) async { | 43 AnalysisServer server, Iterable<String> files) async { |
| 44 SearchEngine searchEngine = server.searchEngine; | 44 SearchEngine searchEngine = server.searchEngine; |
| 45 if (searchEngine == null) { | 45 if (searchEngine == null) { |
| 46 return; | 46 return; |
| 47 } | 47 } |
| 48 for (String file in files) { | 48 for (String file in files) { |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 abstract class _SingleFileOperation extends SourceSensitiveOperation { | 536 abstract class _SingleFileOperation extends SourceSensitiveOperation { |
| 537 final String file; | 537 final String file; |
| 538 | 538 |
| 539 _SingleFileOperation(AnalysisContext context, this.file) : super(context); | 539 _SingleFileOperation(AnalysisContext context, this.file) : super(context); |
| 540 | 540 |
| 541 @override | 541 @override |
| 542 bool shouldBeDiscardedOnSourceChange(Source source) { | 542 bool shouldBeDiscardedOnSourceChange(Source source) { |
| 543 return source.fullName == file; | 543 return source.fullName == file; |
| 544 } | 544 } |
| 545 } | 545 } |
| OLD | NEW |