aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-06-26 16:18:04 +0100
committerGitHub <[email protected]>2020-06-26 16:18:04 +0100
commita0a475546b6f50644a1fa2a1e8586afde1ec82eb (patch)
treeabbe3d967b675f15b1917946f3b10bcfea754891 /crates
parentd86a2426a21b8e0dddaeffcdd9e153cd909a65f8 (diff)
parentde7b2482274df76d3acece3cc8c1388a77e76e09 (diff)
Merge #5078
5078: Minor r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
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,