In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail how to use CodeMaid automatic program typesetting, the content of the article is of high quality, so the editor will share it with you for reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
In the process of project development, if you only validate the naming rules without uniform program layout, it is easy to produce program code similar to the following example in the project. Although this output can provide normal project functions and comply with Microsoft's naming rules, it greatly reduces the maintainability of the program code because of the problem of messy typesetting.
Bad Code
Public class Class1 {private string _ name = "Clark"; public string GetResult () {return (_ count01 + _ count02). ToString ();} private int _ count01 = 1; private int _ count03 = 3; public string GetName () {return _ name;} private int _ count02 = 2;}
This article introduces how to use CodeMaid as a tool to automatically sort out the layout of the program code in the project, so that the output of the program code of the team tends to be consistent and the production quality of the program code is greatly improved without increasing the burden on the developers. Mainly for their own record, but also hope to help developers in need.
Good Code
Public class Class1 {private int _ count01 = 1; private int _ count02 = 2; private int _ count03 = 3; private string _ name = "Clark"; public string GetName () {return _ name;} public string GetResult () {return (_ count01 + _ count02). ToString ();} install
First, go to Microsoft's official website and download the CodeMaid installation file: "CodeMaid_v0.7.4.vsix".
Http://visualstudiogallery.msdn.microsoft.com/76293c4d-8c16-4f4a-aee6-21f83a571496
Execute the CodeMaid installation file: "CodeMaid_v0.7.4.vsix" to install CodeMaid.
Execution
Use Visual Studio to open the project.
In the toolbar above Visual Studio, open the CODEMAID menu and click Configuration to open the CodeMaid settings screen.
In the CodeMaid settings screen, go to the Reorganizing- > General settings page, check "Run organize at start cleanup", and click the Save button to complete the settings.
Then you can open the CODEMAID menu from the toolbar above Visual Studio and click "Cleanup all Code" to automate all the program code in the typesetting project.
After the execution of the automatic typesetting function, open the program code in the project, you will find that the program code content has been neatly arranged, clean, greatly improve the maintainability of the program code.
Extend
The automatic typesetting function of the program code provided by CodeMaid is very convenient to use, and the typesetting result is very simple. But in some details, there will always be some typesetting definition, which does not meet the requirements of team members for the quality of the program code. Fortunately, however, CodeMaid has opened up many projects for setting typesetting conditions, allowing developers to adjust typesetting conditions to bring the typesetting results closer to the requirements of team members for program code output.
1. Automatically run cleanup on file save
"Automatically run cleanup on file save": located on the Cleaning- > General settings page. When this option is set to check, the program code typesetting function is automatically executed when the file is saved.
2. Run remove unused using statements
"Run remove unused using statements": located on the Cleaning- > Visual Studio settings page. When this option is set to check, unused using definitions are removed when the program code typesetting function is executed. (it is not recommended to check this option during the development phase, because removing unused using definitions can cause problems when using LINQ to find extension methods.)
3. Remove multple consecutive blank lines
"Remove multple consecutive blank lines": located on the Cleaning- > Remove settings page. When this option is set to check, blank lines of consecutive lines are removed when the program code typesetting function is executed.
4. Update # endregion tag with region name
"Update # endregion tag with region name": located on the Cleaning- > Updae settings page. When this option is set to check, the # endregion area volume label is appended with the region name when the program code typesetting function is performed.
5. Alphabetize members of the same group
"Alphabetize members of the same group": located on the Reorganizing- > General settings page. When this option is set to check, alphabetical work items are added when the program code typesetting function is performed and sorted by member type.
On how to use CodeMaid automatic program typesetting to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.