-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
A-flycheckissues with flycheck a.k.a. "check on save"issues with flycheck a.k.a. "check on save"C-bugCategory: bugCategory: bug
Description
While debugging my fumbles on flychecks I've found that flycheck is triggered two times on a single save, in a simple - with just a root package, like what generated by cargo new
- cargo workspace.
More preciesly,
rust-analyzer/crates/rust-analyzer/src/flycheck.rs
Lines 179 to 198 in 3d2c40d
/// Schedule a re-start of the cargo check worker to do a workspace wide check. | |
pub(crate) fn restart_workspace(&self, saved_file: Option<AbsPathBuf>) { | |
let generation = self.generation.fetch_add(1, Ordering::Relaxed) + 1; | |
self.sender | |
.send(StateChange::Restart { generation, package: None, saved_file, target: None }) | |
.unwrap(); | |
} | |
/// Schedule a re-start of the cargo check worker to do a package wide check. | |
pub(crate) fn restart_for_package(&self, package: String, target: Option<Target>) { | |
let generation = self.generation.fetch_add(1, Ordering::Relaxed) + 1; | |
self.sender | |
.send(StateChange::Restart { | |
generation, | |
package: Some(package), | |
saved_file: None, | |
target, | |
}) | |
.unwrap(); | |
} |
each of these two functions is called once.
Multiple triggering won't cause malfunctioning by itself as the previous one will be canceled by the later one, but ideally it should triggered only once.
Metadata
Metadata
Assignees
Labels
A-flycheckissues with flycheck a.k.a. "check on save"issues with flycheck a.k.a. "check on save"C-bugCategory: bugCategory: bug