From c9f878962a7c9d1c33d5834a1dce2106c9286699 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 1 Jul 2020 14:57:59 +0200 Subject: Add reload workspace command --- crates/rust-analyzer/src/lsp_ext.rs | 6 +++--- crates/rust-analyzer/src/main_loop.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'crates') diff --git a/crates/rust-analyzer/src/lsp_ext.rs b/crates/rust-analyzer/src/lsp_ext.rs index 1befe678c..82207bbb8 100644 --- a/crates/rust-analyzer/src/lsp_ext.rs +++ b/crates/rust-analyzer/src/lsp_ext.rs @@ -14,12 +14,12 @@ impl Request for AnalyzerStatus { const METHOD: &'static str = "rust-analyzer/analyzerStatus"; } -pub enum CollectGarbage {} +pub enum ReloadWorkspace {} -impl Request for CollectGarbage { +impl Request for ReloadWorkspace { type Params = (); type Result = (); - const METHOD: &'static str = "rust-analyzer/collectGarbage"; + const METHOD: &'static str = "rust-analyzer/reloadWorkspace"; } pub enum SyntaxTree {} diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs index 2ce1441b6..e3d49d24d 100644 --- a/crates/rust-analyzer/src/main_loop.rs +++ b/crates/rust-analyzer/src/main_loop.rs @@ -276,7 +276,7 @@ impl GlobalState { self.register_request(&req, request_received); RequestDispatcher { req: Some(req), global_state: self } - .on_sync::(|s, ()| Ok(s.analysis_host.collect_garbage()))? + .on_sync::(|s, ()| Ok(s.reload()))? .on_sync::(|s, p| handlers::handle_join_lines(s.snapshot(), p))? .on_sync::(|s, p| handlers::handle_on_enter(s.snapshot(), p))? .on_sync::(|_, ()| Ok(()))? -- cgit v1.2.3