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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 : super(context, file); | 319 : super(context, file); |
320 | 320 |
321 @override | 321 @override |
322 ServerOperationPriority get priority { | 322 ServerOperationPriority get priority { |
323 return ServerOperationPriority.ANALYSIS_INDEX; | 323 return ServerOperationPriority.ANALYSIS_INDEX; |
324 } | 324 } |
325 | 325 |
326 @override | 326 @override |
327 void perform(AnalysisServer server) { | 327 void perform(AnalysisServer server) { |
328 ServerPerformanceStatistics.indexOperation.makeCurrentWhile(() { | 328 ServerPerformanceStatistics.indexOperation.makeCurrentWhile(() { |
329 Index index = server.index; | 329 try { |
330 index.indexUnit(context, unit); | 330 Index index = server.index; |
| 331 index.indexUnit(context, unit); |
| 332 } catch (exception, stackTrace) { |
| 333 server.sendServerErrorNotification(exception, stackTrace); |
| 334 } |
331 }); | 335 }); |
332 } | 336 } |
333 } | 337 } |
334 | 338 |
335 class _DartNavigationOperation extends _DartNotificationOperation { | 339 class _DartNavigationOperation extends _DartNotificationOperation { |
336 _DartNavigationOperation( | 340 _DartNavigationOperation( |
337 AnalysisContext context, String file, CompilationUnit unit) | 341 AnalysisContext context, String file, CompilationUnit unit) |
338 : super(context, file, unit); | 342 : super(context, file, unit); |
339 | 343 |
340 @override | 344 @override |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 abstract class _SingleFileOperation extends SourceSensitiveOperation { | 434 abstract class _SingleFileOperation extends SourceSensitiveOperation { |
431 final String file; | 435 final String file; |
432 | 436 |
433 _SingleFileOperation(AnalysisContext context, this.file) : super(context); | 437 _SingleFileOperation(AnalysisContext context, this.file) : super(context); |
434 | 438 |
435 @override | 439 @override |
436 bool shouldBeDiscardedOnSourceChange(Source source) { | 440 bool shouldBeDiscardedOnSourceChange(Source source) { |
437 return source.fullName == file; | 441 return source.fullName == file; |
438 } | 442 } |
439 } | 443 } |
OLD | NEW |