Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
vsfeedback opened this issue Mar 29, 2022 · 1 comment · Fixed by #60450
Closed

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

vsfeedback opened this issue Mar 29, 2022 · 1 comment · Fixed by #60450
Assignees
Milestone

Comments

@vsfeedback
Copy link

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)

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Mar 29, 2022
@davidwengier davidwengier self-assigned this Mar 29, 2022
@davidwengier davidwengier added this to the 17.3 milestone Mar 29, 2022
@davidwengier davidwengier added Bug and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Mar 29, 2022
@davidwengier davidwengier changed the title Use file-scoped namespace for classes in project templates New document formatting service doesn't consider .editorconfig files Mar 29, 2022
@user98392
Copy link

Visual studio 17.4.1
The bug appears when creating user controls at least in custom control library project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants