mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-18 03:13:31 +00:00
Make rust-analyzer.files.excludeDirs work, actually
I have no idea what the original writer of the code thought but the logic just seems backwards. We should not exclude a file/directory if it is equal to an include! This also meant that we had to add a `root == path` check so this stuff will actually work, which in turn meant excludes (of root files) no longer worked... Also rename if to `rust-analyzer.files.exclude`, because it can exclude files as well.
This commit is contained in:
parent
0fd4fc3522
commit
ac6b054ca5
5 changed files with 46 additions and 11 deletions
|
|
@ -280,8 +280,9 @@ impl NotifyActor {
|
|||
return false;
|
||||
}
|
||||
|
||||
root == path
|
||||
|| dirs.exclude.iter().chain(&dirs.include).all(|it| it != path)
|
||||
// We want to filter out subdirectories that are roots themselves, because they will be visited separately.
|
||||
dirs.exclude.iter().all(|it| it != path)
|
||||
&& (root == path || dirs.include.iter().all(|it| it != path))
|
||||
});
|
||||
|
||||
let files = walkdir.filter_map(|it| it.ok()).filter_map(|entry| {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue