-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
Find in Files "files to include" override .gitignore #26574
Comments
It seems like ripgrep will let include globs override entries in the gitignore file. I'm not sure whether that's expected or whether we can change that. But one workaround is to use |
|
Unfortunately that's because I changed it to not use gitignore files in parent directories which breaks that workaround. |
This was working OK up to version 1.30. |
Can you explain what you mean by "this"? This issue has been open for a long time. |
Sorry I see, the workaround I mentioned above will not work anymore. The only suggestion I have right now is to add patterns to |
Seems like it's discussed in this ripgrep issue UPD |
I can't tell whether that's the right issue or not. vscode does not invoke rg with a path argument, the |
Right now I observe this bug/feature/behaviour both in vscode and in rg console output. I have a file at path
same happens in vscode searching with As a proposal: maybe vscode should always search from root and filter with |
When searching a big repo, there can actually be a large perf gain by using |
I am pretty sure BurntSushi/ripgrep#829 is the correct upstream issue for this. |
Started happening for me even with an empty "files to include" field |
I remember that some versions ago (maybe 1.2x), I could search in
There is no need to uncheck the I believed that was a "feature", and that's the behavior described in this issue. But (at least) in current version (1.43.2 and 1.44-insider), I must uncheck the |
Could we prioritize this issue? Because it definitely blocks effective development. Thank you |
As a workaround, is there any way to hook into the exclude pattern so that we can write our own ignore logic in an extension or similar? |
For anyone wondering about the status of this issue, it looks like the underlying ripgrep issue is a bit stale. In the meantime, I found a workaround that works for me to exclude irrelevant files from search in my multi-root workspace. My workaround is adding this to my workspace settings.json: "search.exclude": {
"**/.git": true,
"**/node_modules": true,
"**/tmp": true,
"**/dist": true,
"**/lib": true,
"**/generated": true
} It's not perfect, and doesn't take into account any |
Lol, when I try to enable this option then VSCode stupidly resets it back again. Every time. |
I don't think it is. I have I don't know how vscode passes "files to ignore" to ripgrep, but it doesn't seem to be as a path argument, and hence that is not the right issue. |
Ah, it seems to be via globs: |
Based on my above observations, solving this issue would be possible by making vscode pass things from "files to include" as directory arguments to ripgrep, rather than passing them via
|
we are using VScode with we are working around with the |
this is so needed, it annoys me every single day. Why would I want my ignore rules disabled just because I'm searching in a specific path?? |
This is even worse in multi-folder workspaces, as it will exclude a |
This is so annoying, and I run into this bug daily. When in a monorepo, I often want to search project folders only, but doing this includes all build files, assets, node_module files and folders etc... |
VSCode 1.12: I have a TypeScript project with a
src
folder and a.gitignore
file containing this:If I search for something, it is OK with 'files to include' is empty:
but it is not OK if I scope the search:
While I'm searching only in some sup-tree of my project, all .gitignore rules should still be taken into account.
The text was updated successfully, but these errors were encountered: