Open vsfeedback opened 3 years ago
I can't repro this at all.
Talked about what we do today as well as if this behavior was desirable. Discussion was relatively short. Will mark as help-wanted as the behavior is desirable even if it may be difficult to accomplish. Any contributor who want to work on this should start a discussion in https://github.com/dotnet/roslyn/discussions to outline their approach and/or get assistance from the team.
This issue has been moved from a ticket on Developer Community.
[severity:It bothers me. A fix would be nice] I'd like the start of a rest-of-line comment (starts with // in C#, and with ' in VB.NET) to stay at the same position when code before the comment gets reformatted.
It did/does so in Visual Studio 6 and the Excel Visual Basic editor.
Examples - first what I've been used to for years, and what I'd like to have again:
VBA6 (Excel 2010), before
VBA6 (Excel 2010), after (Beautification of code occurs automatically as soon as the insertion mark leaves the code line.)
(as you see, the ' stays below the capital E of "TestEnum")
VB6 (1999/2999), before
VB6 (1999/2999), after (Beautification of code occurs automatically as soon as the insertion mark leaves the code line.)
Same as above.
Only when there's not enough space after the beautified code (at least one space), the comments get shifted to the right here in Visual Studio 6 and the VBA6 editor.
Now for the new behavior (Microsoft Visual Studio Community 2019, Version 16.9.2):
VB.NET, before
VB.NET, after (Beautification of code occurs automatically as soon as the insertion mark leaves the code line.)
C#, before
C#, after (Beautification of code occurs after copy/repaste or replacing e. g. the closing curly brace with another closing curly brace)
As you see, the comments have been shifted to the right, one position for each inserted space.
When otoh spaces get deleted, the comments stay where they are in VB(A)6, but are shifted to the left in Visual Studio 2019.
Anything but severe, but requires a bit more of superfluous effort to place comments aligned with one another.
Original Comments
Feedback Bot on 3/22/2021, 10:49 PM:
Thank you for taking the time to provide your suggestion. We will do some preliminary checks to make sure we can proceed further. We'll provide an update once the issue has been triaged by the product team.