Hello everyone and Happy New Year’s Eve!
Some of us already started the new year!
Side Note
This post is very similar to this one, almost 4 years ago. I believe a staff member acknowledged this as a bug, but it still isn’t fixed. That is why I’m posting this as a feature request because now I’m starting to think this is intentional, which I find inconvenient.
As a Roblox developer, it is currently difficult to deal with the following behavior of toggle comment. When you use the feature on certain sections that already are commented, Studio adds an extra pair of dashes to them (essentially commenting a comment ). For example:
This is the already commented section of a script:
And this is what happens when you toggle comment after highlighting everything (even the currently commented ones:
As you can see, the lines that were previously commented are again being commented, thus the four dashes instead of two. This can be quite frustrating because if I want to uncomment it all, the original comment will still stay (since it first had 4 dashes, then 2 dashes), meaning I’ll have to uncomment twice as well.
This type of behavior is extremely inconvenient and I don’t see where it would be beneficial, so I propose that it should work more like how bolding pieces of text work. For example, if you have this:
Then, bolding the entire sentence doesn’t bold “behavior” and “bolding text” again.
Now if I were to unbold the entire thing, it’d all be unbolded, including “behavior” and “bolding text.” Applying this to toggle comment, commenting over already-commented parts should just ignore the section instead of adding the unnecessary dashes. This would alleviate having to uncomment twice since there wouldn’t be any “double-comments.”
If this was added, it would improve my development experience because I can toggle parts of my code “on and off” much more conveniently and using the behavior I’m already familiar with (e.g. the bolding behavior). If this behavior was intended, then I still believe it should be changed as I don’t find that it leaves a good UX. Plus, seeing 4 dashes for comment in your code is essentially an eyesore.
Use Case
Use Case
This is the “vision” of how it would be with the proposed behavior:
Before:
After:
No double-comments.
Now if I want to uncomment all, it would do so because there are no double-comments:
No need to uncomment twice!
Thank you for reading,
And Happy New Year (for those already there)!