It's been over 4 years now since comunity started to request file nesting and as now it's still not there. You can follow discussion in github issues https://github.com/microsoft/vscode/issues/6328 

There has been multiple issues, pull requests, but changes are not accepted for file explorer. I don't want to go into politics why it's still not there... 

Visual studio Code file nesting

Recently file nesting discussions was brought back up, since there doesn't seem to be any progress made I wanted to share my solution. File nesting for me is must have, I could live without it, but it makes things so much easier. I mosty use it in large angular web app.

Configuration

  • Open settings.json (File -> Preferences -> Settings). While in settings press this top right icon.

settingsIcon.PNG

  • Add these configurations to settings.json
{
    "files.nesting.enabled"true,
    "files.nesting.rules": {
        "(?<basename>.*)\\.ts$": [
            "$(basename)\\.spec\\.ts$",
        ],
        "(?<basename>.*)\\.html$": [
            "$(basename)\\.css$",
            "$(basename)\\.scss$"
        ]
    }
}
  • Restart VsCode.

You can have all the crazy nesting rules, duplicate files to multiple places if you would like... There are some bugs, if you search for them. I'm using this feature since 2019 august and It didn't cause any issues.

Collapsed nested files

expandedList.PNG

Expanded nested files

expandedList.PNG

Download

Currently I just build it on my local machine and upload zip artifacts:

I don't want to take full credit for this feature, it's based on other pull request. All I did is took old changes and put then in newer vs code.

Future plans for my custom branch

Pinned tabs

One more feature that I would love to have (to implement) would be pinned tabs, just like in Visual Studio. After multiple tries I gave up on this, but seeing that there were some changes in how tabs are displayed, maybe I should give it one more try.

Auto updater

As of right now, you have to manually download zip with my changes, copy&paste over previous my build to update. I should spend some time and steal update logic from https://vscodium.com 🤔

 

Final thoughs

Also I would like to emphesise that plugins do work as everything else. But I think you need to specify plugin source manualy, in config. Let me know if anyone has any issues with plugins, it has been long time since I "installed" my custom build to new machine.

 

I createed 1.42 release few days ago, and now that I'm writing this blog post ~500 commits were made to VScode master branch, pace is amazing. Lets hope tree explorer get some love soon.

I will try to keep up with every VsCode release, If you want releases more often just ping me up.

Check out my other projects
Active forks newsletter
Get a glimpse on open source active forks. Weekly newsletter with selection of repositories and their active forks.

Comments


Comments are closed