Skip to content

New document formatting service doesn't consider .editorconfig files #60449

@vsfeedback

Description

@vsfeedback

This issue has been moved from a ticket on Developer Community.


Originally created in dotnet/templating#4394

If you create a new project in a solution that uses file-scoped namespaces the classes created by the project template should also use file-scoped namespaces.
Similar to dotnet/templating#3930, which only handled new item templates (which work fine).

Repro steps:

  1. Create a new repository/solution with an EditorConfig file. Make sure the EditorConfig file contains csharp_style_namespace_declarations = file_scoped:suggestion.
  2. Create a new project targeting . NET6 that contains at least one class with a namespace (e.g. class library or WPF application).
  3. See that the namespace in the generated class file uses the old block scoped style and that IDE0161 "Convert to file-scoped namespace" is triggered immediately.

Tested with Visual Studio 2022 17.0.6 and Version 17.2.0 Preview 1.0 [32130.36.main]


Original Comments

Feedback Bot on 23/02/2022, 01:00 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

Feedback Bot on 24/02/2022, 10:34 AM:

Thank you for sharing your feedback! Our teams prioritize action on product issues with broad customer impact. See details at: https://docs.microsoft.com/en-us/visualstudio/ide/report-a-problem?view=vs-2019#faq. In case you need answers to common questions or need assisted support, be sure to use https://visualstudio.microsoft.com/vs/support/. We’ll keep you posted on any updates to this feedback.


Original Solutions

(no solutions)

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions