-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing some semantic model and refactoring issues with deconstruction #12381
Conversation
@@ -61,9 +61,13 @@ public override SyntaxNode VisitLocalDeclarationStatement(LocalDeclarationStatem | |||
{ | |||
node = (LocalDeclarationStatementSyntax)base.VisitLocalDeclarationStatement(node); | |||
|
|||
if (node.Declaration.IsDeconstructionDeclaration) | |||
{// PROTOTYPE(tuples) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish to remove this marker before merging, but I'm not sure if additional scenarios need to be covered where variables need to be removed.
I'll check with the @dotnet/roslyn-ide team.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@heejaechang Let me know if you could review this PR and in particular the ExtractMethod refactoring question above.
I'm happy to stop by and provide some context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the benefit of the "PROTOTYPE" comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@CyrusNajmabadi I intend to remove this PROTOTYPE marker before checking in. The question here is whether this behavior is sufficient, or if I should add logic for removing variables.
I'm not familiar enough with scenarios involving removing variables, so I'm not sure if it could be applicable to deconstructions. I'm guessing it's not applicable.
👍 for tests and inline temp. You might want @heejaechang to look at the extract method changes. |
@gafter Could you review the compiler changes in this small PR? |
Compiler changes LGTM. |
} | ||
}"; | ||
|
||
await TestAsync(code, expected, index: 0, compareTokens: false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't set compareTokens:false unless you are specifically testing formatting for the feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Thanks
other than question about BoundLocalDeconstructionDeclaration, and we can come back to that later, LGTM |
@heejaechang @CyrusNajmabadi Let me know if you have any other feedback. I plan to merge before lunch (this is blocking merging the feature back into the master branch). Thanks |
👍 @balajikris extract method has its own syntax node replace since it was written before we had SyntaxNode.Replace API. at some point, probably need to replace extract method's own syntax node replace implementation to just official SyntaxNode.Replace |
I'm good with the IDE side. |
Thanks all for the review and feedback! |
There are few issues fixed:
CC @dotnet/roslyn-ide @dotnet/roslyn-compiler for review.
Related to #11299