I have an issue with Visual Studio Code (1.21) on Mac. When standing in a project that I work with, I can't find all the files using CMD + P, and the search is sketchy as well. The files only seems to be indexed if I have opened them before in VSC.
As you can see from this image, I have tried to find 'chapter.html', and in the folder on the left side you will see the file but VSC doesn't find it.
Anyone else experienced this and know what the issue might be?
I had the same problem until I read https://github.com/Microsoft/vscode/issues/39440. The key is VSCode use .gitignore file to filter search result by default.
I guess you have .gitignore or .ignore file in your folder and you enable "search.useIgnoreFiles": true
, and this is why you can't find file through CMD+P.
You could try to delete .gitignore(.ignore) file or set "search.useIgnoreFiles": false
to disable it. Then CMD+P should work normally as you want.
Pivoting off of what @asurada said, now (Version: 1.68) you can change this setting with the settings GUI.
Again, the key here is that by default VSCode uses .gitignore and .ignore to filter search results.
To change this default behavior using the settings GUI:
On Mac: Code > Preferences > Settings (or just Cmd+,)
In the search bar type "gitignore search".
Uncheck "Search: Use Ignore Files". (You may also need to uncheck "Search: Use Global Ignore Files" and "Search: Use Parent Ignore Files".)
Note: this is particularly useful for dbt users. After making this change, you can now easily search for compiled files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With