mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-27 20:35:09 +00:00
Merge #5070
5070: minor r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
8a96815d00
2 changed files with 6 additions and 7 deletions
|
@ -3,7 +3,7 @@
|
||||||
//!
|
//!
|
||||||
//! Each tick provides an immutable snapshot of the state as `WorldSnapshot`.
|
//! Each tick provides an immutable snapshot of the state as `WorldSnapshot`.
|
||||||
|
|
||||||
use std::sync::Arc;
|
use std::{sync::Arc, time::Instant};
|
||||||
|
|
||||||
use crossbeam_channel::{unbounded, Receiver, Sender};
|
use crossbeam_channel::{unbounded, Receiver, Sender};
|
||||||
use flycheck::FlycheckHandle;
|
use flycheck::FlycheckHandle;
|
||||||
|
@ -20,7 +20,7 @@ use crate::{
|
||||||
diagnostics::{CheckFixes, DiagnosticCollection},
|
diagnostics::{CheckFixes, DiagnosticCollection},
|
||||||
from_proto,
|
from_proto,
|
||||||
line_endings::LineEndings,
|
line_endings::LineEndings,
|
||||||
main_loop::{ReqQueue, Task},
|
main_loop::Task,
|
||||||
reload::SourceRootConfig,
|
reload::SourceRootConfig,
|
||||||
request_metrics::{LatestRequests, RequestMetrics},
|
request_metrics::{LatestRequests, RequestMetrics},
|
||||||
show_message,
|
show_message,
|
||||||
|
@ -48,6 +48,9 @@ pub(crate) struct Handle<H, C> {
|
||||||
pub(crate) receiver: C,
|
pub(crate) receiver: C,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub(crate) type ReqHandler = fn(&mut GlobalState, lsp_server::Response);
|
||||||
|
pub(crate) type ReqQueue = lsp_server::ReqQueue<(String, Instant), ReqHandler>;
|
||||||
|
|
||||||
/// `GlobalState` is the primary mutable state of the language server
|
/// `GlobalState` is the primary mutable state of the language server
|
||||||
///
|
///
|
||||||
/// The most interesting components are `vfs`, which stores a consistent
|
/// The most interesting components are `vfs`, which stores a consistent
|
||||||
|
|
|
@ -468,10 +468,6 @@ impl GlobalState {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) type ReqHandler = fn(&mut GlobalState, Response);
|
|
||||||
pub(crate) type ReqQueue = lsp_server::ReqQueue<(String, Instant), ReqHandler>;
|
|
||||||
const DO_NOTHING: ReqHandler = |_, _| ();
|
|
||||||
|
|
||||||
#[derive(Eq, PartialEq)]
|
#[derive(Eq, PartialEq)]
|
||||||
enum Progress {
|
enum Progress {
|
||||||
Begin,
|
Begin,
|
||||||
|
@ -499,7 +495,7 @@ fn report_progress(
|
||||||
let work_done_progress_create = global_state.req_queue.outgoing.register(
|
let work_done_progress_create = global_state.req_queue.outgoing.register(
|
||||||
lsp_types::request::WorkDoneProgressCreate::METHOD.to_string(),
|
lsp_types::request::WorkDoneProgressCreate::METHOD.to_string(),
|
||||||
lsp_types::WorkDoneProgressCreateParams { token: token.clone() },
|
lsp_types::WorkDoneProgressCreateParams { token: token.clone() },
|
||||||
DO_NOTHING,
|
|_, _| (),
|
||||||
);
|
);
|
||||||
global_state.send(work_done_progress_create.into());
|
global_state.send(work_done_progress_create.into());
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue