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

completion: Support completion for optional chaining (&.) #827

Merged

Conversation

tk0miya
Copy link
Contributor

@tk0miya tk0miya commented Jul 1, 2023

The optional chaining allows to developers to call method only if the receiver is not nil. Therefore, CompletionProvider should consider the receiver is not nil if the optional chaining operator is given.

This fix unwraps the Optional[T] from receiver_type on completion for the optional chaining. It will provide better completion for developers.

The optional chaining allows to developers to call method only if the
receiver is not nil.  Therefore, CompletionProvider should consider the
receiver is not nil if the optional chaining operator is given.

This fix unwraps the Optional[T] from receiver_type on completion for
the optional chaining.  It will provide better completion for
developers.
Copy link
Owner

@soutaro soutaro left a comment

Choose a reason for hiding this comment

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

Thank you for opening this PR.
Posted some suggestions.

@tk0miya
Copy link
Contributor Author

tk0miya commented Jul 3, 2023

Thank you for your wisdom. Updated!

Copy link
Owner

@soutaro soutaro left a comment

Choose a reason for hiding this comment

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

👍

@soutaro soutaro merged commit 1101dd6 into soutaro:master Jul 4, 2023
@tk0miya tk0miya deleted the support_optional_chaining_on_completion branch July 4, 2023 02:07
@soutaro soutaro added this to the Steep 1.5 milestone Jul 5, 2023
@soutaro soutaro added the Released The PR is already included in a published release label Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Released The PR is already included in a published release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants