Allow other characters for closing labels to distinguish from comments. (//)
See original GitHub issuePlease allow to change the character and / or other styles of the closing labels I see in VS Code. Currently they look like comments. This triggers me.
For example change the //
slashes to #
hashtag or /
single slash or -
minus, etc… (just an user input)
Or nothing. I don’t think the syntax matters. No need for slashes.
Changing the color and / or opacity would be also great.
Setting: dart.closingLabels
Issue Analytics
- State:
- Created 2 years ago
- Reactions:6
- Comments:6 (2 by maintainers)
Top Results From Across the Web
The HTML Comment Tag: Here's How To Use It In Your Code »
Another thing you can do is put comments after closing tags, to help you find where a particular element ends. (This can be...
Read more >Tags used in HTML
There is no closing tag. Example sections. These styles allow text of fixed-width characters to be embedded absolutely as is into the document....
Read more >HTML - Comments - Tutorialspoint
HTML - Comments, Comment is a piece of code which is ignored by any web browser. ... may not appear inside a comment...
Read more >Using modern comments in Word - Microsoft Support
Modern comments aligns the commenting experience across Word platforms and other Office apps, especially Word, Excel, and PowerPoint. Two ways to view comments....
Read more >How to Add Comments in CSS for Yourself or Your Developer
Finally, we'll cover another CSS commenting method you should avoid. Let's get started. How to Comment in CSS. To comment in CSS, simply...
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
@DanTup Yes, thanks. It’s much better.
The closing labels are very helpful. But it’s also annoying when they look like comments. I don’t like comments behind a line. And the pseudo comments are not selectable, which is right. But it triggers me. ^^ Especially when I’m refactoring code.
So it would be nice if the slashes
//
can be changed by the user. https://github.com/Dart-Code/Dart-Code/blob/v3.27.2/src/extension/decorations/closing_labels_decorations.ts#L60-L69 If this is the right code, we could replace this with a variable, a setting with a string input. So that users can define what they want. For example three slashes///
or a hash symbol#
or hyphens--
or arrows>
or xml like</
or just nothing (empty string).It’s just a suggestion. The color option is helpful as well. Personally, I wouldn’t render syntax-reserved stuff because it can be as confusing as it currently is. Since it looks like real code. … But to be honest, I have to try a few options first to find a suitable solution. I could simulate a few solutions with the dev mode inpsector and replace the after content in CSS to make a final decision.
If this is a trivial and painless solution then why not just put an option for this prefix. Currently I tested some characters and just set the opacity (alphe
#RRGGBBAA
) to0x32
(half of real comments.)(Just a few first tries. Maybe not my final solution. Less prominent, but good to read without clashing with the rest of the code.)
What do you think? I would vote for it. But I submit to the crowd.
The close label indicator feature is great, but it’s really annoying that it’s hard to distinguish from real comments.
My current solution is adding this to settings.json:
A less prominent appearance and different from comments. But you need a real comment as reference. Therefore it’s maybe not the worst idea to use other characters to identify.
If we add an option to customize the text, I would suggest prefix and suffix. To allow something like
-- Text
an(Text)
etc. Or just something like"dart.closingLabelsString": "/* $1 */"
But only a suffix is also great. Maybe other style can also help. Like font-size? Idk. Just separate from real comments. Or improve Dart / Flutter design making closing labels annotations unnecessary. …