Use crate root to choose relevant workspace for flycheck
This commit is contained in:
parent
4b33850c39
commit
5e370b1cb8
@ -74,7 +74,7 @@ pub struct ProjectJson {
|
|||||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||||
pub struct Crate {
|
pub struct Crate {
|
||||||
pub(crate) display_name: Option<CrateDisplayName>,
|
pub(crate) display_name: Option<CrateDisplayName>,
|
||||||
pub(crate) root_module: AbsPathBuf,
|
pub root_module: AbsPathBuf,
|
||||||
pub(crate) edition: Edition,
|
pub(crate) edition: Edition,
|
||||||
pub(crate) version: Option<String>,
|
pub(crate) version: Option<String>,
|
||||||
pub(crate) deps: Vec<Dependency>,
|
pub(crate) deps: Vec<Dependency>,
|
||||||
|
@ -296,10 +296,9 @@ fn run_flycheck(state: &mut GlobalState, vfs_path: VfsPath) -> bool {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
project_model::ProjectWorkspace::Json { project, .. } => {
|
project_model::ProjectWorkspace::Json { project, .. } => {
|
||||||
if !project
|
if !project.crates().any(|(_, krate)| {
|
||||||
.crates()
|
crate_root_paths.contains(&krate.root_module.as_path())
|
||||||
.any(|(c, _)| crate_ids.iter().any(|&crate_id| crate_id == c))
|
}) {
|
||||||
{
|
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
None
|
None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user