diff options
-rw-r--r-- | crates/rust-analyzer/src/global_state.rs | 5 | ||||
-rw-r--r-- | crates/rust-analyzer/src/lsp_utils.rs | 9 |
2 files changed, 2 insertions, 12 deletions
diff --git a/crates/rust-analyzer/src/global_state.rs b/crates/rust-analyzer/src/global_state.rs index d1a161c1a..cadc8a129 100644 --- a/crates/rust-analyzer/src/global_state.rs +++ b/crates/rust-analyzer/src/global_state.rs | |||
@@ -12,13 +12,13 @@ use parking_lot::RwLock; | |||
12 | use ra_db::{CrateId, VfsPath}; | 12 | use ra_db::{CrateId, VfsPath}; |
13 | use ra_ide::{Analysis, AnalysisChange, AnalysisHost, FileId}; | 13 | use ra_ide::{Analysis, AnalysisChange, AnalysisHost, FileId}; |
14 | use ra_project_model::{CargoWorkspace, ProcMacroClient, ProjectWorkspace, Target}; | 14 | use ra_project_model::{CargoWorkspace, ProcMacroClient, ProjectWorkspace, Target}; |
15 | use rustc_hash::{FxHashMap, FxHashSet}; | ||
15 | 16 | ||
16 | use crate::{ | 17 | use crate::{ |
17 | config::Config, | 18 | config::Config, |
18 | diagnostics::{CheckFixes, DiagnosticCollection}, | 19 | diagnostics::{CheckFixes, DiagnosticCollection}, |
19 | from_proto, | 20 | from_proto, |
20 | line_endings::LineEndings, | 21 | line_endings::LineEndings, |
21 | lsp_utils::notification_new, | ||
22 | main_loop::Task, | 22 | main_loop::Task, |
23 | reload::SourceRootConfig, | 23 | reload::SourceRootConfig, |
24 | request_metrics::{LatestRequests, RequestMetrics}, | 24 | request_metrics::{LatestRequests, RequestMetrics}, |
@@ -26,7 +26,6 @@ use crate::{ | |||
26 | to_proto::url_from_abs_path, | 26 | to_proto::url_from_abs_path, |
27 | Result, | 27 | Result, |
28 | }; | 28 | }; |
29 | use rustc_hash::{FxHashMap, FxHashSet}; | ||
30 | 29 | ||
31 | #[derive(Eq, PartialEq)] | 30 | #[derive(Eq, PartialEq)] |
32 | pub(crate) enum Status { | 31 | pub(crate) enum Status { |
@@ -190,7 +189,7 @@ impl GlobalState { | |||
190 | &mut self, | 189 | &mut self, |
191 | params: N::Params, | 190 | params: N::Params, |
192 | ) { | 191 | ) { |
193 | let not = notification_new::<N>(params); | 192 | let not = lsp_server::Notification::new(N::METHOD.to_string(), params); |
194 | self.send(not.into()); | 193 | self.send(not.into()); |
195 | } | 194 | } |
196 | 195 | ||
diff --git a/crates/rust-analyzer/src/lsp_utils.rs b/crates/rust-analyzer/src/lsp_utils.rs index 99f4998a9..0bc3ff115 100644 --- a/crates/rust-analyzer/src/lsp_utils.rs +++ b/crates/rust-analyzer/src/lsp_utils.rs | |||
@@ -4,7 +4,6 @@ use std::{error::Error, ops::Range}; | |||
4 | use lsp_server::Notification; | 4 | use lsp_server::Notification; |
5 | use ra_db::Canceled; | 5 | use ra_db::Canceled; |
6 | use ra_ide::LineIndex; | 6 | use ra_ide::LineIndex; |
7 | use serde::Serialize; | ||
8 | 7 | ||
9 | use crate::{from_proto, global_state::GlobalState}; | 8 | use crate::{from_proto, global_state::GlobalState}; |
10 | 9 | ||
@@ -18,14 +17,6 @@ pub(crate) fn notification_is<N: lsp_types::notification::Notification>( | |||
18 | notification.method == N::METHOD | 17 | notification.method == N::METHOD |
19 | } | 18 | } |
20 | 19 | ||
21 | pub(crate) fn notification_new<N>(params: N::Params) -> Notification | ||
22 | where | ||
23 | N: lsp_types::notification::Notification, | ||
24 | N::Params: Serialize, | ||
25 | { | ||
26 | Notification::new(N::METHOD.to_string(), params) | ||
27 | } | ||
28 | |||
29 | #[derive(Debug, Eq, PartialEq)] | 20 | #[derive(Debug, Eq, PartialEq)] |
30 | pub(crate) enum Progress { | 21 | pub(crate) enum Progress { |
31 | Begin, | 22 | Begin, |