| OLD | NEW |
| 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 analyzer.src.generated.source; | 5 library analyzer.src.generated.source; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 import "dart:math" as math; | 8 import "dart:math" as math; |
| 9 | 9 |
| 10 import 'package:analyzer/file_system/file_system.dart'; | 10 import 'package:analyzer/file_system/file_system.dart'; |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 DartSdk get dartSdk => _sdk; | 167 DartSdk get dartSdk => _sdk; |
| 168 | 168 |
| 169 @override | 169 @override |
| 170 Source resolveAbsolute(Uri uri, [Uri actualUri]) { | 170 Source resolveAbsolute(Uri uri, [Uri actualUri]) { |
| 171 if (!isDartUri(uri)) { | 171 if (!isDartUri(uri)) { |
| 172 return null; | 172 return null; |
| 173 } | 173 } |
| 174 return _sdk.mapDartUri(uri.toString()); | 174 return _sdk.mapDartUri(uri.toString()); |
| 175 } | 175 } |
| 176 | 176 |
| 177 @override |
| 178 Uri restoreAbsolute(Source source) { |
| 179 Source dartSource = _sdk.fromFileUri(source.uri); |
| 180 return dartSource?.uri; |
| 181 } |
| 182 |
| 177 /** | 183 /** |
| 178 * Return `true` if the given URI is a `dart-ext:` URI. | 184 * Return `true` if the given URI is a `dart-ext:` URI. |
| 179 * | 185 * |
| 180 * @param uriContent the textual representation of the URI being tested | 186 * @param uriContent the textual representation of the URI being tested |
| 181 * @return `true` if the given URI is a `dart-ext:` URI | 187 * @return `true` if the given URI is a `dart-ext:` URI |
| 182 */ | 188 */ |
| 183 static bool isDartExtUri(String uriContent) => | 189 static bool isDartExtUri(String uriContent) => |
| 184 uriContent != null && uriContent.startsWith(_DART_EXT_SCHEME); | 190 uriContent != null && uriContent.startsWith(_DART_EXT_SCHEME); |
| 185 | 191 |
| 186 /** | 192 /** |
| (...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 756 Source resolveAbsolute(Uri uri, [Uri actualUri]); | 762 Source resolveAbsolute(Uri uri, [Uri actualUri]); |
| 757 | 763 |
| 758 /** | 764 /** |
| 759 * Return an absolute URI that represents the given [source], or `null` if a | 765 * Return an absolute URI that represents the given [source], or `null` if a |
| 760 * valid URI cannot be computed. | 766 * valid URI cannot be computed. |
| 761 * | 767 * |
| 762 * The computation should be based solely on [source.fullName]. | 768 * The computation should be based solely on [source.fullName]. |
| 763 */ | 769 */ |
| 764 Uri restoreAbsolute(Source source) => null; | 770 Uri restoreAbsolute(Source source) => null; |
| 765 } | 771 } |
| OLD | NEW |