aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/rust-analyzer/src/global_state.rs5
-rw-r--r--crates/rust-analyzer/src/lsp_utils.rs9
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;
12use ra_db::{CrateId, VfsPath}; 12use ra_db::{CrateId, VfsPath};
13use ra_ide::{Analysis, AnalysisChange, AnalysisHost, FileId}; 13use ra_ide::{Analysis, AnalysisChange, AnalysisHost, FileId};
14use ra_project_model::{CargoWorkspace, ProcMacroClient, ProjectWorkspace, Target}; 14use ra_project_model::{CargoWorkspace, ProcMacroClient, ProjectWorkspace, Target};
15use rustc_hash::{FxHashMap, FxHashSet};
15 16
16use crate::{ 17use 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};
29use rustc_hash::{FxHashMap, FxHashSet};
30 29
31#[derive(Eq, PartialEq)] 30#[derive(Eq, PartialEq)]
32pub(crate) enum Status { 31pub(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};
4use lsp_server::Notification; 4use lsp_server::Notification;
5use ra_db::Canceled; 5use ra_db::Canceled;
6use ra_ide::LineIndex; 6use ra_ide::LineIndex;
7use serde::Serialize;
8 7
9use crate::{from_proto, global_state::GlobalState}; 8use 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
21pub(crate) fn notification_new<N>(params: N::Params) -> Notification
22where
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)]
30pub(crate) enum Progress { 21pub(crate) enum Progress {
31 Begin, 22 Begin,