-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rust-analyzer.files.excludeDirs is not working #7755
Comments
Some pointers to code: (I wonder if the above piece of code should handle And the place where actual exclusion is happening: To fix this, I'd start with making a minimal example where we don't exclude things, and then adding |
Doesn't work also for me; the documentation doesn't say much, so I'm not sure if I need to set the value in a specific way. My project layout is:
inside This is the related setting:
I think it should work, because that's the standard VSC definition. I've tried alternatives, but I couldn't find any way to exclude it. |
Not that I don't believe you, but can you say how you are testing? I'm asking because we set these up in a couple of places (file change notifications, file saves and something else too -- project load?). matklad's comment above about not handling exclusions seems relevant. That's the file watcher registration. |
Hello! Thanks :) Let me create the simplest test case and I'll get back (tomorrow or the day after); hopefully, simplifying the current project will show more clearly where the problem is. |
It seems to be a more complex problem. What I'm observing is (with the directory excluded):
If I change the file with a change that is reverted by the autoformatter (e.g. add a space after the terminal |
Hello! Here's a minimal test case: cargo new mytest2
cd mytest2
mkdir excl
echo abc > excl/abc.rs
mkdir .vscode
cat > .vscode/settings.json << 'JSON'
{
"rust-analyzer.files.excludeDirs": [
"**/excl"
]
}
JSON
# after the first command, switch back to the terminal
code .
code excl/abc.rs
# now, in VSC, abc.rs shows the error |
I have the same issue. I have a EDIT: the file is ignored as long as it is not open in the editor. |
I saw reference to globs in rust-lang#7755, but it doesn't look like they're actually supported, and I had to dig through the source to discover that the folders are relative to the workspace root. Further digging was required to get VS Code from hanging for long periods trying to watch giant Bazel folders that had already been excluded from Rust Analyzer. Hopefully this tweak will save others the confusion :-)
I saw reference to globs in rust-lang#7755, but it doesn't look like they're actually supported, and I had to dig through the source to discover that the folders are relative to the workspace root. Further digging was required to get VS Code from hanging for long periods trying to watch giant Bazel folders that had already been excluded from Rust Analyzer. Hopefully this tweak will save others the confusion :-)
9634: minor update to excludeDirs doc r=lnicola a=dae I saw reference to globs in #7755, but it doesn't look like they're actually supported, and I had to dig through the source to discover that the folders are relative to the workspace root. Further digging was required to get VS Code from hanging for long periods trying to watch giant Bazel folders that had already been excluded from Rust Analyzer. Hopefully this tweak will save others the confusion :-) Co-authored-by: Damien Elmes <gpg@ankiweb.net> Co-authored-by: Damien Elmes <dae@users.noreply.github.com>
Any update? |
@yukitaka13-1110 My understanding is someone still needs to investigate why this doesn't work: #7755 (comment) |
Seems to be especially relevant when developing Flatpak applications: see #8161. |
Still dealing with this... still no way to do this? Also trying to work with flatpaks and makes autocompletion just not exist. |
@polyjitter Do you use -- A snippet from my Neovim config
-- <...>
server = {
standalone = false,
settings = {
["rust-analyzer"] = {
files = {
excludeDirs = { ".flatpak-builder" }
},
-- <...>
},
}
},
-- <...> |
Unfortunately this didn't seem to help. I added
.rustwide
and.rustwide-docker
torust-analyzer.files.excludeDirs
and reloaded VSCode, but RA is still using over 2 GB (when most other people were only seeing about 1.3 GB used).Originally posted by @jyn514 in #7451 (comment)
The text was updated successfully, but these errors were encountered: