Narrange puts Header below using statements
I just downloaded NArrange (v0.2.9) and ran it. I noticed it moved the using statements inside the namespace declaration which I didn't want.
I created开发者_StackOverflow a copy of DefaultConfig.xml and then, using the NArrange Configuration Editor I changed the Formatting-> Using directives-> "Move To" element to "File" instead of the default value of "Namespace".
Upon running the tool (I did not forget to specify the /c option, providing the path to my new config.xml file) it does place the using statements outside the namespace declaration, however it also places them above the header! Not what I want.
Note that the figure in the documentation titled "Figure: Header Region and Sorted Using Directives" indicates the header being above the using statements.
(I tried to tag this "NArrange" but the tag doesn't exist and I have less than 1500 rep, and I had to pick one so I went with visual-studio-2008)
I was able to reproduce the problem you were seeing by arranging a file with the "Move To - Namespace" option then changing the Using Directives setting to "Move To - File" and re-arranging. However, one thing I noticed is that if after changing the setting then arranging, if you then move the header back to to top of your code file, it will stay at the top of the file with the next NArrange run.
Basically, it seems that there is an issue when moving using statements from the namespace level to the file level.
Could you confirm that if move your header to the top of the file with the "Move To - File" setting that it preserves the behavior you were expecting?
精彩评论