Steps to Reproduce:
Does this issue occur when all extensions are disabled?: Yes
We colocate test files with their paired file, so foo.js and foo.test.js are in the same dir. This leads to a lot of test files that obscure the list of regular files. So we set files.exclude to include the glob **/*.test.js - great so tests are excluded from the file explorer. But now they are also not quick-loadable when I do Cmd-P and start typing out the name of the file.
This is not the optimal abstraction. Excluded test files should not be shown in the file explorer but SHOULD be shown when searching for them via Cmd-P. Otherwise, how else are we supposed to load them?
Thanks!
Excluded test files should not be shown in the file explorer but SHOULD be shown when searching for them via Cmd-P.
I don't really understand your position, the purpose of files.exclude is to hide files that are not part of your project. If you want to open/edit them regularly, they should be visible in the explorer and in quickopen.
Hey, @roblourens could you please not just close the issue this quickly? I'd like to see some discussion around this because it does impact a lot of people besides me. Would you consider re-opening it please, maybe as a feature request instead of as a bug? :-)
Let me try to explain my position to you:
Would you consider relabeling this from Bug to Feature Request and re-opening it so that we can have a discussion about this as I know that others are also interested in this feature?
Or maybe there is another way to hide foo.test.js from the file explorer but still make it openable from the quickopen? I'm open to other approaches.
Thanks!
@roblourens the actual documentation for files.exclude in VSCode itself says:
Configure glob patterns for excluding files and folders.
For example, the files explorer decides which files and folders to
show or hide based on this setting.
It doesn't say anything about "hide files that are not part of your project" it only talks about hiding or showing files without reference to whether they're "part of your project".
I think you're asking for a new setting for globs that would hide files from the file explorer but not from quickopen. I can leave it open but this doesn't really fit my idea of how the explorer/quickopen are used. If I were you, and if this is causing a lot of confusion, I would just put the tests in a separate folder :)
Since this seems to be the unclosed version of this feature request, I would like to ask if a pull request addressing this might be approved. It would be my first issue but it seems doable.
Add an explorer.hidden setting with a similar interface to files.exclude but solely affecting the explorer. Files/globs could be set to true or false just as in the current files.exclude. By default, any file in files.exclude will also be hidden, so current users will see no change, but this could be overwritten by using files.exclude = true and explorer.hidden = false.
Documentation would be updated to clarify that files.exclude is intended for files that are not really part of the project at all such as .git while explorer.hidden is solely to affect appearance.
Perhaps instead of true/false settings, explorer.hidden could have the option visible, invisible, grayOut as in #19347 so that users could choose to manually gray out files that are not in .gitignore
files.exclude as "how you hide files" without any mention of other outcomesfiles.exclude I don't want to take this as a PR right now. I'll leave it open for discussion but I feel like a setting like this could just cause more confusion. I already get lots of issues from people who are confused about the effects of files.exclude, search.exclude, and .gitignore. Not looking forward to answering questions from more people who wouldn't understand why a file shows up in one place but not another.
And I don't understand how someone is supposed to navigate a codebase that has this configured. Do you have the whole file tree in your head so you know exactly what to type in quick open? I think you would confuse people looking at your codebase for the first time.
At the very least I think the documentation for files.exclude needs to be edited to make it clear that it does WAY more than simply hide files in the explorer. That is currently the only mentioned effect in the documentation, and there are many articles, answers, and even extensions (I use the Make Hidden extension by @Devine-Davies but there are others) that refer to this feature as exclusively one for hiding files; thus this bug report, and mine, and the many others that have been listed as duplicates.
Get Outlook for iOShttps://aka.ms/o0ukef
From: David Griswold notifications@github.com
Sent: Friday, September 20, 2019 5:28 pm
To: microsoft/vscode
Cc: Subscribed
Subject: Re: [microsoft/vscode] files.exclude excluded files should NOT be excluded from quick find (#67168)
At the very least I think the documentation for files.exclude needs to be edited to make it clear that it does WAY more than simply hide files in the explorer. That is currently the only mentioned effect in the documentation, and there are many articles, answers, and even extensions (I use the Make Hiddenhttps://github.com/Devine-Davies/vs-make-hidden extension by @Devine-Davieshttps://github.com/Devine-Davies but there are others) that refer to this feature as exclusively one for hiding files; thus this bug report, and mine, and the many others that have been listed as duplicates.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHubhttps://github.com/microsoft/vscode/issues/67168?email_source=notifications&email_token=AMBW6JGC5ETMPUBQ5V6ANUDQKT23HA5CNFSM4GSR5AN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7HG6BQ#issuecomment-533622534, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMBW6JDGT4U6L6U3EKSZ6DTQKT23HANCNFSM4GSR5ANQ.
This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.
Happy Coding!
This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.
Happy Coding
This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.
Happy Coding
:slightly_frowning_face: In the last 60 days, this feature request has received less than 20 community upvotes and we closed it. Still a big Thank You to you for taking the time to create this issue! To learn more about how we handle feature requests, please see our documentation.
Happy Coding!