mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-29 06:23:25 +00:00
internal: Remove unnecessay GlobalState::send_hint_refresh_query
field
This commit is contained in:
parent
d80df712e7
commit
a37c7208b0
2 changed files with 7 additions and 15 deletions
|
@ -72,7 +72,6 @@ pub(crate) struct GlobalState {
|
||||||
|
|
||||||
// status
|
// status
|
||||||
pub(crate) shutdown_requested: bool,
|
pub(crate) shutdown_requested: bool,
|
||||||
pub(crate) send_hint_refresh_query: bool,
|
|
||||||
pub(crate) last_reported_status: Option<lsp_ext::ServerStatusParams>,
|
pub(crate) last_reported_status: Option<lsp_ext::ServerStatusParams>,
|
||||||
|
|
||||||
// proc macros
|
// proc macros
|
||||||
|
@ -207,7 +206,6 @@ impl GlobalState {
|
||||||
mem_docs: MemDocs::default(),
|
mem_docs: MemDocs::default(),
|
||||||
semantic_tokens_cache: Arc::new(Default::default()),
|
semantic_tokens_cache: Arc::new(Default::default()),
|
||||||
shutdown_requested: false,
|
shutdown_requested: false,
|
||||||
send_hint_refresh_query: false,
|
|
||||||
last_reported_status: None,
|
last_reported_status: None,
|
||||||
source_root_config: SourceRootConfig::default(),
|
source_root_config: SourceRootConfig::default(),
|
||||||
local_roots_parent_map: FxHashMap::default(),
|
local_roots_parent_map: FxHashMap::default(),
|
||||||
|
|
|
@ -348,11 +348,7 @@ impl GlobalState {
|
||||||
let memdocs_added_or_removed = self.mem_docs.take_changes();
|
let memdocs_added_or_removed = self.mem_docs.take_changes();
|
||||||
|
|
||||||
if self.is_quiescent() {
|
if self.is_quiescent() {
|
||||||
let became_quiescent = !(was_quiescent
|
let became_quiescent = !was_quiescent;
|
||||||
|| self.fetch_workspaces_queue.op_requested()
|
|
||||||
|| self.fetch_build_data_queue.op_requested()
|
|
||||||
|| self.fetch_proc_macros_queue.op_requested());
|
|
||||||
|
|
||||||
if became_quiescent {
|
if became_quiescent {
|
||||||
if self.config.check_on_save() {
|
if self.config.check_on_save() {
|
||||||
// Project has loaded properly, kick off initial flycheck
|
// Project has loaded properly, kick off initial flycheck
|
||||||
|
@ -363,7 +359,7 @@ impl GlobalState {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let client_refresh = !was_quiescent || state_changed;
|
let client_refresh = became_quiescent || state_changed;
|
||||||
if client_refresh {
|
if client_refresh {
|
||||||
// Refresh semantic tokens if the client supports it.
|
// Refresh semantic tokens if the client supports it.
|
||||||
if self.config.semantic_tokens_refresh() {
|
if self.config.semantic_tokens_refresh() {
|
||||||
|
@ -377,17 +373,17 @@ impl GlobalState {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Refresh inlay hints if the client supports it.
|
// Refresh inlay hints if the client supports it.
|
||||||
if self.send_hint_refresh_query && self.config.inlay_hints_refresh() {
|
if self.config.inlay_hints_refresh() {
|
||||||
self.send_request::<lsp_types::request::InlayHintRefreshRequest>((), |_, _| ());
|
self.send_request::<lsp_types::request::InlayHintRefreshRequest>((), |_, _| ());
|
||||||
self.send_hint_refresh_query = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let things_changed = !was_quiescent || state_changed || memdocs_added_or_removed;
|
let project_or_mem_docs_changed =
|
||||||
if things_changed && self.config.publish_diagnostics() {
|
became_quiescent || state_changed || memdocs_added_or_removed;
|
||||||
|
if project_or_mem_docs_changed && self.config.publish_diagnostics() {
|
||||||
self.update_diagnostics();
|
self.update_diagnostics();
|
||||||
}
|
}
|
||||||
if things_changed && self.config.test_explorer() {
|
if project_or_mem_docs_changed && self.config.test_explorer() {
|
||||||
self.update_tests();
|
self.update_tests();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -641,7 +637,6 @@ impl GlobalState {
|
||||||
}
|
}
|
||||||
|
|
||||||
self.switch_workspaces("fetched build data".to_owned());
|
self.switch_workspaces("fetched build data".to_owned());
|
||||||
self.send_hint_refresh_query = true;
|
|
||||||
|
|
||||||
(Some(Progress::End), None)
|
(Some(Progress::End), None)
|
||||||
}
|
}
|
||||||
|
@ -658,7 +653,6 @@ impl GlobalState {
|
||||||
ProcMacroProgress::End(proc_macro_load_result) => {
|
ProcMacroProgress::End(proc_macro_load_result) => {
|
||||||
self.fetch_proc_macros_queue.op_completed(true);
|
self.fetch_proc_macros_queue.op_completed(true);
|
||||||
self.set_proc_macros(proc_macro_load_result);
|
self.set_proc_macros(proc_macro_load_result);
|
||||||
self.send_hint_refresh_query = true;
|
|
||||||
(Some(Progress::End), None)
|
(Some(Progress::End), None)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue