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

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

Issue 2640793005: Implement UriResolver.restoreAbsolute() for DartUriResolver. (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/all_the_rest_test.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 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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/all_the_rest_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698