microsoft / vscode-dotnettools

This is a feedback repository to capture issues logged for the C# Dev Kit and related extensions from Visual Studio Code
Other
207 stars 7 forks source link

[BUG] Namespace defaults to base namespace when adding with C# DevKit #611

Open svdbrg opened 8 months ago

svdbrg commented 8 months ago

Describe the Issue

When creating a new class or interface file, the namespace of the created file does not reflect the folder structure, but rather just adds the base namespace of the app.

Steps To Reproduce

  1. In a dotnet app, right click a folder and choose "Add New File..."
  2. Select Class and give it a random name
  3. Namespace is "wrong"

Expected Behavior

The namespace of the new file should reflect the folder structure it's been created in.

Environment Information

kvenkatrajan commented 8 months ago

Related request : https://github.com/dotnet/templating/issues/6010