-
Notifications
You must be signed in to change notification settings - Fork 323
Add a command that cycles between no comment, double-slash, triple-slash #4255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Unfortunately "Toggle Line Comment" is entirely a VS Code feature that's driven by a static language configuration we provide it that only supports a single set of comment markers. I've an open issue with VS Code about extending this here (which you can 👍!): We have added a Toggle Dartdoc Comment command that does similar for triple-slashes in the meantime (although now I'm wondering if there's value in a single command that just goes through all three states - no comment, double slash, triple slash, so you don't need two keybindings 🤔). |
I think a command that cycles through those three states would be great. |
Yeah, not sure why I didn't do that previously. This command is already doing the work to figure out what the current comments across the selection look like. I'll re-purpose this issue to add a command that cycles through them. Thanks! |
I've done this, and it works fine, though I'm now wondering whether cycling through three is the best option or whether it should just be a replacement for Toggle Line Comment (eg. only ever adds double slashes), it is just smarter about removing the triple slashes (which was your original request). I'm wondering if there's much call to add triple-slashes to existing uncommented/double-slashed code or whether it's mostly just used for commenting/uncommenting chunks with double-slashes. Thoughts? (we could ofc add both, but giving descriptive names to them might be harder... "Cycle Line Comment" vs "Toggle Line Comment"?) |
If I press Ctrl+/ (Toggle Line Comment) on a Dartdoc line, currently the line gets transformed from:
/// Dartdoc line
to:
Even though it'd be asymmetric with adding a comment, I think it'd be nice if uncommenting removed either
//
or///
. This would be particularly useful if I'm writing a Dartdoc comment, press Enter, which automatically adds///
to the next line, but don't actually want the next line to be a Dartdoc comment.I'm using v3.52.1 of the Dart VS Code extension.
The text was updated successfully, but these errors were encountered: