开发者

Visual Studio New Line Formatting

开发者 https://www.devze.com 2023-01-13 05:07 出处:网络
I\'m new to visual studio, so perhaps this is something easy... but I\'ve had no luck finding how to solve this formatting issue.

I'm new to visual studio, so perhaps this is something easy... but I've had no luck finding how to solve this formatting issue.

I would like for VS to auto format this

int x = 
5;

like this

int x = 5;

When I type this in and开发者_开发知识库 select 'Format Document' nothing changes.

It will also not remove unnecessary newlines such as

MyClass someClass = 

    new MyClass();

Any help for this would be great!


Visual studio can't fix that. You can do it with the Replace All dialog + regex if you are careful.


jgauffin is right. However you can format other items to speed up the process.

Tip for key combinations for general reformatting

Tip for using a macro to modify all files in your solution

0

精彩评论

暂无评论...
验证码 换一张
取 消