Narrange 将 Header 置于 using 语句下方

发布于 2024-11-05 05:51:04 字数 486 浏览 0 评论 0原文

我刚刚下载了 NArrange (v0.2.9) 并运行了它。我注意到它将 using 语句移到了我不想要的命名空间声明内。

我创建了 DefaultConfig.xml 的副本,然后使用 NArrange 配置编辑器更改了格式 ->使用指令-> “移动到”元素到“文件”而不是“命名空间”的默认值。

运行该工具时(我没有忘记指定 /c 选项,提供新的 config.xml 文件的路径),它确实将 using 语句放置在名称空间声明之外,但它也将它们放置在标头上方!不是我想要的。

请注意,文档中标题为“图:标题区域和使用指令排序”的图表示header 位于 using 语句之上。

(我试图标记这个“NArrange”,但该标签不存在,而且我的代表数少于 1500,我必须选择一个,所以我选择了 Visual-studio-2008)

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 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)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

剑心龙吟 2024-11-12 05:51:04

我能够通过使用“移动到 - 命名空间”选项排列文件,然后将使用指令设置更改为“移动到 - 文件”并重新排列,来重现您所看到的问题。但是,我注意到的一件事是,如果在更改设置然后进行排列后,如果您将标题移回到代码文件的顶部,则在下一次 NArrange 运行时它将保留在文件的顶部。

基本上,将 using 语句从命名空间级别移动到文件级别时似乎存在问题。

您能否确认,如果使用“移动到 - 文件”设置将标题移动到文件顶部,它会保留您期望的行为?

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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文