Skip to content

Commit 5e370b1

Browse files
committed
Use crate root to choose relevant workspace for flycheck
1 parent 4b33850 commit 5e370b1

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

crates/project-model/src/project_json.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pub struct ProjectJson {
7474
#[derive(Clone, Debug, Eq, PartialEq)]
7575
pub struct Crate {
7676
pub(crate) display_name: Option<CrateDisplayName>,
77-
pub(crate) root_module: AbsPathBuf,
77+
pub root_module: AbsPathBuf,
7878
pub(crate) edition: Edition,
7979
pub(crate) version: Option<String>,
8080
pub(crate) deps: Vec<Dependency>,

crates/rust-analyzer/src/handlers/notification.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,9 @@ fn run_flycheck(state: &mut GlobalState, vfs_path: VfsPath) -> bool {
296296
})
297297
}
298298
project_model::ProjectWorkspace::Json { project, .. } => {
299-
if !project
300-
.crates()
301-
.any(|(c, _)| crate_ids.iter().any(|&crate_id| crate_id == c))
302-
{
299+
if !project.crates().any(|(_, krate)| {
300+
crate_root_paths.contains(&krate.root_module.as_path())
301+
}) {
303302
return None;
304303
}
305304
None

0 commit comments

Comments
 (0)