Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiline starred jsdoc-like comments in VS Code

I want to comment out my code in this style

/**
 * This is
 * A multiline comment
 */

Is it possible to do with a shortcut?

EDIT 1:

https://github.com/Microsoft/vscode/issues/50301 Address this issue, however it does not work with a shortcut. I want to be able to select a block of code and comment it out in the style above

like image 276
Mantas Avatar asked Apr 26 '26 05:04

Mantas


2 Answers

How to comment out multiline/single line in VS Code:

  • macOS:

    Shift + Option + A

  • Windows And Linux core:

    Shift + Alt + A

How to remap/change these shortcuts?

Windows : File > Preferences > Keyboard Shortcuts.

MacOS : Code > Preferences > Keyboard Shortcuts.

You can search through the list both by keybindings (key names) and command names.

like image 141
Yaser Darzi Avatar answered Apr 27 '26 19:04

Yaser Darzi


I use this type of comment in VS Code but I don't think there is an shortcut for this. I usually do this by typing /**

Then JSDoc Comment is toggled and you can use that.

/**
 * This is
 * A multiline comment
 */

for more : click here

like image 31
Shivank chauhan Avatar answered Apr 27 '26 18:04

Shivank chauhan