diff options
Diffstat (limited to 'cli')
-rw-r--r-- | cli/Cargo.toml | 49 | ||||
-rw-r--r-- | cli/file_watcher.rs | 10 | ||||
-rw-r--r-- | cli/lsp/capabilities.rs | 3 | ||||
-rw-r--r-- | cli/lsp/tsc.rs | 3 | ||||
-rw-r--r-- | cli/tokio_util.rs | 7 | ||||
-rw-r--r-- | cli/tools/repl.rs | 5 |
6 files changed, 39 insertions, 38 deletions
diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 79b579af3..2c0b466bc 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -18,7 +18,6 @@ path = "main.rs" name = "denort" path = "main_runtime.rs" - [[bench]] name = "deno_bench" harness = false @@ -29,12 +28,12 @@ deno_core = { path = "../core", version = "0.75.0" } deno_fetch = { path = "../op_crates/fetch", version = "0.18.0" } deno_web = { path = "../op_crates/web", version = "0.26.0" } deno_websocket = { path = "../op_crates/websocket", version = "0.1.0" } -regex = "1.3.9" +regex = "1.4.3" serde = { version = "1.0.116", features = ["derive"] } [target.'cfg(windows)'.build-dependencies] -winres = "0.1.11" winapi = "0.3.9" +winres = "0.1.11" [dependencies] deno_core = { path = "../core", version = "0.75.0" } @@ -43,28 +42,28 @@ deno_lint = "0.2.15" deno_runtime = { path = "../runtime", version = "0.5.0" } atty = "0.2.14" -base64 = "0.12.3" -byteorder = "1.3.4" +base64 = "0.13.0" +byteorder = "1.4.2" clap = "2.33.3" dissimilar = "1.0.2" dprint-plugin-typescript = "0.38.1" -encoding_rs = "0.8.24" -env_logger = "0.7.1" -filetime = "0.2.12" -http = "0.2.1" -indexmap = "1.6.0" -jsonc-parser = "0.14.0" +encoding_rs = "0.8.26" +env_logger = "0.8.2" +filetime = "0.2.13" +http = "0.2.3" +indexmap = "1.6.1" +jsonc-parser = "0.15.1" lazy_static = "1.4.0" -libc = "0.2.77" -log = { version = "0.4.11", features = ["serde"] } -lspower = "0.1.0" -notify = "5.0.0-pre.3" +libc = "0.2.82" +log = { version = "0.4.13", features = ["serde"] } +lspower = "0.3.0" +notify = "5.0.0-pre.4" percent-encoding = "2.1.0" -regex = "1.3.9" +regex = "1.4.3" ring = "0.16.19" rustyline = { version = "7.1.0", default-features = false } rustyline-derive = "0.4.0" -semver-parser = "0.9.0" +semver-parser = "0.10.2" serde = { version = "1.0.116", features = ["derive"] } shell-escape = "0.1.5" sourcemap = "6.0.1" @@ -72,25 +71,25 @@ swc_bundler = "0.19.2" swc_common = { version = "0.10.8", features = ["sourcemap"] } swc_ecmascript = { version = "0.17.1", features = ["codegen", "dep_graph", "parser", "proposal", "react", "transforms", "typescript", "visit"] } tempfile = "3.1.0" -termcolor = "1.1.0" -tokio = { version = "0.2.22", features = ["full"] } -tokio-rustls = "0.14.1" -uuid = { version = "0.8.1", features = ["v4"] } +termcolor = "1.1.2" +tokio = { version = "1.0.1", features = ["full"] } +tokio-rustls = "0.22.0" +uuid = { version = "0.8.2", features = ["v4"] } walkdir = "2.3.1" [target.'cfg(windows)'.dependencies] -winapi = { version = "0.3.9", features = ["knownfolders", "mswsock", "objbase", "shlobj", "tlhelp32", "winbase", "winerror", "winsock2"] } fwdansi = "1.1.0" +winapi = { version = "0.3.9", features = ["knownfolders", "mswsock", "objbase", "shlobj", "tlhelp32", "winbase", "winerror", "winsock2"] } [target.'cfg(unix)'.dependencies] -nix = "0.19.0" +nix = "0.19.1" [dev-dependencies] # Used in benchmark -chrono = "0.4.15" +chrono = "0.4.19" os_pipe = "0.9.2" test_util = { path = "../test_util" } -tower-test = "0.3.0" +tower-test = "0.4.0" [target.'cfg(unix)'.dev-dependencies] exec = "0.3.1" # Used in test_raw_tty diff --git a/cli/file_watcher.rs b/cli/file_watcher.rs index 655cff534..699a27864 100644 --- a/cli/file_watcher.rs +++ b/cli/file_watcher.rs @@ -18,21 +18,21 @@ use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; use std::time::Duration; use tokio::select; -use tokio::time::{delay_for, Delay}; +use tokio::time::sleep; const DEBOUNCE_INTERVAL_MS: Duration = Duration::from_millis(200); type FileWatcherFuture<T> = Pin<Box<dyn Future<Output = T>>>; struct Debounce { - delay: Delay, + sleep: Pin<Box<dyn Future<Output = ()>>>, event_detected: Arc<AtomicBool>, } impl Debounce { fn new() -> Self { Self { - delay: delay_for(DEBOUNCE_INTERVAL_MS), + sleep: sleep(DEBOUNCE_INTERVAL_MS).boxed_local(), event_detected: Arc::new(AtomicBool::new(false)), } } @@ -52,9 +52,9 @@ impl Stream for Debounce { inner.event_detected.store(false, Ordering::Relaxed); Poll::Ready(Some(())) } else { - match inner.delay.poll_unpin(cx) { + match inner.sleep.poll_unpin(cx) { Poll::Ready(_) => { - inner.delay = delay_for(DEBOUNCE_INTERVAL_MS); + inner.sleep = sleep(DEBOUNCE_INTERVAL_MS).boxed_local(); Poll::Pending } Poll::Pending => Poll::Pending, diff --git a/cli/lsp/capabilities.rs b/cli/lsp/capabilities.rs index 873d424e3..9c4cd317f 100644 --- a/cli/lsp/capabilities.rs +++ b/cli/lsp/capabilities.rs @@ -67,10 +67,11 @@ pub fn server_capabilities( color_provider: None, execute_command_provider: None, call_hierarchy_provider: None, - on_type_rename_provider: None, semantic_highlighting: None, semantic_tokens_provider: None, workspace: None, experimental: None, + linked_editing_range_provider: None, + moniker_provider: None, } } diff --git a/cli/lsp/tsc.rs b/cli/lsp/tsc.rs index c9780ca27..67d6afcc5 100644 --- a/cli/lsp/tsc.rs +++ b/cli/lsp/tsc.rs @@ -53,7 +53,7 @@ impl TsServer { // the language server... let mut ts_runtime = start(false).expect("could not start tsc"); - let mut runtime = create_basic_runtime(); + let runtime = create_basic_runtime(); runtime.block_on(async { while let Some((req, state_snapshot, tx)) = rx.recv().await { let value = request(&mut ts_runtime, state_snapshot, req); @@ -482,6 +482,7 @@ impl RenameLocations { } Ok(lsp_types::WorkspaceEdit { + change_annotations: None, changes: None, document_changes: Some(lsp_types::DocumentChanges::Edits( text_document_edit_map.values().cloned().collect(), diff --git a/cli/tokio_util.rs b/cli/tokio_util.rs index ef0ba5be3..5ee45325d 100644 --- a/cli/tokio_util.rs +++ b/cli/tokio_util.rs @@ -1,8 +1,7 @@ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. pub fn create_basic_runtime() -> tokio::runtime::Runtime { - tokio::runtime::Builder::new() - .basic_scheduler() + tokio::runtime::Builder::new_current_thread() .enable_io() .enable_time() // This limits the number of threads for blocking operations (like for @@ -10,7 +9,7 @@ pub fn create_basic_runtime() -> tokio::runtime::Runtime { // parallel for deno fmt. // The default value is 512, which is an unhelpfully large thread pool. We // don't ever want to have more than a couple dozen threads. - .max_threads(32) + .max_blocking_threads(32) .build() .unwrap() } @@ -20,6 +19,6 @@ pub fn run_basic<F, R>(future: F) -> R where F: std::future::Future<Output = R>, { - let mut rt = create_basic_runtime(); + let rt = create_basic_runtime(); rt.block_on(future) } diff --git a/cli/tools/repl.rs b/cli/tools/repl.rs index e59fd57a8..cf5c0e983 100644 --- a/cli/tools/repl.rs +++ b/cli/tools/repl.rs @@ -6,6 +6,7 @@ use crate::colors; use crate::media_type::MediaType; use crate::program_state::ProgramState; use deno_core::error::AnyError; +use deno_core::futures::FutureExt; use deno_core::serde_json::json; use deno_core::serde_json::Value; use deno_runtime::inspector::InspectorSession; @@ -277,7 +278,7 @@ async fn post_message_and_poll( // A zero delay is long enough to yield the thread in order to prevent the loop from // running hot for messages that are taking longer to resolve like for example an // evaluation of top level await. - tokio::time::delay_for(tokio::time::Duration::from_millis(0)).await; + tokio::time::sleep(tokio::time::Duration::from_millis(0)).await; } } } @@ -305,7 +306,7 @@ async fn read_line_and_poll( // Because an inspector websocket client may choose to connect at anytime when we have an // inspector server we need to keep polling the worker to pick up new connections. let mut timeout = - tokio::time::delay_for(tokio::time::Duration::from_millis(100)); + tokio::time::sleep(tokio::time::Duration::from_millis(100)).boxed_local(); tokio::select! { result = &mut line => { |