Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions crates/rust-analyzer/src/main_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,13 +348,7 @@ impl GlobalState {
}

if self.status == Status::Ready && (state_changed || prev_status == Status::Loading) {
let subscriptions = self
.mem_docs
.keys()
.map(|path| self.vfs.read().0.file_id(&path).unwrap())
.collect::<Vec<_>>();

self.update_file_notifications_on_threadpool(subscriptions);
self.update_file_notifications_on_threadpool();

// Refresh semantic tokens if the client supports it.
if self.config.semantic_tokens_refresh {
Expand Down Expand Up @@ -498,6 +492,7 @@ impl GlobalState {
.write()
.0
.set_file_contents(path, Some(params.text_document.text.into_bytes()));
this.update_file_notifications_on_threadpool();
}
Ok(())
})?
Expand Down Expand Up @@ -606,7 +601,13 @@ impl GlobalState {
.finish();
Ok(())
}
fn update_file_notifications_on_threadpool(&mut self, subscriptions: Vec<FileId>) {
fn update_file_notifications_on_threadpool(&mut self) {
let subscriptions = self
.mem_docs
.keys()
.map(|path| self.vfs.read().0.file_id(&path).unwrap())
.collect::<Vec<_>>();

log::trace!("updating notifications for {:?}", subscriptions);
if self.config.publish_diagnostics {
let snapshot = self.snapshot();
Expand Down