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

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

Issue 787553002: invoke computeCache when priority sources change (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 6 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/domain_completion.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 9
10 import 'package:analysis_server/src/analysis_logger.dart'; 10 import 'package:analysis_server/src/analysis_logger.dart';
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 * Return `null` if there is no such context. 275 * Return `null` if there is no such context.
276 */ 276 */
277 AnalysisContext getAnalysisContext(String path) { 277 AnalysisContext getAnalysisContext(String path) {
278 // try to find a containing context 278 // try to find a containing context
279 for (Folder folder in folderMap.keys) { 279 for (Folder folder in folderMap.keys) {
280 if (folder.contains(path)) { 280 if (folder.contains(path)) {
281 return folderMap[folder]; 281 return folderMap[folder];
282 } 282 }
283 } 283 }
284 // check if there is a context that analyzed this source 284 // check if there is a context that analyzed this source
285 Source source = getSource(path); 285 return getAnalysisContextForSource(getSource(path));
286 }
287
288 /**
289 * Return the [AnalysisContext] that is used to analyze the given [source].
290 * Return `null` if there is no such context.
291 */
292 AnalysisContext getAnalysisContextForSource(Source source) {
286 for (AnalysisContext context in folderMap.values) { 293 for (AnalysisContext context in folderMap.values) {
287 SourceKind kind = context.getKindOf(source); 294 SourceKind kind = context.getKindOf(source);
288 if (kind != null) { 295 if (kind != null) {
289 return context; 296 return context;
290 } 297 }
291 } 298 }
292 return null; 299 return null;
293 } 300 }
294 301
295 /** 302 /**
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after
1034 * [packageUriResolver]. 1041 * [packageUriResolver].
1035 */ 1042 */
1036 SourceFactory _createSourceFactory(UriResolver packageUriResolver) { 1043 SourceFactory _createSourceFactory(UriResolver packageUriResolver) {
1037 List<UriResolver> resolvers = <UriResolver>[ 1044 List<UriResolver> resolvers = <UriResolver>[
1038 new DartUriResolver(analysisServer.defaultSdk), 1045 new DartUriResolver(analysisServer.defaultSdk),
1039 new ResourceUriResolver(resourceProvider), 1046 new ResourceUriResolver(resourceProvider),
1040 packageUriResolver]; 1047 packageUriResolver];
1041 return new SourceFactory(resolvers); 1048 return new SourceFactory(resolvers);
1042 } 1049 }
1043 } 1050 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/domain_completion.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698