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

Unified Diff: pkg/analysis_server/lib/src/analysis_server.dart

Issue 1289643003: Support for analysis.setPriorityFiles for files in SDK. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analysis_server/test/analysis/get_navigation_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/analysis_server.dart
diff --git a/pkg/analysis_server/lib/src/analysis_server.dart b/pkg/analysis_server/lib/src/analysis_server.dart
index 21a0f7ee7af35745d5efaa1f7be7edf13cbdb2f5..87c65090fe8433211f1ef85d555e3ad5a15288f8 100644
--- a/pkg/analysis_server/lib/src/analysis_server.dart
+++ b/pkg/analysis_server/lib/src/analysis_server.dart
@@ -183,7 +183,8 @@ class AnalysisServer {
* A table mapping [AnalysisContext]s to the completers that should be
* completed when analysis of this context is finished.
*/
- Map<AnalysisContext, Completer<AnalysisDoneReason>> contextAnalysisDoneCompleters =
+ Map<AnalysisContext,
+ Completer<AnalysisDoneReason>> contextAnalysisDoneCompleters =
new HashMap<AnalysisContext, Completer<AnalysisDoneReason>>();
/**
@@ -291,9 +292,15 @@ class AnalysisServer {
* exceptions to show up in unit tests, but it should be set to false when
* running a full analysis server.
*/
- AnalysisServer(this.channel, this.resourceProvider,
- PubPackageMapProvider packageMapProvider, Index _index, this.serverPlugin,
- this.options, this.defaultSdk, this.instrumentationService,
+ AnalysisServer(
+ this.channel,
+ this.resourceProvider,
+ PubPackageMapProvider packageMapProvider,
+ Index _index,
+ this.serverPlugin,
+ this.options,
+ this.defaultSdk,
+ this.instrumentationService,
{ContextManager contextManager: null,
ResolverProvider packageResolverProvider: null,
this.rethrowExceptions: true})
@@ -490,8 +497,8 @@ class AnalysisServer {
Uri uri = resourceProvider.pathContext.toUri(path);
Source sdkSource = defaultSdk.fromFileUri(uri);
if (sdkSource != null) {
- AnalysisContext anyContext = folderMap.values.first;
- return new ContextSourcePair(anyContext, sdkSource);
+ AnalysisContext sdkContext = defaultSdk.context;
+ return new ContextSourcePair(sdkContext, sdkSource);
}
}
// try to find the deep-most containing context
@@ -1039,9 +1046,12 @@ class AnalysisServer {
}
// Fill the source map.
bool contextFound = false;
+ if (preferredContext != null) {
+ sourceMap.putIfAbsent(preferredContext, () => <Source>[]).add(source);
+ contextFound = true;
+ }
for (AnalysisContext context in folderMap.values) {
- if (context == preferredContext ||
- context.getKindOf(source) != SourceKind.UNKNOWN) {
+ if (context.getKindOf(source) != SourceKind.UNKNOWN) {
sourceMap.putIfAbsent(context, () => <Source>[]).add(source);
contextFound = true;
}
@@ -1059,11 +1069,7 @@ class AnalysisServer {
throw new RequestFailure(
new Response.unanalyzedPriorityFiles(requestId, buffer.toString()));
}
- folderMap.forEach((Folder folder, AnalysisContext context) {
- List<Source> sourceList = sourceMap[context];
- if (sourceList == null) {
- sourceList = Source.EMPTY_LIST;
- }
+ sourceMap.forEach((context, List<Source> sourceList) {
context.analysisPriorityOrder = sourceList;
// Schedule the context for analysis so that it has the opportunity to
// cache the AST's for the priority sources as soon as possible.
@@ -1462,7 +1468,6 @@ class ServerContextManagerCallbacks extends ContextManagerCallbacks {
* such as request latency.
*/
class ServerPerformance {
-
/**
* The creation time and the time when performance information
* started to be recorded here.
« no previous file with comments | « no previous file | pkg/analysis_server/test/analysis/get_navigation_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698