diff options
| author | Ryan Dahl <ry@tinyclouds.org> | 2020-03-27 16:09:51 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-27 16:09:51 -0400 |
| commit | 2874664e9131616b71dd0d7d23750245b023833f (patch) | |
| tree | 6782161aa151d00f930bc0157e95b14d895347f0 /cli/global_state.rs | |
| parent | 8bcdb422e387a88075126d80e1612a30f5a7d89e (diff) | |
feat: Support Inspector / Chrome Devtools (#4484)
This is a first pass implementation which is still missing several important
features:
- support for --inspect-brk (#4503)
- support for source maps (#4501)
- support for piping console.log to devtools console (#4502)
Co-authored-by: Bert Belder <bertbelder@gmail.com>
Co-authored-by: Matt Harrison <mt.harrison86@gmail.com>
Co-authored-by: Bartek IwaĆczuk <biwanczuk@gmail.com>
Diffstat (limited to 'cli/global_state.rs')
| -rw-r--r-- | cli/global_state.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/cli/global_state.rs b/cli/global_state.rs index 45a31406c..001c3f55f 100644 --- a/cli/global_state.rs +++ b/cli/global_state.rs @@ -9,6 +9,7 @@ use crate::deno_dir; use crate::file_fetcher::SourceFileFetcher; use crate::flags; use crate::http_cache; +use crate::inspector::InspectorServer; use crate::lockfile::Lockfile; use crate::msg; use crate::permissions::DenoPermissions; @@ -42,6 +43,7 @@ pub struct GlobalStateInner { pub wasm_compiler: WasmCompiler, pub lockfile: Option<Mutex<Lockfile>>, pub compiler_starts: AtomicUsize, + pub inspector_server: Option<InspectorServer>, compile_lock: AsyncMutex<()>, } @@ -82,7 +84,16 @@ impl GlobalState { None }; + let inspector_server = if let Some(ref host) = flags.inspect { + Some(InspectorServer::new(host, false)) + } else if let Some(ref host) = flags.inspect_brk { + Some(InspectorServer::new(host, true)) + } else { + None + }; + let inner = GlobalStateInner { + inspector_server, dir, permissions: DenoPermissions::from_flags(&flags), flags, |
