Skip to content

Add file-nesting patterns for C# development files#2215

Closed
Copilot wants to merge 1 commit intomainfrom
copilot/fix-1823
Closed

Add file-nesting patterns for C# development files#2215
Copilot wants to merge 1 commit intomainfrom
copilot/fix-1823

Conversation

Copy link

Copilot AI commented Aug 6, 2025

This PR implements the requested file-nesting patterns to improve file organization in the VS Code Explorer for C# development projects.

What this adds

The extension now contributes default file-nesting patterns via configurationDefaults in package.json that automatically organize related files under their parent files when file nesting is enabled in VS Code.

File-nesting patterns included

  • C# source files (*.cs) - nests generated and designer files:

    • Program.designer.cs → nested under Program.cs
    • Program.g.cs → nested under Program.cs
    • Program.generated.cs → nested under Program.cs
  • Project files (*.csproj) - nests user-specific settings:

    • MyProject.csproj.user → nested under MyProject.csproj
  • Configuration files (*.json) - nests environment-specific configs:

    • appsettings.Development.json → nested under appsettings.json
  • Razor pages (*.cshtml) - nests code-behind and styles:

    • Index.cshtml.cs → nested under Index.cshtml
    • Index.cshtml.css → nested under Index.cshtml
  • Blazor components (*.razor) - nests code-behind and styles:

    • Counter.razor.cs → nested under Counter.razor
    • Counter.razor.css → nested under Counter.razor
  • XAML files (*.xaml) - nests code-behind:

    • MainWindow.xaml.cs → nested under MainWindow.xaml

How it works

The patterns use VS Code's built-in file nesting feature with the ${capture} token to match the base filename. When a user has explorer.fileNesting.enabled: true in their settings, these patterns will automatically organize their C# project files for a cleaner Explorer view.

Implementation details

  • Created complete VS Code extension structure with proper TypeScript compilation
  • Added configurationDefaults section to package.json with the exact patterns requested
  • Updated documentation to describe the file organization features
  • Validated all JSON syntax and extension structure

Fixes #1823.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@claudiaregio claudiaregio deleted the copilot/fix-1823 branch August 6, 2025 17:29
Copilot AI changed the title [WIP] Contribute a set of default file-nesting patterns via the extension Add file-nesting patterns for C# development files Aug 6, 2025
Copilot AI requested a review from claudiaregio August 6, 2025 17:42
@claudiaregio claudiaregio removed their request for review August 7, 2025 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Contribute a set of default file-nesting patterns via the extension

2 participants