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

Use file-scoped namespace for new item template #3930

Closed
WeihanLi opened this issue Sep 18, 2021 · 2 comments
Closed

Use file-scoped namespace for new item template #3930

WeihanLi opened this issue Sep 18, 2021 · 2 comments
Assignees

Comments

@WeihanLi
Copy link

WeihanLi commented Sep 18, 2021

Currently, the file-scoped namespace feature had been supported, but when I create a new item(class/interface) with the latest Visual Studio 2022 Preview 4, the file-scoped namespace had not been applied, could file-scoped namespace be enabled for the new item template?

It may relate to #3359

@DavidKarlas
Copy link
Contributor

I just tried with very latest "17.0.0 Preview 5.0 [31719.51]" and this works, but it is important to also add:

[*.{cs,vb}]
csharp_style_namespace_declarations=file_scoped:suggestion

to your .editorconfig file.

I hope this solves your problem.

@WeihanLi
Copy link
Author

Thanks, great news

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

No branches or pull requests

2 participants