Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions crates/rust-analyzer/src/global_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ pub(crate) struct GlobalState {

// status
pub(crate) shutdown_requested: bool,
pub(crate) send_hint_refresh_query: bool,
pub(crate) last_reported_status: Option<lsp_ext::ServerStatusParams>,

// proc macros
Expand Down Expand Up @@ -177,6 +178,7 @@ impl GlobalState {
mem_docs: MemDocs::default(),
semantic_tokens_cache: Arc::new(Default::default()),
shutdown_requested: false,
send_hint_refresh_query: false,
last_reported_status: None,
source_root_config: SourceRootConfig::default(),
config_errors: Default::default(),
Expand Down
8 changes: 6 additions & 2 deletions crates/rust-analyzer/src/main_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,11 @@ impl GlobalState {
}

// Refresh inlay hints if the client supports it.
if self.config.inlay_hints_refresh() {
if (self.send_hint_refresh_query || self.proc_macro_changed)
&& self.config.inlay_hints_refresh()
{
self.send_request::<lsp_types::request::InlayHintRefreshRequest>((), |_, _| ());
self.send_hint_refresh_query = false;
}
}

Expand Down Expand Up @@ -509,6 +512,7 @@ impl GlobalState {
}

self.switch_workspaces("fetched build data".to_string());
self.send_hint_refresh_query = true;

(Some(Progress::End), None)
}
Expand All @@ -525,7 +529,7 @@ impl GlobalState {
ProcMacroProgress::End(proc_macro_load_result) => {
self.fetch_proc_macros_queue.op_completed(true);
self.set_proc_macros(proc_macro_load_result);

self.send_hint_refresh_query = true;
(Some(Progress::End), None)
}
};
Expand Down