From a9373c4220a677e4ba38185d14fce67b56fdee44 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 29 May 2019 21:07:38 +0300 Subject: less noisy status --- crates/ra_lsp_server/src/main_loop/handlers.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index dc817f2d9..0ebfd641d 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs @@ -34,7 +34,7 @@ pub fn handle_analyzer_status(world: ServerWorld, _: ()) -> Result { let requests = world.latest_completed_requests.read(); for (idx, r) in requests.iter().enumerate() { let current = if idx == world.request_idx { "*" } else { " " }; - writeln!(buf, "{:4}{}{:<36}: {:?}", r.id, current, r.method, r.duration).unwrap(); + writeln!(buf, "{:4}{}{:<36}{}ms", r.id, current, r.method, r.duration.as_millis()).unwrap(); } Ok(buf) } -- cgit v1.2.3 From 6bcc1b8b9e9ff90a5c5442dce230dba5995ca5b5 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 29 May 2019 22:13:03 +0300 Subject: add cacellation checks to expensive queries --- crates/ra_hir/src/nameres.rs | 1 + crates/ra_hir/src/nameres/collector.rs | 1 + crates/ra_hir/src/ty/traits.rs | 1 + 3 files changed, 3 insertions(+) diff --git a/crates/ra_hir/src/nameres.rs b/crates/ra_hir/src/nameres.rs index 9b9212bfc..42dcac332 100644 --- a/crates/ra_hir/src/nameres.rs +++ b/crates/ra_hir/src/nameres.rs @@ -222,6 +222,7 @@ fn or(left: ItemOrMacro, right: ItemOrMacro) -> ItemOrMacro { impl CrateDefMap { pub(crate) fn crate_def_map_query(db: &impl DefDatabase, krate: Crate) -> Arc { + db.check_canceled(); let _p = profile("crate_def_map_query"); let def_map = { let edition = krate.edition(db); diff --git a/crates/ra_hir/src/nameres/collector.rs b/crates/ra_hir/src/nameres/collector.rs index ba7ea0017..af8ac064c 100644 --- a/crates/ra_hir/src/nameres/collector.rs +++ b/crates/ra_hir/src/nameres/collector.rs @@ -112,6 +112,7 @@ where // main name resolution fixed-point loop. let mut i = 0; loop { + self.db.check_canceled(); match (self.resolve_imports(), self.resolve_macros()) { (ReachedFixedPoint::Yes, ReachedFixedPoint::Yes) => break, _ => i += 1, diff --git a/crates/ra_hir/src/ty/traits.rs b/crates/ra_hir/src/ty/traits.rs index e6c78c0d4..fc90f56d5 100644 --- a/crates/ra_hir/src/ty/traits.rs +++ b/crates/ra_hir/src/ty/traits.rs @@ -82,6 +82,7 @@ pub(crate) fn implements_query( krate: Crate, trait_ref: Canonical, ) -> Option { + db.check_canceled(); let _p = profile("implements_query"); let goal: chalk_ir::Goal = trait_ref.value.to_chalk(db).cast(); debug!("goal: {:?}", goal); -- cgit v1.2.3 From 9304cb026309d68f2b5a6326e74f836bc79f88f5 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 29 May 2019 22:14:06 +0300 Subject: bump timeout for CI --- crates/ra_lsp_server/tests/heavy_tests/support.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ra_lsp_server/tests/heavy_tests/support.rs b/crates/ra_lsp_server/tests/heavy_tests/support.rs index 729067395..f952a03a3 100644 --- a/crates/ra_lsp_server/tests/heavy_tests/support.rs +++ b/crates/ra_lsp_server/tests/heavy_tests/support.rs @@ -227,7 +227,7 @@ impl Drop for Server { } fn recv_timeout(receiver: &Receiver) -> Option { - let timeout = Duration::from_secs(50); + let timeout = Duration::from_secs(120); select! { recv(receiver) -> msg => msg.ok(), recv(after(timeout)) -> _ => panic!("timed out"), -- cgit v1.2.3