Merge #5501
5501: minor r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
085891d885
@ -97,22 +97,6 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
}
|
||||
|
||||
impl GlobalState {
|
||||
fn next_event(&self, inbox: &Receiver<lsp_server::Message>) -> Option<Event> {
|
||||
select! {
|
||||
recv(inbox) -> msg =>
|
||||
msg.ok().map(Event::Lsp),
|
||||
|
||||
recv(self.task_pool.receiver) -> task =>
|
||||
Some(Event::Task(task.unwrap())),
|
||||
|
||||
recv(self.loader.receiver) -> task =>
|
||||
Some(Event::Vfs(task.unwrap())),
|
||||
|
||||
recv(self.flycheck_receiver) -> task =>
|
||||
Some(Event::Flycheck(task.unwrap())),
|
||||
}
|
||||
}
|
||||
|
||||
fn run(mut self, inbox: Receiver<lsp_server::Message>) -> Result<()> {
|
||||
if self.config.linked_projects.is_empty() && self.config.notifications.cargo_toml_not_found
|
||||
{
|
||||
@ -169,6 +153,22 @@ fn run(mut self, inbox: Receiver<lsp_server::Message>) -> Result<()> {
|
||||
Err("client exited without proper shutdown sequence")?
|
||||
}
|
||||
|
||||
fn next_event(&self, inbox: &Receiver<lsp_server::Message>) -> Option<Event> {
|
||||
select! {
|
||||
recv(inbox) -> msg =>
|
||||
msg.ok().map(Event::Lsp),
|
||||
|
||||
recv(self.task_pool.receiver) -> task =>
|
||||
Some(Event::Task(task.unwrap())),
|
||||
|
||||
recv(self.loader.receiver) -> task =>
|
||||
Some(Event::Vfs(task.unwrap())),
|
||||
|
||||
recv(self.flycheck_receiver) -> task =>
|
||||
Some(Event::Flycheck(task.unwrap())),
|
||||
}
|
||||
}
|
||||
|
||||
fn handle_event(&mut self, event: Event) -> Result<()> {
|
||||
let loop_start = Instant::now();
|
||||
// NOTE: don't count blocking select! call as a loop-turn time
|
||||
|
Loading…
Reference in New Issue
Block a user