Reputation: 708
My question is similar to How to add semicolon to the end of the line in visual studio code, but for Visual Studio 2019. The extensions mentioned in the answers, and others I've been able to find, only work in VS Code or earlier versions of VS it seems.
As @gavin so eloquently put it in that question:
... in vs code, when you write a method call, it automatically closes the open parameter for you and your cursor ended up before the ). Now if you want to write a new statement, you literally have to take your right hand off the jkl; position and click on the end or the right arrow key and then take your right hand back to the jkl; position to type the semicolon. I use shift + enter and it saves me around half a second for each statement to reposition my right hand
Upvotes: 12
Views: 21863
Reputation: 393
Adding semicolon can be done by "Edit"->"Advanced"->"Format Document". But first, configure JavaScript->Text Editor->Formatting->General to "Insert semicolons at statement ends" (I insert a screenshot below).
Upvotes: 0
Reputation: 2377
Upvotes: 12
Reputation: 181
I noticed that in the latest version of VS2019, if you are within parentheses and you type a semicolon (without any special shortcuts), it automatically moves it for you towards the end of the brackets where it should be. I don't have any special extensions installed for that.
It doesn't work for every situation. It seems that you need to be within brackets.
Upvotes: 6