Skip to content

Introduce Parameter: Do not show code action if highlighted expression's parent is member access expression#55143

Merged
akhera99 merged 1 commit intodotnet:mainfrom
akhera99:fix_introduce_param_deconstruction
Jul 27, 2021
Merged

Introduce Parameter: Do not show code action if highlighted expression's parent is member access expression#55143
akhera99 merged 1 commit intodotnet:mainfrom
akhera99:fix_introduce_param_deconstruction

Conversation

@akhera99
Copy link
Copy Markdown
Member

Fixes: #54878

@akhera99 akhera99 self-assigned this Jul 27, 2021
@akhera99 akhera99 requested a review from a team as a code owner July 27, 2021 19:18
@ghost ghost added the Area-IDE label Jul 27, 2021

// Need to special case for expressions whose direct parent is a MemberAccessExpression since they will
// never introduce a parameter that makes sense in that case.
if (syntaxFacts.IsNameOfAnyMemberAccessExpression(expression))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so, i don't have an objection to ths. but what you're doing is building a disallow-list. When that happens we should always ask: should this be an allow-list instead. Specifically, should we instead be enumerating the set of cases we know are valid to extract as opposed to trying to enumerate the set of cases that should be blocking?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking about this when looking at the code, but I feel like enumerating the cases that are allowed would be more lengthy than the blocking list.

Copy link
Copy Markdown
Member

@davidwengier davidwengier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this @akhera99

@akhera99 akhera99 merged commit fd1e0e1 into dotnet:main Jul 27, 2021
@ghost ghost added this to the Next milestone Jul 27, 2021
@allisonchou allisonchou modified the milestones: Next, 17.0.P3 Jul 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Introduce parameter issue for named tuple deconstruction

5 participants