mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 21:13:37 +00:00
Use crate root to choose relevant workspace for flycheck
This commit is contained in:
parent
4b33850c39
commit
5e370b1cb8
2 changed files with 4 additions and 5 deletions
|
@ -74,7 +74,7 @@ pub struct ProjectJson {
|
|||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub struct Crate {
|
||||
pub(crate) display_name: Option<CrateDisplayName>,
|
||||
pub(crate) root_module: AbsPathBuf,
|
||||
pub root_module: AbsPathBuf,
|
||||
pub(crate) edition: Edition,
|
||||
pub(crate) version: Option<String>,
|
||||
pub(crate) deps: Vec<Dependency>,
|
||||
|
|
|
@ -296,10 +296,9 @@ fn run_flycheck(state: &mut GlobalState, vfs_path: VfsPath) -> bool {
|
|||
})
|
||||
}
|
||||
project_model::ProjectWorkspace::Json { project, .. } => {
|
||||
if !project
|
||||
.crates()
|
||||
.any(|(c, _)| crate_ids.iter().any(|&crate_id| crate_id == c))
|
||||
{
|
||||
if !project.crates().any(|(_, krate)| {
|
||||
crate_root_paths.contains(&krate.root_module.as_path())
|
||||
}) {
|
||||
return None;
|
||||
}
|
||||
None
|
||||
|
|
Loading…
Reference in a new issue