在Visual Studio中排列代码[重复]

时间:2021-08-28 09:08:11

This question already has an answer here:

这个问题在这里已有答案:

Is there a way to arrange the code in Visual Studio automatically (built-in functionality or an extension)?

有没有办法自动在Visual Studio中安排代码(内置功能或扩展)?

By arrange, I don't mean format, which I know of. I mean to place private fields, public properties, constructors, private/public methods in a certain manner automatically. I've developed an application, but I had longer pauses in development, resulting in not-uniformed code style throughout the project. Is there a way to automate the process of rearranging it to comply to a certain style or do I have to do it all manually?

通过安排,我不是指格式,我知道。我的意思是自动以某种方式放置私有字段,公共属性,构造函数,私有/公共方法。我开发了一个应用程序,但是我在开发过程中有更长的停顿时间,导致整个项目中的代码样式不均匀。有没有办法自动重新排列它以符合某种风格的过程,还是我必须手动完成所有操作?

1 个解决方案

#1


I use CodeMaid from Visual Studio Extension Gallery. It has a feature where you reorganize the current file by right clicking inside the editor then in the context menu click on Reorganize. It will organize the file by accessibility.

我使用Visual Studio Extension Gallery中的CodeMaid。它有一个功能,您可以通过右键单击编辑器重新组织当前文件,然后在上下文菜单中单击“重新组织”。它将通过辅助功能组织文件。

http://www.codemaid.net/

The features are listed on their homepage.

这些功能在其主页上列出。

#1


I use CodeMaid from Visual Studio Extension Gallery. It has a feature where you reorganize the current file by right clicking inside the editor then in the context menu click on Reorganize. It will organize the file by accessibility.

我使用Visual Studio Extension Gallery中的CodeMaid。它有一个功能,您可以通过右键单击编辑器重新组织当前文件,然后在上下文菜单中单击“重新组织”。它将通过辅助功能组织文件。

http://www.codemaid.net/

The features are listed on their homepage.

这些功能在其主页上列出。