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

Side by Side Diff: pkg/analyzer/lib/source/package_map_resolver.dart

Issue 681003002: Replace ${name} with $name where possible. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Clean up also implementation Created 6 years, 1 month 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/analyzer/lib/source/pub_package_map_provider.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 source.package_map_resolver; 5 library source.package_map_resolver;
6 6
7 import 'package:analyzer/file_system/file_system.dart'; 7 import 'package:analyzer/file_system/file_system.dart';
8 import 'package:analyzer/src/generated/source.dart'; 8 import 'package:analyzer/src/generated/source.dart';
9 9
10 10
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 @override 76 @override
77 Uri restoreAbsolute(Source source) { 77 Uri restoreAbsolute(Source source) {
78 String sourcePath = source.fullName; 78 String sourcePath = source.fullName;
79 for (String pkgName in packageMap.keys) { 79 for (String pkgName in packageMap.keys) {
80 List<Folder> pkgFolders = packageMap[pkgName]; 80 List<Folder> pkgFolders = packageMap[pkgName];
81 for (Folder pkgFolder in pkgFolders) { 81 for (Folder pkgFolder in pkgFolders) {
82 String pkgFolderPath = pkgFolder.path; 82 String pkgFolderPath = pkgFolder.path;
83 if (sourcePath.startsWith(pkgFolderPath)) { 83 if (sourcePath.startsWith(pkgFolderPath)) {
84 String relPath = sourcePath.substring(pkgFolderPath.length); 84 String relPath = sourcePath.substring(pkgFolderPath.length);
85 return new Uri(path: '${PACKAGE_SCHEME}:$pkgName$relPath'); 85 return new Uri(path: '$PACKAGE_SCHEME:$pkgName$relPath');
86 } 86 }
87 } 87 }
88 } 88 }
89 return null; 89 return null;
90 } 90 }
91 91
92 /** 92 /**
93 * Returns `true` if [uri] is a `package` URI. 93 * Returns `true` if [uri] is a `package` URI.
94 */ 94 */
95 static bool isPackageUri(Uri uri) { 95 static bool isPackageUri(Uri uri) {
96 return uri.scheme == PACKAGE_SCHEME; 96 return uri.scheme == PACKAGE_SCHEME;
97 } 97 }
98 } 98 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/source/pub_package_map_provider.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698