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

Unified Diff: compiler/java/com/google/dart/compiler/SystemLibraryManager.java

Issue 10690002: Fix some issues when debugging against package: libraries (Dartium and command-line). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: compiler/java/com/google/dart/compiler/SystemLibraryManager.java
===================================================================
--- compiler/java/com/google/dart/compiler/SystemLibraryManager.java (revision 9145)
+++ compiler/java/com/google/dart/compiler/SystemLibraryManager.java (working copy)
@@ -48,13 +48,13 @@
public static final File DEFAULT_PACKAGE_ROOT = new File("packages");
+ public static final String PACKAGE_SCHEME = "package";
+ public static final String PACKAGE_SCHEME_SPEC = "package:";
+
private static final String DART_SCHEME = "dart";
private static final String DART_SCHEME_SPEC = "dart:";
private static final String IMPORT_CONFIG = "import_%s.config";
- private static final String PACKAGE_SCHEME = "package";
- private static final String PACKAGE_SCHEME_SPEC = "package:";
-
/**
* Answer <code>true</code> if the string is a dart spec
*/
@@ -222,6 +222,22 @@
}
/**
+ * Given a package URI (package:foo/foo.dart), convert it into a file system URI.
+ *
+ * @param relPath
+ * @return
+ */
+ public URI resolvePackageUri(String packageUriRef) {
+ if (packageUriRef.startsWith(PACKAGE_SCHEME_SPEC)) {
+ String relPath = packageUriRef.substring(PACKAGE_SCHEME_SPEC.length());
+
+ return packageRootUri.resolve(relPath);
+ } else {
+ return null;
+ }
+ }
+
+ /**
* Answer the original "dart:<libname>" URI for the specified resolved URI or <code>null</code> if
* it does not map to a short URI.
*/
@@ -273,7 +289,7 @@
* @exception RuntimeException if the URI is a "dart" scheme,
* but does not map to a defined system library
*/
- private URI translateDartUri(URI uri) {
+ public URI translateDartUri(URI uri) {
if (isDartUri(uri)) {
String host = uri.getHost();
SystemLibrary library = hostMap.get(host);
@@ -294,7 +310,8 @@
fileUri = packageRootUri.resolve(uri.getAuthority() + uri.getPath());
}
File file = new File(fileUri);
- return file.toURI();
+
+ return file.toURI();
}
return uri;
}
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.tools.debug.core/src/com/google/dart/tools/debug/core/server/ServerDebugStackFrame.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698