Skip to content
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

Fixed property value context with partially typed identifiers #1907

Merged
merged 1 commit into from
Mar 17, 2021

Conversation

majastrz
Copy link
Member

This fixes #1882. Also rewrote the logic using the SyntaxMatcher.IsTailMatch() pattern.

@majastrz majastrz force-pushed the majastrz/cant-handle-truth branch 2 times, most recently from 55c4e42 to 4c9b76c Compare March 17, 2021 05:22

case 4 when matchingNodes[^2] is IdentifierSyntax identifier && ReferenceEquals(propertyInfo.node.Value, identifier):
Copy link
Member Author

@majastrz majastrz Mar 17, 2021

Choose a reason for hiding this comment

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

The minimal fix would have been to change L428 to
case 4 when matchingNodes[^3] is VariableAccessSyntax variableAccess && matchingNodes[^2] is IdentifierSyntax _ && ReferenceEquals(propertyInfo.node.Value, variableAccess):

However, I've been opportunistically converting to the tail matcher pattern since it's more readable once you get used to it.

@majastrz majastrz enabled auto-merge (squash) March 17, 2021 05:27
@majastrz majastrz merged commit f9c3aad into main Mar 17, 2021
@majastrz majastrz deleted the majastrz/cant-handle-truth branch March 17, 2021 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bool property completions are missing when partially typed
2 participants