| 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 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 return ServerOperationPriority.ANALYSIS_INDEX; | 452 return ServerOperationPriority.ANALYSIS_INDEX; |
| 453 } | 453 } |
| 454 | 454 |
| 455 @override | 455 @override |
| 456 void perform(AnalysisServer server) { | 456 void perform(AnalysisServer server) { |
| 457 ServerPerformanceStatistics.indexOperation.makeCurrentWhile(() { | 457 ServerPerformanceStatistics.indexOperation.makeCurrentWhile(() { |
| 458 try { | 458 try { |
| 459 Index index = server.index; | 459 Index index = server.index; |
| 460 AnalysisContext context = unit.element.context; | 460 AnalysisContext context = unit.element.context; |
| 461 index.index(context, unit); | 461 index.index(context, unit); |
| 462 server.index2?.indexUnit(unit); |
| 462 } catch (exception, stackTrace) { | 463 } catch (exception, stackTrace) { |
| 463 server.sendServerErrorNotification( | 464 server.sendServerErrorNotification( |
| 464 'Failed to index: $file', exception, stackTrace); | 465 'Failed to index: $file', exception, stackTrace); |
| 465 } | 466 } |
| 466 }); | 467 }); |
| 467 } | 468 } |
| 468 } | 469 } |
| 469 | 470 |
| 470 abstract class _DartNotificationOperation extends _SingleFileOperation { | 471 abstract class _DartNotificationOperation extends _SingleFileOperation { |
| 471 final CompilationUnit unit; | 472 final CompilationUnit unit; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 abstract class _SingleFileOperation extends SourceSensitiveOperation { | 543 abstract class _SingleFileOperation extends SourceSensitiveOperation { |
| 543 final String file; | 544 final String file; |
| 544 | 545 |
| 545 _SingleFileOperation(AnalysisContext context, this.file) : super(context); | 546 _SingleFileOperation(AnalysisContext context, this.file) : super(context); |
| 546 | 547 |
| 547 @override | 548 @override |
| 548 bool shouldBeDiscardedOnSourceChange(Source source) { | 549 bool shouldBeDiscardedOnSourceChange(Source source) { |
| 549 return source.fullName == file; | 550 return source.fullName == file; |
| 550 } | 551 } |
| 551 } | 552 } |
| OLD | NEW |