Skip to content

Commit 45ef459

Browse files
committed
Address code review
1 parent 9160639 commit 45ef459

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

crates/ark/src/lsp/main_loop.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,6 @@ impl GlobalState {
372372
// handlers that mutate those still refresh explicitly.
373373
let old_revision = salsa::plumbing::current_revision(&self.world.db);
374374

375-
lsp::log_info!("Processing next event");
376-
377375
match event {
378376
Event::Lsp(msg) => match msg {
379377
LspMessage::Notification(notif) => {
@@ -993,17 +991,14 @@ static DIAGNOSTICS_QUEUE: LazyLock<tokio::sync::mpsc::UnboundedSender<RefreshDia
993991
/// newer one and publish last, leaving diagnostics computed from the older
994992
/// console scopes or config until the next refresh.
995993
async fn process_diagnostics_queue(mut rx: mpsc::UnboundedReceiver<RefreshDiagnosticsTask>) {
996-
loop {
997-
let Some(task) = rx.recv().await else {
998-
lsp::log_warn!("process_diagnostics_queue: channel closed, task exiting");
999-
return;
1000-
};
994+
while let Some(task) = rx.recv().await {
1001995
let mut batch = vec![task];
1002996
while let Ok(task) = rx.try_recv() {
1003997
batch.push(task);
1004998
}
1005999
process_diagnostics_batch(batch);
10061000
}
1001+
lsp::log_warn!("process_diagnostics_queue: channel closed, task exiting");
10071002
}
10081003

10091004
fn process_diagnostics_batch(batch: Vec<RefreshDiagnosticsTask>) {

0 commit comments

Comments
 (0)