mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Minor
This commit is contained in:
parent
9d15e8fc4f
commit
de7b248227
2 changed files with 2 additions and 12 deletions
|
@ -12,13 +12,13 @@ use parking_lot::RwLock;
|
||||||
use ra_db::{CrateId, VfsPath};
|
use ra_db::{CrateId, VfsPath};
|
||||||
use ra_ide::{Analysis, AnalysisChange, AnalysisHost, FileId};
|
use ra_ide::{Analysis, AnalysisChange, AnalysisHost, FileId};
|
||||||
use ra_project_model::{CargoWorkspace, ProcMacroClient, ProjectWorkspace, Target};
|
use ra_project_model::{CargoWorkspace, ProcMacroClient, ProjectWorkspace, Target};
|
||||||
|
use rustc_hash::{FxHashMap, FxHashSet};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
config::Config,
|
config::Config,
|
||||||
diagnostics::{CheckFixes, DiagnosticCollection},
|
diagnostics::{CheckFixes, DiagnosticCollection},
|
||||||
from_proto,
|
from_proto,
|
||||||
line_endings::LineEndings,
|
line_endings::LineEndings,
|
||||||
lsp_utils::notification_new,
|
|
||||||
main_loop::Task,
|
main_loop::Task,
|
||||||
reload::SourceRootConfig,
|
reload::SourceRootConfig,
|
||||||
request_metrics::{LatestRequests, RequestMetrics},
|
request_metrics::{LatestRequests, RequestMetrics},
|
||||||
|
@ -26,7 +26,6 @@ use crate::{
|
||||||
to_proto::url_from_abs_path,
|
to_proto::url_from_abs_path,
|
||||||
Result,
|
Result,
|
||||||
};
|
};
|
||||||
use rustc_hash::{FxHashMap, FxHashSet};
|
|
||||||
|
|
||||||
#[derive(Eq, PartialEq)]
|
#[derive(Eq, PartialEq)]
|
||||||
pub(crate) enum Status {
|
pub(crate) enum Status {
|
||||||
|
@ -190,7 +189,7 @@ impl GlobalState {
|
||||||
&mut self,
|
&mut self,
|
||||||
params: N::Params,
|
params: N::Params,
|
||||||
) {
|
) {
|
||||||
let not = notification_new::<N>(params);
|
let not = lsp_server::Notification::new(N::METHOD.to_string(), params);
|
||||||
self.send(not.into());
|
self.send(not.into());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ use std::{error::Error, ops::Range};
|
||||||
use lsp_server::Notification;
|
use lsp_server::Notification;
|
||||||
use ra_db::Canceled;
|
use ra_db::Canceled;
|
||||||
use ra_ide::LineIndex;
|
use ra_ide::LineIndex;
|
||||||
use serde::Serialize;
|
|
||||||
|
|
||||||
use crate::{from_proto, global_state::GlobalState};
|
use crate::{from_proto, global_state::GlobalState};
|
||||||
|
|
||||||
|
@ -18,14 +17,6 @@ pub(crate) fn notification_is<N: lsp_types::notification::Notification>(
|
||||||
notification.method == N::METHOD
|
notification.method == N::METHOD
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn notification_new<N>(params: N::Params) -> Notification
|
|
||||||
where
|
|
||||||
N: lsp_types::notification::Notification,
|
|
||||||
N::Params: Serialize,
|
|
||||||
{
|
|
||||||
Notification::new(N::METHOD.to_string(), params)
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Eq, PartialEq)]
|
#[derive(Debug, Eq, PartialEq)]
|
||||||
pub(crate) enum Progress {
|
pub(crate) enum Progress {
|
||||||
Begin,
|
Begin,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue