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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 // | 233 // |
234 // AnalysisResult result = context.performAnalysisTask((taskDescription) { | 234 // AnalysisResult result = context.performAnalysisTask((taskDescription) { |
235 // sendStatusNotification(context.toString(), taskDescription); | 235 // sendStatusNotification(context.toString(), taskDescription); |
236 // }); | 236 // }); |
237 if (!isContinue) { | 237 if (!isContinue) { |
238 setCacheSize(context, WORKING_CACHE_SIZE); | 238 setCacheSize(context, WORKING_CACHE_SIZE); |
239 } | 239 } |
240 // prepare results | 240 // prepare results |
241 AnalysisResult result = context.performAnalysisTask(); | 241 AnalysisResult result = context.performAnalysisTask(); |
242 List<ChangeNotice> notices = result.changeNotices; | 242 List<ChangeNotice> notices = result.changeNotices; |
| 243 // nothing to analyze |
243 if (notices == null) { | 244 if (notices == null) { |
| 245 bool cacheInconsistencyFixed = context.validateCacheConsistency(); |
| 246 if (cacheInconsistencyFixed) { |
| 247 server.addOperation(new PerformAnalysisOperation(context, true)); |
| 248 return; |
| 249 } |
| 250 // analysis is done |
244 setCacheSize(context, IDLE_CACHE_SIZE); | 251 setCacheSize(context, IDLE_CACHE_SIZE); |
245 server.sendContextAnalysisDoneNotifications( | 252 server.sendContextAnalysisDoneNotifications( |
246 context, AnalysisDoneReason.COMPLETE); | 253 context, AnalysisDoneReason.COMPLETE); |
247 return; | 254 return; |
248 } | 255 } |
249 // process results | 256 // process results |
250 ServerPerformanceStatistics.notices.makeCurrentWhile(() { | 257 ServerPerformanceStatistics.notices.makeCurrentWhile(() { |
251 _sendNotices(server, notices); | 258 _sendNotices(server, notices); |
252 _updateIndex(server, notices); | 259 _updateIndex(server, notices); |
253 }); | 260 }); |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 abstract class _SingleFileOperation extends SourceSensitiveOperation { | 441 abstract class _SingleFileOperation extends SourceSensitiveOperation { |
435 final String file; | 442 final String file; |
436 | 443 |
437 _SingleFileOperation(AnalysisContext context, this.file) : super(context); | 444 _SingleFileOperation(AnalysisContext context, this.file) : super(context); |
438 | 445 |
439 @override | 446 @override |
440 bool shouldBeDiscardedOnSourceChange(Source source) { | 447 bool shouldBeDiscardedOnSourceChange(Source source) { |
441 return source.fullName == file; | 448 return source.fullName == file; |
442 } | 449 } |
443 } | 450 } |
OLD | NEW |