-1

I've got used to VSC clean up my code, while working with React. Now that I'm using C#, I'm not able to find anything like prettier for this language. I'm looking for some way of setting up my VSCode to do this for me, stuff like: removing white spaces, adding semicolons after each end of the code snippet, broke the lines if the code line was too long (like a long array or parameters). Is there any way for that or was it just one of bonuses of writing in javascript?

mil0s2
  • 11
  • 1
  • Maybe this?: https://stackoverflow.com/questions/29973357/how-do-you-format-code-in-visual-studio-code-vscode – ProgrammingLlama Jun 03 '22 at 17:44
  • 1
    What do you mean add semicolons? – Blindy Jun 03 '22 at 17:45
  • Asking for favorite tools/resources is off-topic. There are plenty of code formatters for C# (which you presumably already looked at after https://www.bing.com/search?q=Prettier+extension%2C - make sure to include results of your research when moving the question to likely more appropriate [softwarerecs.se] site), but you seem to be asking for something else. As @Blindy pointed out it is very unclear what you expect such extension should do - do you need it to fix syntax errors in the code automatically ("add semicolon" )? – Alexei Levenkov Jun 03 '22 at 17:51
  • Sorry if I was unclear. I meant when I was using Prettier (and maybe part of it was TSLint?) in React it formatted my code automatically, meaning stuff like: removing white spaces, adding semicolons after each end of the code snippet, broke the lines if the code line was too long (like a long array or parameters) and it did it automatically after a save. Just organized code in a standardized way so it has the same structure no matter how I wrote it, even if I wrote it all in one line. You're right, I've searched for something like this for free on Google, didn't find it. – mil0s2 Jun 04 '22 at 22:59
  • Also just wanted to add, that like automatic change from single to double quotes and always adding space after comma and stuff like that – mil0s2 Jun 04 '22 at 23:16

1 Answers1

2

Resharper, Code Maid Probably others as well

Nigel
  • 2,961
  • 1
  • 14
  • 32