diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2021-06-30 18:01:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-30 18:01:11 +0200 |
commit | 3e21ffc935a139f9cfa1ddfaeffd6429d53061ed (patch) | |
tree | c0536ee2d2956f5238456440de922c89eb28172e /runtime/inspector_server.rs | |
parent | 622f9c688902411e347038e82fc5c354c60678cf (diff) |
feat(inspector): improve inspector prompt in Chrome Devtools (#11187)
This commit improves how Deno inspector presents itself in Chrome Devtools.
Diffstat (limited to 'runtime/inspector_server.rs')
-rw-r--r-- | runtime/inspector_server.rs | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/runtime/inspector_server.rs b/runtime/inspector_server.rs index a205455fa..793cd2866 100644 --- a/runtime/inspector_server.rs +++ b/runtime/inspector_server.rs @@ -64,8 +64,10 @@ impl InspectorServer { &self, session_sender: UnboundedSender<InspectorSessionProxy>, deregister_rx: oneshot::Receiver<()>, + module_url: String, ) { - let info = InspectorInfo::new(self.host, session_sender, deregister_rx); + let info = + InspectorInfo::new(self.host, session_sender, deregister_rx, module_url); self.register_inspector_tx.unbounded_send(info).unwrap(); } } @@ -333,6 +335,7 @@ pub struct InspectorInfo { pub thread_name: Option<String>, pub new_session_tx: UnboundedSender<InspectorSessionProxy>, pub deregister_rx: oneshot::Receiver<()>, + pub url: String, } impl InspectorInfo { @@ -340,6 +343,7 @@ impl InspectorInfo { host: SocketAddr, new_session_tx: mpsc::UnboundedSender<InspectorSessionProxy>, deregister_rx: oneshot::Receiver<()>, + url: String, ) -> Self { Self { host, @@ -347,6 +351,7 @@ impl InspectorInfo { thread_name: thread::current().name().map(|n| n.to_owned()), new_session_tx, deregister_rx, + url, } } @@ -358,7 +363,7 @@ impl InspectorInfo { "id": self.uuid.to_string(), "title": self.get_title(), "type": "node", - // TODO(ry): "url": "file://", + "url": self.url.to_string(), "webSocketDebuggerUrl": self.get_websocket_debugger_url(), }) } @@ -376,13 +381,13 @@ impl InspectorInfo { fn get_title(&self) -> String { format!( - "[{}] deno{}", - process::id(), + "deno{} [pid: {}]", self .thread_name .as_ref() .map(|n| format!(" - {}", n)) - .unwrap_or_default() + .unwrap_or_default(), + process::id(), ) } } |