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

Hide empty folders after apply file exclusions (user settings) #763

Open
j0nd0n7 opened this issue Nov 27, 2015 · 7 comments
Open

Hide empty folders after apply file exclusions (user settings) #763

j0nd0n7 opened this issue Nov 27, 2015 · 7 comments
Assignees
Labels
feature-request Request for new features or functionality file-explorer Explorer widget issues
Milestone

Comments

@j0nd0n7
Copy link

j0nd0n7 commented Nov 27, 2015

I'm a Unity 3D developer. Although I use file exclusions, it would be nice to hide folder that get empty after file exclusions are applied.

@bpasero bpasero added the feature-request Request for new features or functionality label Nov 30, 2015
@bpasero bpasero removed their assignment Nov 30, 2015
@egamma egamma modified the milestone: Backlog Dec 10, 2015
@bpasero bpasero added the file-explorer Explorer widget issues label Dec 18, 2015
@bpasero bpasero self-assigned this Mar 30, 2016
@bpasero bpasero removed their assignment Aug 17, 2016
@bbugh
Copy link

bbugh commented Jan 1, 2017

Is there some way to hack around this until it's official?

@JoshuaKGoldberg
Copy link
Contributor

JoshuaKGoldberg commented Apr 8, 2018

This feels like something that should be an opt-in setting. It could be confusing why some folders without children in the tree view appear while others do not.

To start, I'd like to take a stab at making a general setting to not show empty folders overall.


Edit: Unless I'm misunderstanding the code (can someone please verify this?), doing so would be a performance regression.

The way it is now:

ExplorerView contains:

  • TreeModel of the directory structure
  • FileFilter
    • (.updateConfiguration has the user/workspace files.exclude logic)
  • ExplorerViewer that contains the FileFilter (param) and receives updates to the TreeModel

Updates to the model occur when the user's filters change, a file system event is seen, or a folder is expanded. Each folder doesn't know its children until an event occurs so that Code doesn't have to constantly monitor every file that could be in the explorer.

Knowing whether a folder is "empty" would include needing to know its children immediately, which recursively leads to potentially needing to know the state of all children, always. Consider this directory structure:

src/
    a/
        b/
                ...
                        y/
                            z/
                                file-that-might-be-excluded.txt

In order to know whether a/ is hidden, we'd need to check b/, which would need to check dirs down to y/, then z/, and finally to the file.

@isidorn
Copy link
Contributor

isidorn commented Oct 8, 2019

Next milestone we plan to introduce compressed trees to the Explorer (single child nodes gets compressed into one). I believe this should make this experience better.
If the experience does not get improved I am open to a PR that would introduce a setting for this. However we can disucss this further in a couple of milestones. Thanks

@narigondelsiglo
Copy link

This would be great

@ashfahan
Copy link

ashfahan commented Apr 12, 2020

Any updates on this ? VS-CODE Compact Folders is already out

Another Unity 3D developer here ✋

@Nirmal4G
Copy link

Really Need this!!

Also, Is there an 'Exclude everything except these' support in the files.exclude and search.exclude settings?

@Cdddo
Copy link

Cdddo commented May 28, 2022

This would be a really useful feature to have, to not have a lot of "empty" folders cluttering some projects...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality file-explorer Explorer widget issues
Projects
None yet
Development

No branches or pull requests