question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:open
  • Created 6 years ago
  • Reactions:37
  • Comments:18

github_iconTop GitHub Comments

21reactions
wesboscommented, Jan 21, 2021

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:

image

and while my cursor is anywhere in the comment, I try hit the block comment shortcut, it just makes another comment:

image

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:

image
5reactions
TooBugcommented, Aug 18, 2017

Agree with you. It’s quite inconvenient.

In Sublime Text, If the cursor in in commented code, When you press cmd + /(Mac) or ctrl + /(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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found