Identify and Nest Dependent Files in Solution Explorer using Right Click Menu
Identify and Nest Dependent Files in Solution Explorer using Right Click Menu.
Allow us to nest files in solution explorer without having to edit the csproj file. For example, we have 4 files that are breeze.*.js, and I like to nest them as dependent on breeze.js so they show up collapsed in solution explorer.
Currently we edit the csproj file to do this, and we also do it for css and for custom js. Another example:
For files like jQuery that have 4 or 5 dependent files this is a huge reduction of friction. For files like bootstrap which may have dozens of files (via nuget package), it is tremendously more helpful.
I want to second @Paul Schroeder's comments and ask for full support in all project types.
Paul Schroeder commented
Angelos - great improvement - Can we expand that capability for File nesting in Solution Explorer beyond just ASP.NET Core projects? Also, it's important to ensure this capability can be automated via the DTE object so visual studio extensions can take advantage of it as well.
Being able to nest files in combination with code generation is a great way to clue developers in on the idea that certain files should not be manually edited.
Zaw Htet Aung commented
Angelos Petropoulos commented
I just wanted to let everyone know that since Visual Studio 2017 15.6 Preview 4 (which was made available a few days ago) users have the ability to control how file nesting works in Solution Explorer.
Check out this blog posts for more details:
Just integrate File Nesting into VS: https://visualstudiogallery.msdn.microsoft.com/3ebde8fb-26d8-4374-a0eb-1e4e2665070c
Thomas Darling commented
Can we please also have an option to DISABLE auto file nesting in ASP.NET 5 / MVC 6 projects? It can be highly frustrating and inconsistent:
Murray Roke commented
Also configuration transforms such as Web.config, Web.Staging.config I would like to rename these to suit our environment names (octopus uses these transformations at deployment time)
Code analysis rules that would go a long way in this:
- Class X is used only by Class Y - consider making class X a nested class
- Class X is used only by namespace Z - consider moving class X to namespace Z
- Namespace T is only used by namespace R - consider moving namespace T inside R
- File H is used only from file J, consider moving file H to J's directory
Its possible to define dependent files with VSCommands http://visualstudiogallery.msdn.microsoft.com/a83505c6-77b3-44a6-b53b-73d77cba84c8
Oh to collapse all those jQuery files into one node...
John Oliver commented
Have you tried the NestIn extension?
Florian Greinacher commented
+1 - In the meantime, the NestIn extension (http://visualstudiogallery.msdn.microsoft.com/9d6ef0ce-2bef-4a82-9a84-7718caa5bb45) works pretty well.
John Papa commented
Also, please allow us to rename nested files in solution explorer. Currently we have to do this by editing the csproj file in a text editor.