aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-07-01 13:57:59 +0100
committerAleksey Kladov <[email protected]>2020-07-01 13:57:59 +0100
commitc9f878962a7c9d1c33d5834a1dce2106c9286699 (patch)
tree1d66c4008b662dc8bcd703b146b7cb7e92e597b1 /crates
parentec8b4dca02e454bf110f799b1ae8ebf939c0e233 (diff)
Add reload workspace command
Diffstat (limited to 'crates')
-rw-r--r--crates/rust-analyzer/src/lsp_ext.rs6
-rw-r--r--crates/rust-analyzer/src/main_loop.rs2
2 files changed, 4 insertions, 4 deletions
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 {
14 const METHOD: &'static str = "rust-analyzer/analyzerStatus"; 14 const METHOD: &'static str = "rust-analyzer/analyzerStatus";
15} 15}
16 16
17pub enum CollectGarbage {} 17pub enum ReloadWorkspace {}
18 18
19impl Request for CollectGarbage { 19impl Request for ReloadWorkspace {
20 type Params = (); 20 type Params = ();
21 type Result = (); 21 type Result = ();
22 const METHOD: &'static str = "rust-analyzer/collectGarbage"; 22 const METHOD: &'static str = "rust-analyzer/reloadWorkspace";
23} 23}
24 24
25pub enum SyntaxTree {} 25pub 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 {
276 self.register_request(&req, request_received); 276 self.register_request(&req, request_received);
277 277
278 RequestDispatcher { req: Some(req), global_state: self } 278 RequestDispatcher { req: Some(req), global_state: self }
279 .on_sync::<lsp_ext::CollectGarbage>(|s, ()| Ok(s.analysis_host.collect_garbage()))? 279 .on_sync::<lsp_ext::ReloadWorkspace>(|s, ()| Ok(s.reload()))?
280 .on_sync::<lsp_ext::JoinLines>(|s, p| handlers::handle_join_lines(s.snapshot(), p))? 280 .on_sync::<lsp_ext::JoinLines>(|s, p| handlers::handle_join_lines(s.snapshot(), p))?
281 .on_sync::<lsp_ext::OnEnter>(|s, p| handlers::handle_on_enter(s.snapshot(), p))? 281 .on_sync::<lsp_ext::OnEnter>(|s, p| handlers::handle_on_enter(s.snapshot(), p))?
282 .on_sync::<lsp_types::request::Shutdown>(|_, ()| Ok(()))? 282 .on_sync::<lsp_types::request::Shutdown>(|_, ()| Ok(()))?