| 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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 // sendStatusNotification(context.toString(), taskDescription); | 365 // sendStatusNotification(context.toString(), taskDescription); |
| 366 // }); | 366 // }); |
| 367 if (!isContinue) { | 367 if (!isContinue) { |
| 368 setCacheSize(context, WORKING_CACHE_SIZE); | 368 setCacheSize(context, WORKING_CACHE_SIZE); |
| 369 } | 369 } |
| 370 // prepare results | 370 // prepare results |
| 371 AnalysisResult result = context.performAnalysisTask(); | 371 AnalysisResult result = context.performAnalysisTask(); |
| 372 List<ChangeNotice> notices = result.changeNotices; | 372 List<ChangeNotice> notices = result.changeNotices; |
| 373 // nothing to analyze | 373 // nothing to analyze |
| 374 if (notices == null) { | 374 if (notices == null) { |
| 375 bool cacheInconsistencyFixed = context.validateCacheConsistency(); | 375 server.scheduleCacheConsistencyValidation(context); |
| 376 if (cacheInconsistencyFixed) { | |
| 377 server.addOperation(new PerformAnalysisOperation(context, true)); | |
| 378 return; | |
| 379 } | |
| 380 // analysis is done | |
| 381 setCacheSize(context, IDLE_CACHE_SIZE); | 376 setCacheSize(context, IDLE_CACHE_SIZE); |
| 382 server.sendContextAnalysisDoneNotifications( | 377 server.sendContextAnalysisDoneNotifications( |
| 383 context, AnalysisDoneReason.COMPLETE); | 378 context, AnalysisDoneReason.COMPLETE); |
| 384 return; | 379 return; |
| 385 } | 380 } |
| 386 // process results | 381 // process results |
| 387 ServerPerformanceStatistics.notices.makeCurrentWhile(() { | 382 ServerPerformanceStatistics.notices.makeCurrentWhile(() { |
| 388 _sendNotices(server, notices); | 383 _sendNotices(server, notices); |
| 389 _updateIndex(server, notices); | 384 _updateIndex(server, notices); |
| 390 }); | 385 }); |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 abstract class _SingleFileOperation extends SourceSensitiveOperation { | 535 abstract class _SingleFileOperation extends SourceSensitiveOperation { |
| 541 final String file; | 536 final String file; |
| 542 | 537 |
| 543 _SingleFileOperation(AnalysisContext context, this.file) : super(context); | 538 _SingleFileOperation(AnalysisContext context, this.file) : super(context); |
| 544 | 539 |
| 545 @override | 540 @override |
| 546 bool shouldBeDiscardedOnSourceChange(Source source) { | 541 bool shouldBeDiscardedOnSourceChange(Source source) { |
| 547 return source.fullName == file; | 542 return source.fullName == file; |
| 548 } | 543 } |
| 549 } | 544 } |
| OLD | NEW |