diff options
author | Aleksey Kladov <[email protected]> | 2020-06-26 16:07:14 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-06-26 16:07:14 +0100 |
commit | 9d15e8fc4f875f6da2cd2bd89c62bb96fa64ef1b (patch) | |
tree | 8d782ee4c736b57c8eaab0e65ee9746c3880a4e4 /crates/rust-analyzer/src/reload.rs | |
parent | 1893289e5c7cebeeb9705c031c996fc29d8c5b54 (diff) |
Type safer requests
Diffstat (limited to 'crates/rust-analyzer/src/reload.rs')
-rw-r--r-- | crates/rust-analyzer/src/reload.rs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/crates/rust-analyzer/src/reload.rs b/crates/rust-analyzer/src/reload.rs index fece6176e..a1850b286 100644 --- a/crates/rust-analyzer/src/reload.rs +++ b/crates/rust-analyzer/src/reload.rs | |||
@@ -3,7 +3,6 @@ use std::sync::Arc; | |||
3 | 3 | ||
4 | use crossbeam_channel::unbounded; | 4 | use crossbeam_channel::unbounded; |
5 | use flycheck::FlycheckHandle; | 5 | use flycheck::FlycheckHandle; |
6 | use lsp_types::request::Request; | ||
7 | use ra_db::{CrateGraph, SourceRoot, VfsPath}; | 6 | use ra_db::{CrateGraph, SourceRoot, VfsPath}; |
8 | use ra_ide::AnalysisChange; | 7 | use ra_ide::AnalysisChange; |
9 | use ra_project_model::{PackageRoot, ProcMacroClient, ProjectWorkspace}; | 8 | use ra_project_model::{PackageRoot, ProcMacroClient, ProjectWorkspace}; |
@@ -78,13 +77,10 @@ impl GlobalState { | |||
78 | method: "workspace/didChangeWatchedFiles".to_string(), | 77 | method: "workspace/didChangeWatchedFiles".to_string(), |
79 | register_options: Some(serde_json::to_value(registration_options).unwrap()), | 78 | register_options: Some(serde_json::to_value(registration_options).unwrap()), |
80 | }; | 79 | }; |
81 | let params = lsp_types::RegistrationParams { registrations: vec![registration] }; | 80 | self.send_request::<lsp_types::request::RegisterCapability>( |
82 | let request = self.req_queue.outgoing.register( | 81 | lsp_types::RegistrationParams { registrations: vec![registration] }, |
83 | lsp_types::request::RegisterCapability::METHOD.to_string(), | ||
84 | params, | ||
85 | |_, _| (), | 82 | |_, _| (), |
86 | ); | 83 | ); |
87 | self.send(request.into()); | ||
88 | } | 84 | } |
89 | 85 | ||
90 | let mut change = AnalysisChange::new(); | 86 | let mut change = AnalysisChange::new(); |