Home > OS >  How to automatically delete empty lines in VS code when formatting on C#?
How to automatically delete empty lines in VS code when formatting on C#?

Time:07-28

I have applied C# formatter on vs code that helps me formatting on save automatically, but I don't know how to set it up so that it deletes empty lines like code maid does on visual studio. I want to be able to set up rules when formatting. But cant figure it out how to set up the json of that formatteer.

Is there any extension that helps out with this? I tried installing Beautify but is isn't compatible with C#.

For example, I want to be able to delete lines 39 and 40 in the following code, but automatically as I type or at least as I save: enter image description here

CodePudding user response:

There is an vs code extension that does this: add lines 4 and 5

you can then set it up as you wish

  • Related