简体   繁体   中英

How to automatically move the using directives inside the namespace on formatting?

Currently I have a.editorconfig in my VS setup which make the suggestion to move the using directives inside the namespace in C#. But sometimes it fails I don't know why. Could be a bad setting in VS? Although my main concern is that I want the using directives to automatically move inside the namespace when formatting. Is this possible?

I'm using Microsoft Visual Studio Professional 2019 Version 16.9.0

I suppose you configured the csharp_using_directive_placement option.

There is currently a bug open on the github roslyn project close to this subject. The bug is about misplaced new using directive added by refactoring (not moving the existing one).

You may open a feature request on the roslyn project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM