| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 | 6 |
| 7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
| 8 import 'package:analyzer/file_system/file_system.dart'; | 8 import 'package:analyzer/file_system/file_system.dart'; |
| 9 import 'package:analyzer/src/context/context.dart'; | 9 import 'package:analyzer/src/context/context.dart'; |
| 10 import 'package:analyzer/src/dart/analysis/byte_store.dart'; | 10 import 'package:analyzer/src/dart/analysis/byte_store.dart'; |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 AnalysisContext context; | 261 AnalysisContext context; |
| 262 | 262 |
| 263 _SourceFactoryProxy(this.dartSdk, this._fileRepository); | 263 _SourceFactoryProxy(this.dartSdk, this._fileRepository); |
| 264 | 264 |
| 265 @override | 265 @override |
| 266 SourceFactory clone() => new _SourceFactoryProxy(dartSdk, _fileRepository); | 266 SourceFactory clone() => new _SourceFactoryProxy(dartSdk, _fileRepository); |
| 267 | 267 |
| 268 @override | 268 @override |
| 269 Source forUri(String absoluteUri) { | 269 Source forUri(String absoluteUri) { |
| 270 Uri uri = Uri.parse(absoluteUri); | 270 Uri uri = Uri.parse(absoluteUri); |
| 271 return forUri2(uri); |
| 272 } |
| 273 |
| 274 @override |
| 275 Source forUri2(Uri absoluteUri) { |
| 271 return new _SourceProxy( | 276 return new _SourceProxy( |
| 272 uri, _fileRepository.pathForUri(uri, allocate: true)); | 277 absoluteUri, _fileRepository.pathForUri(absoluteUri, allocate: true)); |
| 273 } | 278 } |
| 274 | 279 |
| 275 noSuchMethod(Invocation invocation) => unimplemented(); | 280 noSuchMethod(Invocation invocation) => unimplemented(); |
| 276 | 281 |
| 277 Source resolveUri(Source containingSource, String containedUri) { | 282 Source resolveUri(Source containingSource, String containedUri) { |
| 278 // TODO(paulberry): re-use code from dependency_grapher_impl, and support | 283 // TODO(paulberry): re-use code from dependency_grapher_impl, and support |
| 279 // SDK URI resolution logic. | 284 // SDK URI resolution logic. |
| 280 String absoluteUri = | 285 String absoluteUri = |
| 281 resolveRelativeUri(containingSource?.uri, Uri.parse(containedUri)) | 286 resolveRelativeUri(containingSource?.uri, Uri.parse(containedUri)) |
| 282 .toString(); | 287 .toString(); |
| 283 return forUri(absoluteUri); | 288 return forUri(absoluteUri); |
| 284 } | 289 } |
| 285 | 290 |
| 286 @override | 291 @override |
| 287 Uri restoreUri(Source source) => source.uri; | 292 Uri restoreUri(Source source) => source.uri; |
| 288 } | 293 } |
| 289 | 294 |
| 290 class _SourceProxy extends BasicSource { | 295 class _SourceProxy extends BasicSource { |
| 291 @override | 296 @override |
| 292 final String fullName; | 297 final String fullName; |
| 293 | 298 |
| 294 _SourceProxy(Uri uri, this.fullName) : super(uri); | 299 _SourceProxy(Uri uri, this.fullName) : super(uri); |
| 295 | 300 |
| 296 int get modificationStamp => 0; | 301 int get modificationStamp => 0; |
| 297 | 302 |
| 298 noSuchMethod(Invocation invocation) => unimplemented(); | 303 noSuchMethod(Invocation invocation) => unimplemented(); |
| 299 } | 304 } |
| OLD | NEW |