Skip to content

Commit c245459

Browse files
authored
Merge pull request #19293 from github/redsun82/rust-fix-member-aggregation
Rust: fix workspace member aggregation when absolute path is a glob pattern
2 parents 884c4a6 + 60aa3a8 commit c245459

27 files changed

+5
-3
lines changed

rust/extractor/src/rust_analyzer.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,10 @@ impl TomlReader {
173173
}
174174

175175
fn workspace_members_match(workspace_dir: &AbsPath, members: &[String], target: &AbsPath) -> bool {
176-
members.iter().any(|p| {
177-
glob::Pattern::new(workspace_dir.join(p).as_str()).is_ok_and(|p| p.matches(target.as_str()))
176+
target.strip_prefix(workspace_dir).is_some_and(|rel_path| {
177+
members
178+
.iter()
179+
.any(|p| glob::Pattern::new(p).is_ok_and(|p| p.matches(rel_path.as_str())))
178180
})
179181
}
180182

rust/ql/integration-tests/hello-workspace/rust-project.json renamed to rust/ql/integration-tests/hello-[workspace]/rust-project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
"deps": []
2222
}
2323
]
24-
}
24+
}

0 commit comments

Comments
 (0)