Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Side by Side Diff: pkg/analysis_server/lib/src/analysis_server.dart

Issue 1451893002: If analysis is already complete, don't start it again in onFileAnalysisComplete(). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 analysis.server; 5 library analysis.server;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 import 'dart:core' hide Resource; 9 import 'dart:core' hide Resource;
10 import 'dart:math' show max; 10 import 'dart:math' show max;
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 * 750 *
751 * 2. We should complete the future as soon as the file is analyzed (not wait 751 * 2. We should complete the future as soon as the file is analyzed (not wait
752 * until the context is completely finished) 752 * until the context is completely finished)
753 */ 753 */
754 Future<AnalysisDoneReason> onFileAnalysisComplete(String file) { 754 Future<AnalysisDoneReason> onFileAnalysisComplete(String file) {
755 // prepare AnalysisContext 755 // prepare AnalysisContext
756 AnalysisContext context = getAnalysisContext(file); 756 AnalysisContext context = getAnalysisContext(file);
757 if (context == null) { 757 if (context == null) {
758 return null; 758 return null;
759 } 759 }
760 // done if everything is already analyzed
761 if (isAnalysisComplete()) {
762 return new Future.value(AnalysisDoneReason.COMPLETE);
763 }
760 // schedule context analysis 764 // schedule context analysis
761 schedulePerformAnalysisOperation(context); 765 schedulePerformAnalysisOperation(context);
762 // associate with the context completer 766 // associate with the context completer
763 Completer<AnalysisDoneReason> completer = 767 Completer<AnalysisDoneReason> completer =
764 contextAnalysisDoneCompleters[context]; 768 contextAnalysisDoneCompleters[context];
765 if (completer == null) { 769 if (completer == null) {
766 completer = new Completer<AnalysisDoneReason>(); 770 completer = new Completer<AnalysisDoneReason>();
767 contextAnalysisDoneCompleters[context] = completer; 771 contextAnalysisDoneCompleters[context] = completer;
768 } 772 }
769 return completer.future; 773 return completer.future;
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after
1640 /** 1644 /**
1641 * The [PerformanceTag] for time spent in server request handlers. 1645 * The [PerformanceTag] for time spent in server request handlers.
1642 */ 1646 */
1643 static PerformanceTag serverRequests = new PerformanceTag('serverRequests'); 1647 static PerformanceTag serverRequests = new PerformanceTag('serverRequests');
1644 1648
1645 /** 1649 /**
1646 * The [PerformanceTag] for time spent in split store microtasks. 1650 * The [PerformanceTag] for time spent in split store microtasks.
1647 */ 1651 */
1648 static PerformanceTag splitStore = new PerformanceTag('splitStore'); 1652 static PerformanceTag splitStore = new PerformanceTag('splitStore');
1649 } 1653 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698