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

Side by Side Diff: pkg/analyzer/lib/src/context/source.dart

Issue 1737693004: Update SOURCE_KIND when a missing source file appears (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 analyzer.src.context.source; 5 library analyzer.src.context.source;
6 6
7 import 'package:analyzer/file_system/file_system.dart'; 7 import 'package:analyzer/file_system/file_system.dart';
8 import 'package:analyzer/file_system/physical_file_system.dart'; 8 import 'package:analyzer/file_system/physical_file_system.dart';
9 import 'package:analyzer/source/package_map_resolver.dart'; 9 import 'package:analyzer/source/package_map_resolver.dart';
10 import 'package:analyzer/src/generated/engine.dart'; 10 import 'package:analyzer/src/generated/engine.dart';
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 'package:$name/${sourceUri.path.substring(uri.path.length)}'); 252 'package:$name/${sourceUri.path.substring(uri.path.length)}');
253 } 253 }
254 } 254 }
255 }); 255 });
256 return packageUri; 256 return packageUri;
257 } 257 }
258 258
259 /** 259 /**
260 * Return a source object representing the URI that results from resolving 260 * Return a source object representing the URI that results from resolving
261 * the given (possibly relative) contained URI against the URI associated 261 * the given (possibly relative) contained URI against the URI associated
262 * with an existing source object, or `null` if the URI could not be resolved. 262 * with an existing source object.
263 *
264 * Returns null if no resolver can handle the URI. If the source file is
Brian Wilkerson 2016/02/26 15:07:32 nit: "Returns null" --> "Return `null`"
skybrian 2016/02/26 18:09:01 Okay, but FYI this is the opposite of normal dartd
Brian Wilkerson 2016/02/26 18:35:57 I'm aware, but it's consistent with most of the re
265 * missing, returns a non-null Source that will have a negative
Brian Wilkerson 2016/02/26 15:07:32 nit: "returns" --> "return"
266 * modificationStamp.
263 * 267 *
264 * @param containingSource the source containing the given URI 268 * @param containingSource the source containing the given URI
265 * @param containedUri the (possibly relative) URI to be resolved against the 269 * @param containedUri the (possibly relative) URI to be resolved against the
266 * containing source 270 * containing source
267 * @return the source representing the contained URI 271 * @return the source representing the contained URI
268 * @throws AnalysisException if either the contained URI is invalid or if it 272 * @throws AnalysisException if either the contained URI is invalid or if it
269 * cannot be resolved against the source object's URI 273 * cannot be resolved against the source object's URI
270 */ 274 */
271 Source _internalResolveUri(Source containingSource, Uri containedUri) { 275 Source _internalResolveUri(Source containingSource, Uri containedUri) {
272 if (!containedUri.isAbsolute) { 276 if (!containedUri.isAbsolute) {
(...skipping 29 matching lines...) Expand all
302 for (UriResolver resolver in resolvers) { 306 for (UriResolver resolver in resolvers) {
303 Source result = resolver.resolveAbsolute(containedUri, actualUri); 307 Source result = resolver.resolveAbsolute(containedUri, actualUri);
304 if (result != null) { 308 if (result != null) {
305 return result; 309 return result;
306 } 310 }
307 } 311 }
308 312
309 return null; 313 return null;
310 } 314 }
311 } 315 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698