Open Lord-Turmoil opened 3 months ago
I don't have strong thoughts about what to do for the Toggle Comment command. However, for Edit.CommentSelection, I don't believe we should make this change as it will negatively impact StyleCop users who invoke this command twice to comment out code blocks with ////
and simultaneously distinguish them from commented text.
In general, I believe that only true comments (and not commented code) should have a preceding space.
I'd prefer to not change this at all. Not without substantially more feedback
Summary
As Visual Studio 2022 Preview introduced
Ctrl + /
as the default shortcut for toggling line comments, it reminds me of this long-existing issue that is quite annoying.In Visual Studio, the behavior of toggling line comment will not add space between
//
and the code and will not trim the space when uncommenting the code if there is any.However, Visual Studio Code and other IDEs like JetBrains will, which I think could be better.
This small detail significantly impacts the overall code style and requires extra effort to manually add or remove spaces in Visual Studio.
Proposed Feature
I suppose there shouldn't be any technical problem, just an editor action to add/remove the space when toggling a line comment.