microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.69k stars 28.69k forks source link

Allow to set explorer.autoReveal per specific folder #87956

Closed elucidsoft closed 1 year ago

elucidsoft commented 4 years ago

Issue Type: Feature Request

node_modules will constantly expand itself in the Explorer, especially if your defining definitions. I typically never want this, I think an exception should be made for showing what file is open if its in node_modules to keep the folder collapsed unless I explicitly expand it.

The reason it's a problem is because there are so many files in node_modules you have to collapse it to keep developing, as it's completely useless in most cases to have it expanded and it pushes your work files off screen.

Proposition:

VS Code version: Code - Insiders 1.42.0-insider (7c0095ee2d064033fc13184127a9adc603454729, 2019-12-20T07:58:23.119Z) OS version: Linux x64 5.3.0-24-generic

isidorn commented 4 years ago

This is a fair feature request, renaming to make it more general and not javascript specific. We do not have it on our immedaite plan, thus assigning to backlog candidates. As a workaround you can use explorer.autoReveal: false however that will disable this for all folders.

Alternative way to achieve this in the future is if we allow to define settings per subfolder.

vscodebot[bot] commented 4 years ago
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](https://aka.ms/vscode-issue-lifecycle). Happy Coding!
joelday commented 4 years ago

@isidorn Would you accept a PR for this?

joelday commented 4 years ago

@elucidsoft Do you mind pulling this down, building it and testing it out?

elucidsoft commented 4 years ago

Yes I'll pull it down and check it out.

isidorn commented 4 years ago

@joelday no I would not accept a PR for this yet. I am still not sure we want this feature to be a part of the vscode core expereince. If you would like to provide PRs please search for issues tagged with "Help Wanted".

joelday commented 4 years ago

@isidorn no problem!

vscodebot[bot] commented 4 years ago
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](https://aka.ms/vscode-issue-lifecycle). Happy Coding
vscodebot[bot] commented 4 years ago
:slightly_smiling_face: This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our [documentation](https://aka.ms/vscode-issue-lifecycle). Happy Coding!
patarapolw commented 4 years ago

My thought on alternative implementation, would be to focus on larger folders.

Do ellipsis beyond 50 entries or something, rather than totally expand it.

It should be implemented by default, especially for

opudalo commented 3 years ago

@isidorn What's the status here? You mentioned that no external help is accepted on this issue, but many people experience problems with current behavior. And as per bot response here, in March it was moved to team backlog. That's almost a year ago.

isidorn commented 3 years ago

Status: no progress.

ShlomiRex commented 3 years ago

oof this really frustrates me... it opens node_modules and dist directories with tons of files and I can't do anything but to scroll up for 3 years and closing it

vhesener commented 3 years ago

Although I too want to see this feature, a small workaround for those interested.. If you find yourself in scrolly hell, click on one of the items in node_modules and hit your left arrow key a bunch of times. This collapses everything until node_modules is completely collapsed.

benji011 commented 3 years ago

@vhesener

Two workarounds I found was either:

  1. preferencessettings ( + ,) then filter by keyword autoreveal and set from true to false

image

  1. Open your settings.json and add explorer.autoReveal": false
  "explorer.autoReveal": false
Forsect commented 3 years ago

Why is this still not added to the VSC? The auto revealing node_modules is a dev nightmare and switching it off completely isn't a solution!

elucidsoft commented 3 years ago

My other suggested feature to add a right hand pane so you can have windows docked to the right hand side of VSCode. Really convenient for people with Ultra Wide monitors, yeah that got enough votes to make it into product and here we are 2 years later with that one as well still in back and forth drama. Pretty disappointed in Microsoft at how they treat such simple feature requests that the community wants to see but it gets caught up in politics and egos.

ShlomiRex commented 3 years ago

Behavioral suggestion: Right click on folder -> Lock folding This locks the folding / collapsing of a folder (It's just a suggestion how a user will do it)

superole commented 3 years ago

@elucidsoft , were you able to test @joelday 's PR? did it work? And - while we're waiting for such useful features to not fall victim of procrastination in favor of useless glam like 'Product Icon Themes' - Would it be possible to make an extension with this functionality?

edit: Don't get me wrong; I am all for glam and themes and customization, I just feel that lately developer experience has been given too little attention in VSCode.

adamburgess commented 3 years ago

Another workaround in the meantime: https://marketplace.visualstudio.com/items?itemName=phobal.vscode-collapse-node-modules It works by adding node_modules to the ignore list and then removing it, which makes vscode hide and restore it, effectively collapsing. (it does edit your .vscode/settings.json though, but I've made a PR to fix that) that + statusbar-commands makes for a handy button: image

peacechen commented 3 years ago

Here's a proposal that should be simple to implement: Don't auto-expand any folders in .gitignore

That gives developers flexibility in choosing its behavior.

vintprox commented 3 years ago

Here's a proposal that should be simple to implement: Don't auto-expand any folders in .gitignore

That gives developers flexibility in choosing its behavior.

@peacechen Nice! Can't believe it's still hanging there. So, where is the proposal? (Search fails me.)

FlashThePlayer commented 3 years ago

Why is this still an open request? There are several really good behavior proposals and non of them gets a reaction or answer what so ever! PR are also not accepted which really baffles me while a feature like this should be marginal to implement from my point of view.

runia1 commented 3 years ago

I recently decided to try vscode after years of using intellij ides. I like it but this single issue is probably a deal breaker for me. After reading this thread and realizing there still isn't a setting to turn this off I'm a little shocked. It's kinda crazy that it's the default behavior to begin with.

MrEmanuel commented 3 years ago

Excluding folders by using the same matching feature as in vscode search function would be good. So we could just define node_modules in .vscode or the settings UI. Comma separated for multiple values.

image

kodeine commented 3 years ago

I'm surprised this is still open and not updated.

martincalvert commented 3 years ago

Is this really not something that could be a plugin? Like if they are going to keep punting this idea can we achieve this functionality through a plugin?

elucidsoft commented 3 years ago

This right here is the perfect example of Microsoft "open source".

JacksonKearl commented 3 years ago

I propose a new explorer.autoReveal.exclude setting with semantics similar to the existing exclude configurations: image

The default would perhaps be the search.exclude configuration, or something similar to what that one uses as a default ("**/node_modules", "**/bower_components").

craigcosmo commented 3 years ago

can the dev get this shiet done? It's been bugging me so bad.

xxczaki commented 3 years ago

I'm actually surprised this has not been implemented yet. Seriously, why would I want to expand the whole node_modules folder just to see a single type definition?

AlexReff commented 3 years ago

Could we get some feedback as to what the status or current planning is for this? There are multiple good proposals here and clear interest from the community to offer a PR, if we could get confirmation it would be considered and accepted.

+1 on the 'do not auto-expand folders/files in .gitignore' as an easy QoL setting.

JacksonKearl commented 3 years ago

I will accept a PR which adds an explorer.autoReveal.exclude setting. This should work like the files.exclude and search.exclude settings, and be especially similar to the search.exclude setting, for instance by inheriting from files.exclude and excluding "**/node_modules" and "**/bower_components" by default. A good starting point would be to look around https://github.com/microsoft/vscode/blob/469640333f0cab03988e1c1aa2c196da348520ed/src/vs/workbench/contrib/files/browser/explorerService.ts#L265-L277

webark commented 3 years ago

@JacksonKearl what would the process be of changing the explorer.autoReveal setting from a boolean to a nested one? Is there a settings migration process? Would it be just the presence of the object be seen as truthy? Should a explorer.autoReveal.enabled setting be added?

JacksonKearl commented 3 years ago

The explorer.autoReveal setting should continue to accept true|false|focusNoScroll.

Our configuration provider may reject introducing a new explorer.autoReveal.exclude key if theres an existing explorer.autoReveal key, not sure but I could see that happening. If so, the new setting should just be explorer.autoRevealExclude.

If a given path matches the exclude setting no revealing code should run, regardless of the overall explorer.autoReveal (i.e. treat it as false temporarily).

gomezvillegasdaniel commented 2 years ago

@vhesener

Two workarounds I found was either:

  1. preferencessettings (⌘ + ,) then filter by keyword autoreveal and set from true to false

image

  1. Open your settings.json and add explorer.autoReveal": false
  "explorer.autoReveal": false

you have saved my time so much, thanks!

konstantinkreft commented 2 years ago

Hiding node_modules from the sidebar can be a good workaround until this is added:

"files.exclude": {
  "**/node_modules/": true
},
adamdry commented 2 years ago

Here's a proposal that should be simple to implement: Don't auto-expand any folders in .gitignore

That gives developers flexibility in choosing its behavior.

Personally I'm not sure I'd want this. gitignoring folders and not wanting them to expand are 2 separate things IMO. You do have 64 positive emojis from the community though so I guess it'll work for most! :smiley:

As another use case for this feature in general, I use CDK for Terraform which creates a .gen/providers/aws folder which I'm constantly Ctrl + Clicking into to see the definition of the configurations I can apply to AWS resources. This folder has 3,288 files in it!

The left arrow trick will save my mouse wheel for now. Thanks to the community for all the workarounds! :+1:

morriswinkler commented 2 years ago

@vscodebot just use whatever intelij defines as sane, every js developer will thank you.

rickvian commented 2 years ago

once i dragged wrong folder inside the node_module because it auto expanded, and i have to go trough delete and rerun yarn install because i don't know which folder i mis-dragged...

AmbrosiaDevelopments commented 2 years ago

Okay, but you could have used ctrl+z there too.

jzyrobert commented 2 years ago

I've also hit the issue of not wanting to reveal node_modules plenty of times, so I've given this PR a go. Have a look and leave any suggestions if you'd like

ireznik commented 2 years ago

Hiding node_modules from the sidebar can be a good workaround until this is added:

"files.exclude": {
  "**/node_modules/": true
},

Thanks! Appreciate it! Now it behaves like I want it: it only shows the one file I want to see instead of the whole folder.

septatrix commented 2 years ago

@jzyrobert I would also greatly appreciate if there was an option like true/false/ignore-preview wherein the latter would ignore files which are opened in preview mode like explained in #140057

DerGoogler commented 2 years ago

I propose a new explorer.autoReveal.exclude setting with semantics similar to the existing exclude configurations: image

The default would perhaps be the search.exclude configuration, or something similar to what that one uses as a default ("**/node_modules", "**/bower_components").

This was really helpful

benoitrongeard commented 2 years ago

Hiding node_modules from the sidebar can be a good workaround until this is added:

"files.exclude": {
  "**/node_modules/": true
},

Exclude node_modules isn't the solution. Some extension, like intellisense for bootstrap needs to have node_modules inside vscode to scan it :/ If you exclude node_modules, you break this extensions :(

elucidsoft commented 2 years ago

Two years later....

digimbyte commented 2 years ago

build/repo folders need to consider condensing for folder views in VS code

like.. I'm not a VS code wizard, it's not communicated how I could set a 'files.exclude' property It gets tiring trying to follow all these cryptic commands and settings between IDE's I assume its some vscode folder or a file with a vscode/glob extention - but that's just me making assumptions from the conversation.

For user experience, I should be able to right click on a folder and set it to 'collapsed mode' to effectively lock that folder from expanding. maybe this can be done with a plugin? because I would love this to be a global feature.

I do enjoy the features of the auto-expand when finding files, and I don't mind if a file is visible if open/viewing so I know the path/structure. This additional behaviour is seen with some react apps where the folders are condensed into a path string above the file, no idea what magic settings does this, but it is a dream.

regardless, I stand by the point that folders like node_modules and dist should be permanently collapsed since they are not inherit to the development of the app, at most only needed for build scripts and the occasional debugging on types.

disappointed this wasn't taken seriously by the dev team, but then again, I guess Microsoft don't really develop large scale js/node apps or just go with the 'its good enough as is' approach.

for clarification, the 60 emotes mentioned earlier on this thread were from random people dealing with this very issue. This topic is not advertised or highlighted to the general public (neither is the backlog voting known), and I guarantee that if this was more public, it would be an overwhelmingly supported feature from the community.

Livan-pro commented 2 years ago

@digimbyte, FYI, there is already a PR for this issue, it just needs to be updated/improved: https://github.com/microsoft/vscode/pull/136905.

jonlepage commented 2 years ago

Two years later....

they probably need visual for help understand ? is hard concept. Plz allow omit reveal in node_module ! lock node_module