mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 21:43:37 +00:00
Merge pull request #18741 from Veykril/push-nuqmzsrrltux
fix: Delay initial flycheck until after build scripts
This commit is contained in:
commit
68acbb2019
3 changed files with 12 additions and 6 deletions
|
@ -92,7 +92,7 @@ pub(crate) struct GlobalState {
|
||||||
|
|
||||||
// status
|
// status
|
||||||
pub(crate) shutdown_requested: bool,
|
pub(crate) shutdown_requested: bool,
|
||||||
pub(crate) last_reported_status: Option<lsp_ext::ServerStatusParams>,
|
pub(crate) last_reported_status: lsp_ext::ServerStatusParams,
|
||||||
|
|
||||||
// proc macros
|
// proc macros
|
||||||
pub(crate) proc_macro_clients: Arc<[anyhow::Result<ProcMacroServer>]>,
|
pub(crate) proc_macro_clients: Arc<[anyhow::Result<ProcMacroServer>]>,
|
||||||
|
@ -238,7 +238,11 @@ 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,
|
||||||
last_reported_status: None,
|
last_reported_status: lsp_ext::ServerStatusParams {
|
||||||
|
health: lsp_ext::Health::Ok,
|
||||||
|
quiescent: true,
|
||||||
|
message: None,
|
||||||
|
},
|
||||||
source_root_config: SourceRootConfig::default(),
|
source_root_config: SourceRootConfig::default(),
|
||||||
local_roots_parent_map: Arc::new(FxHashMap::default()),
|
local_roots_parent_map: Arc::new(FxHashMap::default()),
|
||||||
config_errors: Default::default(),
|
config_errors: Default::default(),
|
||||||
|
|
|
@ -408,7 +408,10 @@ impl GlobalState {
|
||||||
if self.is_quiescent() {
|
if self.is_quiescent() {
|
||||||
let became_quiescent = !was_quiescent;
|
let became_quiescent = !was_quiescent;
|
||||||
if became_quiescent {
|
if became_quiescent {
|
||||||
if self.config.check_on_save(None) && self.config.flycheck_workspace(None) {
|
if self.config.check_on_save(None)
|
||||||
|
&& self.config.flycheck_workspace(None)
|
||||||
|
&& !self.fetch_build_data_queue.op_requested()
|
||||||
|
{
|
||||||
// Project has loaded properly, kick off initial flycheck
|
// Project has loaded properly, kick off initial flycheck
|
||||||
self.flycheck.iter().for_each(|flycheck| flycheck.restart_workspace(None));
|
self.flycheck.iter().for_each(|flycheck| flycheck.restart_workspace(None));
|
||||||
}
|
}
|
||||||
|
@ -656,8 +659,8 @@ impl GlobalState {
|
||||||
|
|
||||||
fn update_status_or_notify(&mut self) {
|
fn update_status_or_notify(&mut self) {
|
||||||
let status = self.current_status();
|
let status = self.current_status();
|
||||||
if self.last_reported_status.as_ref() != Some(&status) {
|
if self.last_reported_status != status {
|
||||||
self.last_reported_status = Some(status.clone());
|
self.last_reported_status = status.clone();
|
||||||
|
|
||||||
if self.config.server_status_notification() {
|
if self.config.server_status_notification() {
|
||||||
self.send_notification::<lsp_ext::ServerStatusNotification>(status);
|
self.send_notification::<lsp_ext::ServerStatusNotification>(status);
|
||||||
|
|
|
@ -70,7 +70,6 @@ impl GlobalState {
|
||||||
/// are ready to do semantic work.
|
/// are ready to do semantic work.
|
||||||
pub(crate) fn is_quiescent(&self) -> bool {
|
pub(crate) fn is_quiescent(&self) -> bool {
|
||||||
self.vfs_done
|
self.vfs_done
|
||||||
&& self.last_reported_status.is_some()
|
|
||||||
&& !self.fetch_workspaces_queue.op_in_progress()
|
&& !self.fetch_workspaces_queue.op_in_progress()
|
||||||
&& !self.fetch_build_data_queue.op_in_progress()
|
&& !self.fetch_build_data_queue.op_in_progress()
|
||||||
&& !self.fetch_proc_macros_queue.op_in_progress()
|
&& !self.fetch_proc_macros_queue.op_in_progress()
|
||||||
|
|
Loading…
Reference in a new issue