Index: sdk/lib/_internal/pub/lib/src/barback/web_socket_api.dart |
diff --git a/sdk/lib/_internal/pub/lib/src/barback/web_socket_api.dart b/sdk/lib/_internal/pub/lib/src/barback/web_socket_api.dart |
index 63e56fdb38bcb203f3c2f763c46e5e18d5d426b2..d1ce75f8e61f1ebe3817746ade408cb1064a8d9e 100644 |
--- a/sdk/lib/_internal/pub/lib/src/barback/web_socket_api.dart |
+++ b/sdk/lib/_internal/pub/lib/src/barback/web_socket_api.dart |
@@ -89,31 +89,32 @@ class WebSocketApi { |
/// |
/// This does *not* currently check to ensure the asset actually exists. It |
/// only maps what the corresponding asset *should* be for that URL. |
- Map _urlToAssetId(json_rpc.Parameters params) { |
+ Future<Map> _urlToAssetId(json_rpc.Parameters params) { |
var url = params["url"].asUri; |
// If a line number was given, map it to the output line. |
var line = params["line"].asIntOr(null); |
- var id = _environment.getAssetIdForUrl(url); |
- if (id == null) { |
- throw new json_rpc.RpcException(_NOT_SERVED, |
- '"${url.host}:${url.port}" is not being served by pub.'); |
- } |
+ return _environment.getAssetIdForUrl(url).then((id) { |
+ if (id == null) { |
+ throw new json_rpc.RpcException(_NOT_SERVED, |
+ '"${url.host}:${url.port}" is not being served by pub.'); |
+ } |
- // TODO(rnystrom): When this is hooked up to actually talk to barback to |
- // see if assets exist, consider supporting implicit index.html at that |
- // point. |
+ // TODO(rnystrom): When this is hooked up to actually talk to barback to |
+ // see if assets exist, consider supporting implicit index.html at that |
+ // point. |
- var result = {"package": id.package, "path": id.path}; |
+ var result = {"package": id.package, "path": id.path}; |
- // Map the line. |
- // TODO(rnystrom): Right now, source maps are not supported and it just |
- // passes through the original line. This lets the editor start using |
- // this API before we've fully implemented it. See #12339 and #16061. |
- if (line != null) result["line"] = line; |
+ // Map the line. |
+ // TODO(rnystrom): Right now, source maps are not supported and it just |
+ // passes through the original line. This lets the editor start using |
+ // this API before we've fully implemented it. See #12339 and #16061. |
+ if (line != null) result["line"] = line; |
- return result; |
+ return result; |
+ }); |
} |
/// Given a path on the filesystem, returns the URLs served by pub that can be |