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

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

Issue 2297343002: Flush results when contexts are made idle. (Closed)
Patch Set: Un-fail completion tests. Created 4 years, 3 months 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 | pkg/analysis_server/lib/src/operation/operation_analysis.dart » ('j') | 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:io' as io; 10 import 'dart:io' as io;
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 */ 721 */
722 List<CompilationUnit> getResolvedCompilationUnits(String path) { 722 List<CompilationUnit> getResolvedCompilationUnits(String path) {
723 List<CompilationUnit> units = <CompilationUnit>[]; 723 List<CompilationUnit> units = <CompilationUnit>[];
724 ContextSourcePair contextSource = getContextSourcePair(path); 724 ContextSourcePair contextSource = getContextSourcePair(path);
725 // prepare AnalysisContext 725 // prepare AnalysisContext
726 AnalysisContext context = contextSource.context; 726 AnalysisContext context = contextSource.context;
727 if (context == null) { 727 if (context == null) {
728 return units; 728 return units;
729 } 729 }
730 // add a unit for each unit/library combination 730 // add a unit for each unit/library combination
731 runWithWorkingCacheSize(context, () { 731 runWithActiveContext(context, () {
732 Source unitSource = contextSource.source; 732 Source unitSource = contextSource.source;
733 List<Source> librarySources = context.getLibrariesContaining(unitSource); 733 List<Source> librarySources = context.getLibrariesContaining(unitSource);
734 for (Source librarySource in librarySources) { 734 for (Source librarySource in librarySources) {
735 CompilationUnit unit = 735 CompilationUnit unit =
736 context.resolveCompilationUnit2(unitSource, librarySource); 736 context.resolveCompilationUnit2(unitSource, librarySource);
737 if (unit != null) { 737 if (unit != null) {
738 units.add(unit); 738 units.add(unit);
739 } 739 }
740 } 740 }
741 }); 741 });
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after
1461 List<Source> librarySources = context.getLibrariesContaining(source); 1461 List<Source> librarySources = context.getLibrariesContaining(source);
1462 if (librarySources.isEmpty) { 1462 if (librarySources.isEmpty) {
1463 return null; 1463 return null;
1464 } 1464 }
1465 // if library has not been resolved yet, the unit will be resolved later 1465 // if library has not been resolved yet, the unit will be resolved later
1466 Source librarySource = librarySources[0]; 1466 Source librarySource = librarySources[0];
1467 if (context.getResult(librarySource, LIBRARY_ELEMENT6) == null) { 1467 if (context.getResult(librarySource, LIBRARY_ELEMENT6) == null) {
1468 return null; 1468 return null;
1469 } 1469 }
1470 // if library has been already resolved, resolve unit 1470 // if library has been already resolved, resolve unit
1471 return runWithWorkingCacheSize(context, () { 1471 return runWithActiveContext(context, () {
1472 return context.resolveCompilationUnit2(source, librarySource); 1472 return context.resolveCompilationUnit2(source, librarySource);
1473 }); 1473 });
1474 } 1474 }
1475 1475
1476 _scheduleAnalysisImplementedNotification() async { 1476 _scheduleAnalysisImplementedNotification() async {
1477 Set<String> files = analysisServices[AnalysisService.IMPLEMENTED]; 1477 Set<String> files = analysisServices[AnalysisService.IMPLEMENTED];
1478 if (files != null) { 1478 if (files != null) {
1479 scheduleImplementedNotification(this, files); 1479 scheduleImplementedNotification(this, files);
1480 } 1480 }
1481 } 1481 }
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
1796 /** 1796 /**
1797 * The [PerformanceTag] for time spent in server request handlers. 1797 * The [PerformanceTag] for time spent in server request handlers.
1798 */ 1798 */
1799 static PerformanceTag serverRequests = new PerformanceTag('serverRequests'); 1799 static PerformanceTag serverRequests = new PerformanceTag('serverRequests');
1800 1800
1801 /** 1801 /**
1802 * The [PerformanceTag] for time spent in split store microtasks. 1802 * The [PerformanceTag] for time spent in split store microtasks.
1803 */ 1803 */
1804 static PerformanceTag splitStore = new PerformanceTag('splitStore'); 1804 static PerformanceTag splitStore = new PerformanceTag('splitStore');
1805 } 1805 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/operation/operation_analysis.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698