DEV Community

Wahid Abduhakimov
Wahid Abduhakimov

Posted on

16 6

C# file nesting in VSCODE

Partial classes Interface/Implementation
Image description Image description

I know, I know it's been a while since I wrote. This one is worth reading!

  1. Press CMD+, (or CTRL+, for the poor 😎) to open VSCODE settings window.

  2. Type nesting in the search bar at the top, then find Explorer > File Nesting: Patterns tab as shown in the picture.

Image description

  1. Add those two items at the end that is highlighted in the picture.

Image description

Now 2 things happen:
1) you partial classes nest under main class.
2) you implementations nest under interfaces if they are in the same folder.

Partial classes

Interfaces

© Ilmhub

Hey reader!

Do your career a big favor. Join DEV. (The website you're on right now)

It takes one minute, it's free, and is worth it for your career.

Okay let's go

Community matters

Top comments (3)

Collapse
 
asilbekbakhrom profile image
asilbekbakhrom

Thank you

Collapse
 
leverow profile image
A'zamjon

That's awesome 🤩🤩

Collapse
 
euankennedy profile image
Euan

Nice! Out of interest, can you explain the *.csproj nesting configuration you have in the screenshot? What's that one doing? Ta

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay