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

Auto Collapse Folder Tree when closing files #45362

Closed
jpagarcia opened this issue Mar 9, 2018 · 8 comments
Closed

Auto Collapse Folder Tree when closing files #45362

jpagarcia opened this issue Mar 9, 2018 · 8 comments
Labels
feature-request Request for new features or functionality file-explorer Explorer widget issues *out-of-scope Posted issue is not in scope of VS Code
Milestone

Comments

@jpagarcia
Copy link

VSCode's feature on opening the file's tree on the sidebar is great, also showing it when the file is active on the editor. I was wondering if it's possible to collapse the file's tree when the file is closed?

@vscodebot
Copy link

vscodebot bot commented Mar 9, 2018

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@jpagarcia
Copy link
Author

Same issue -> Ability to keep only the current directory expanded in the Explorer (#39025)

@jpagarcia
Copy link
Author

The link provided in the previous issue does not provide that much help. extension is not available in the marketplace

@jpagarcia jpagarcia reopened this Mar 9, 2018
@bpasero bpasero assigned isidorn and unassigned bpasero Mar 9, 2018
@bpasero bpasero added the file-explorer Explorer widget issues label Mar 9, 2018
@isidorn isidorn added the feature-request Request for new features or functionality label Mar 9, 2018
@isidorn isidorn added this to the Backlog milestone Mar 9, 2018
@isidorn isidorn removed their assignment Mar 9, 2018
@JeanMertz
Copy link

The link provided in the previous issue does not provide that much help. extension is not available in the marketplace

There's a .vsix file in the linked repo, that you can install manually:

$ code --install-extension ~/Downloads/auto-collapse-explorer-0.0.2.vsix 
Extension 'auto-collapse-explorer-0.0.2.vsix' was successfully installed!

Then, after reloading/restarting vscode, it works as expected. The only downside I've seen so far is that it has a bit of a jarring/flickering effect when switching between files in different folders, and you can't exclude specific folders from auto-collapsing.

I might take a stab at adding that in the future, but for now this will do.

@fjcaetano
Copy link

The problem with the given extension is that it collapses all folders to then reopen the active file and this causes the Explorer tree to blink.

I was trying to make a proper extension that would handle this correctly, but there's no access to the Explorer tree in the API. I also tried fiddling with VS Code's source but I couldn't find any reliable way of finding a tree model (Tree, TreeView, TreeModel, etc) based on a folder's path - probably due to lack of knowledge of the source code.

If anyone is willing to help, I'd be more than appreciative.

@isidorn isidorn added the *out-of-scope Posted issue is not in scope of VS Code label Sep 21, 2018
@vscodebot
Copy link

vscodebot bot commented Sep 21, 2018

This iteration we focus on issue grooming. This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding and happy coding!

@vscodebot vscodebot bot closed this as completed Sep 21, 2018
@rohanrajpal
Copy link

Would love to have this feature, will be very useful in a monorepo setup.

@JCcastagne
Copy link

If anybody tried searching for an extension and couldn't find a solution, here's the extension that worked for me:

https://marketplace.visualstudio.com/items?itemName=lukegeneva.auto-collapse-explorer

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 *out-of-scope Posted issue is not in scope of VS Code
Projects
None yet
Development

No branches or pull requests

7 participants