microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.26k stars 29.3k 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

mindplay-dk commented 2 years ago

💡 How about not auto-expanding things that are in your .gitignore?

That would work for node_modules and probably for other similar scanarios - without any manual intervention.

It's great to have options - but it would be even nicer if (most) users didn't need to solve this problem in the first place.

Those items are already grayed-out in the tree-view, so the IDE already "knows" - most likely, folders you wish to ignore in terms of source-control are just artifacts that the user wants to ignore most of the time in practice as well.

webark commented 2 years ago

@mindplay-dk thats not a bad default option. You should comment on the corresponding PR #136905

salv0 commented 2 years ago

Is there any news about this one?

sephentos commented 2 years ago

💡 How about not auto-expanding things that are in your .gitignore?

That would work for node_modules and probably for other similar scanarios - without any manual intervention.

It's great to have options - but it would be even nicer if (most) users didn't need to solve this problem in the first place.

Those items are already grayed-out in the tree-view, so the IDE already "knows" - most likely, folders you wish to ignore in terms of source-control are just artifacts that the user wants to ignore most of the time in practice as well.

Hell, yeah, i even would pay some bucks to have such a feature. Or at least having the possibility to define node_modules in the user settings to not be expanded when opening files in it e.g. via checking defination files in typescript projects.

gulshan commented 2 years ago

I think LSP should be able to provide sorting/nesting/hiding/revealing settings for a opened folder.

PaRaD1SE98 commented 2 years ago

How about just collapsing the folder vscode auto-expanded when closing the file?

owens-ben commented 2 years ago

+1

Please add autoreveal per folder and/or regex!!!

hjhjdev commented 2 years ago

+1

vincentbab commented 2 years ago

+1

lramos15 commented 1 year ago

Huge thanks to @jzyrobert his PR has been merged and you should be able to try this in tomorrow's insiders

Masterxilo commented 1 year ago

Thanks, so I assume this is how it would work: in your settings.json, add

    "explorer.autoRevealExclude": {
      "**/node_modules": true
    }

I am not using the insiders build and 1.73.1 doesn't seem to understand that yet but looking forward to it...

elucidsoft commented 1 year ago

Thanks everyone!