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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 @override | 404 @override |
405 ServerOperationPriority get priority { | 405 ServerOperationPriority get priority { |
406 return ServerOperationPriority.ANALYSIS_INDEX; | 406 return ServerOperationPriority.ANALYSIS_INDEX; |
407 } | 407 } |
408 | 408 |
409 @override | 409 @override |
410 void perform(AnalysisServer server) { | 410 void perform(AnalysisServer server) { |
411 ServerPerformanceStatistics.indexOperation.makeCurrentWhile(() { | 411 ServerPerformanceStatistics.indexOperation.makeCurrentWhile(() { |
412 try { | 412 try { |
413 Index index = server.index; | 413 Index index = server.index; |
414 index.indexUnit(context, unit); | 414 index.index(context, unit); |
415 } catch (exception, stackTrace) { | 415 } catch (exception, stackTrace) { |
416 server.sendServerErrorNotification(exception, stackTrace); | 416 server.sendServerErrorNotification(exception, stackTrace); |
417 } | 417 } |
418 }); | 418 }); |
419 } | 419 } |
420 } | 420 } |
421 | 421 |
422 abstract class _DartNotificationOperation extends _SingleFileOperation { | 422 abstract class _DartNotificationOperation extends _SingleFileOperation { |
423 final CompilationUnit unit; | 423 final CompilationUnit unit; |
424 | 424 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 : super(context, file); | 462 : super(context, file); |
463 | 463 |
464 @override | 464 @override |
465 ServerOperationPriority get priority { | 465 ServerOperationPriority get priority { |
466 return ServerOperationPriority.ANALYSIS_INDEX; | 466 return ServerOperationPriority.ANALYSIS_INDEX; |
467 } | 467 } |
468 | 468 |
469 @override | 469 @override |
470 void perform(AnalysisServer server) { | 470 void perform(AnalysisServer server) { |
471 Index index = server.index; | 471 Index index = server.index; |
472 index.indexHtmlUnit(context, unit); | 472 index.index(context, unit); |
473 } | 473 } |
474 } | 474 } |
475 | 475 |
476 class _NotificationErrorsOperation extends _SingleFileOperation { | 476 class _NotificationErrorsOperation extends _SingleFileOperation { |
477 final LineInfo lineInfo; | 477 final LineInfo lineInfo; |
478 final List<AnalysisError> errors; | 478 final List<AnalysisError> errors; |
479 | 479 |
480 _NotificationErrorsOperation( | 480 _NotificationErrorsOperation( |
481 AnalysisContext context, String file, this.lineInfo, this.errors) | 481 AnalysisContext context, String file, this.lineInfo, this.errors) |
482 : super(context, file); | 482 : super(context, file); |
(...skipping 28 matching lines...) Expand all Loading... |
511 abstract class _SingleFileOperation extends SourceSensitiveOperation { | 511 abstract class _SingleFileOperation extends SourceSensitiveOperation { |
512 final String file; | 512 final String file; |
513 | 513 |
514 _SingleFileOperation(AnalysisContext context, this.file) : super(context); | 514 _SingleFileOperation(AnalysisContext context, this.file) : super(context); |
515 | 515 |
516 @override | 516 @override |
517 bool shouldBeDiscardedOnSourceChange(Source source) { | 517 bool shouldBeDiscardedOnSourceChange(Source source) { |
518 return source.fullName == file; | 518 return source.fullName == file; |
519 } | 519 } |
520 } | 520 } |
OLD | NEW |