How can I sort Fields, Properties and Methods in Visual Studio?

前端 未结 5 1392
迷失自我
迷失自我 2020-12-29 18:08

I know that for clarity in codes, I have to write first fields then constructor and then methods etc. But how can I automate it in Visual Studio?

5条回答
  •  轮回少年
    2020-12-29 19:00

    I think CodeMaid is the best free option for code formatting in Visual Studio.


    To sort your file, open the file via solution explorer:

    1. Right click the open file
    2. Code Maid menu (likely near the top of the right click menu)
    3. Click Reorganize Active Document

    Alternatively, using the default CodeMaid hotkeys CTRL+M,Z to sort your active file.

提交回复
热议问题