Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS 2019 - Toggle line comment shortcut not working?

Under Tools > Options > Environment > Keyboard is the setting Edit.ToggleLineComment

I can see that the shortcut for the selected command is set to Ctrl + / (Global)

I'd expect that when I pressed the shortcut, any selected code would be commented out, however, when pressing the shortcut nothing happens. What am I doing wrong?

like image 588
Thomas Harris Avatar asked Aug 28 '19 15:08

Thomas Harris


People also ask

How do I toggle comments in visual studio?

Both VS Code and Android Studio toggle line comments with Ctrl + / . That is, when the lines are already commented out, pressing Ctrl+/ un-comment them.

What is the shortcut for toggle block comment?

Comment and uncomment blocks of code From the main menu, select Code | Comment with Block Comment. Press Ctrl+Shift+/ .


1 Answers

For the default keyboard mapping scheme, Ctrl + / is assigned to EditorContextMenus.CodeWindow.GenerateDocumentationComments. Make sure to remove this shortcut first.

like image 162
Niels Evenblij Avatar answered Nov 29 '22 10:11

Niels Evenblij