-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed as not planned
Closed as not planned
Copy link
Labels
4 - In ReviewA fix for the issue is submitted for review.A fix for the issue is submitted for review.Area-IDEBugIDE-CodeStyleBuilt-in analyzers, fixes, and refactoringsBuilt-in analyzers, fixes, and refactorings
Milestone
Description
Version Used:
Verified in VS 16.7.0 Preview 3.1
Steps to Reproduce:
Ctrl+. on "new" -> "Convert to class" in the following fragment
var t1 = new
{
// Hi.
a = 1,
b = 2
};
Expected Behavior:
var t1 = new NewClass(
// Hi.
1,
2);
Actual Behavior:
var t1 = new NewClass(
1,
2
);
Note the lost comment. Preserving leading trivia from the initializers should help with indentation as well.
Regarding the whitespace after "2", note that the current behavior is similar to what happens in "Convert to tuple":
var t1 = (
// Hi.
a: 1,
b: 2
);
As you can see, indentation and comment are preserved, but the ugly whitespace after "2" remains.
I believe that having the closing parenthesis on the same line corresponds to the common style expected by users (as does having closing curly bracket on a separate line).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
4 - In ReviewA fix for the issue is submitted for review.A fix for the issue is submitted for review.Area-IDEBugIDE-CodeStyleBuilt-in analyzers, fixes, and refactoringsBuilt-in analyzers, fixes, and refactorings