Toggle the block comment without having to select it
See original GitHub issue- VSCode Version: 1.15.0
- OS Version: windows10
There is a problem that bothers me. If I want to remove the block comment, I have to select it, like this:
If I do not select it, and go to toggle block comment, it becomes:
Have you a good idea to solve it?
PS: I use this hot key ctrl+shift+/
to toggle block comments, which was bound to the command editor.action.blockComment
Reproduces without extensions: Yes
Issue Analytics
- State:
- Created 6 years ago
- Reactions:37
- Comments:18
Top Results From Across the Web
Toggle Line Comment and Toggle Block Comment commands ...
I expect that when I have multiple lines selected, that “Toggle Line Comment” will insert line comment characters // at the beginning of ......
Read more >visual studio C++ toggle comment ? comment while not whole ...
As for question one, it's the same shortcut pair: Ctrl+K, Ctrl+C to toggle any comments on, Ctrl+K, Ctrl+U to toggle any comments off....
Read more >How to make CTRL + / toggle a comment in Visual Studio
You can't make it toggle without going into either a macro or other VS extension. However, I always setup VS to comment with...
Read more >How to Filter, Block, and Report Harmful Content on Social ...
Go to your profile and select the menu button (3 horizontal lines) > Click Settings > Privacy > Comments > Use the toggle...
Read more >Comment and uncomment blocks of code | MPS - JetBrains
Press Ctrl+/ . If multiple nodes should be commented or uncommented with a single action, select all the nodes that should be affected...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello! Any plans to implement this? Would be an awesome feature that I really miss from sublime.
To be clear of the issue, if I have a block comment:
and while my cursor is anywhere in the comment, I try hit the block comment shortcut, it just makes another comment:
It should uncomment the block it’s inside of.
Lots of people telling me to use the expand-to-* (scope, brackets…) but that doesn’t work since in my example it’s both a an if block, but also the else if conditional.
Right now the only way is to manually select it all.
This does work if it’s a single line:
Agree with you. It’s quite inconvenient.
In Sublime Text, If the cursor in in commented code, When you press
cmd + /
(Mac) orctrl + /
(win),the comment is toggled, no matter it’s a line comment or block comment.It’s very useful, hope some change on toggle comment would be made.