Skip to content
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

Shouldn't search.exclude with false take priority over search.useIgnoreFiles = true? #239677

Open
bubokko opened this issue Feb 5, 2025 · 4 comments
Assignees

Comments

@bubokko
Copy link

bubokko commented Feb 5, 2025

I tried to somehow whitelist some files from .gitignore, good example being .env files. I thought this would work:

{
    "search.useIgnoreFiles": true,
    "search.exclude": {
        ".env": false
    }
}

Sadly, it doesn't work like that. Perhaps search.exclude could be always taking priority over search.useIgnoreFiles?

@albertosantini
Copy link

What is the goal?

Because if I search (Ctrl+Shift+F) something contained in .env file, it is in the results.

@bubokko
Copy link
Author

bubokko commented Feb 5, 2025

What is the goal?

Because if I search (Ctrl+Shift+F) something contained in .env file, it is in the results.

It's not though. And I mostly look for the cmd+P to open the file, but I checked and cmd+shift+F doesn't work neither for gitignored files with search.exclude set to false.

@albertosantini
Copy link

I have .env in .gitignore
I have default settings for VSCode.

Searching a content in the ignored file (Ctrl+Shift+F) I get the results.
Using Ctrl+P to find an ignored file like .env, it is displayed in the combo box.

Please, can you provide the steps and the setup to reproduce your context?

@bubokko
Copy link
Author

bubokko commented Feb 5, 2025

I have .env in .gitignore I have default settings for VSCode.

Searching a content in the ignored file (Ctrl+Shift+F) I get the results. Using Ctrl+P to find an ignored file like .env, it is displayed in the combo box.

Please, can you provide the steps and the setup to reproduce your context?

Do you have search.useIgnoreFiles set to true? I don't know what's the default. I want to ignore almost all gitignored files, just with some exceptions. Please use the config I pasted in the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants