diff --git a/cli/main.rs b/cli/main.rs index 2fb595b793..e42c6325e1 100644 --- a/cli/main.rs +++ b/cli/main.rs @@ -3,7 +3,6 @@ mod args; mod auth_tokens; mod cache; -mod cdp; mod checksum; mod deno_dir; mod deno_std; diff --git a/cli/text_encoding.rs b/cli/text_encoding.rs index 2bb45beb03..c16a1289d9 100644 --- a/cli/text_encoding.rs +++ b/cli/text_encoding.rs @@ -1,10 +1,9 @@ // Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. use encoding_rs::*; -use std::{ - borrow::Cow, - io::{Error, ErrorKind}, -}; +use std::borrow::Cow; +use std::io::Error; +use std::io::ErrorKind; pub const BOM_CHAR: char = '\u{FEFF}'; diff --git a/cli/cdp.rs b/cli/tools/repl/cdp.rs similarity index 100% rename from cli/cdp.rs rename to cli/tools/repl/cdp.rs diff --git a/cli/tools/repl/editor.rs b/cli/tools/repl/editor.rs index 73196d3f34..2ff9ee0b4b 100644 --- a/cli/tools/repl/editor.rs +++ b/cli/tools/repl/editor.rs @@ -1,6 +1,5 @@ // Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. -use crate::cdp; use crate::colors; use deno_ast::swc::parser::error::SyntaxError; use deno_ast::swc::parser::token::Token; @@ -32,6 +31,7 @@ use std::sync::atomic::AtomicBool; use std::sync::atomic::Ordering::Relaxed; use std::sync::Arc; +use super::cdp; use super::channel::RustylineSyncMessageSender; // Provides helpers to the editor like validation for multi-line edits, completion candidates for diff --git a/cli/tools/repl/mod.rs b/cli/tools/repl/mod.rs index e375915832..597b3ff5f0 100644 --- a/cli/tools/repl/mod.rs +++ b/cli/tools/repl/mod.rs @@ -6,6 +6,7 @@ use deno_runtime::permissions::Permissions; use deno_runtime::worker::MainWorker; use rustyline::error::ReadlineError; +mod cdp; mod channel; mod editor; mod session; diff --git a/cli/tools/repl/session.rs b/cli/tools/repl/session.rs index f2cdfe568b..e3bdac3b24 100644 --- a/cli/tools/repl/session.rs +++ b/cli/tools/repl/session.rs @@ -1,6 +1,5 @@ // Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. -use crate::cdp; use crate::colors; use crate::lsp::ReplLanguageServer; use deno_ast::DiagnosticsError; @@ -12,6 +11,8 @@ use deno_core::serde_json::Value; use deno_core::LocalInspectorSession; use deno_runtime::worker::MainWorker; +use super::cdp; + static PRELUDE: &str = r#" Object.defineProperty(globalThis, "_", { configurable: true,