Skip to content

[CodeCompletion] Support SE-0253 callAsFunction() #30368

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

Merged

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Mar 11, 2020

  • In member completions, when 'callAsFunction' decls are found, suggest call patterns as well
  • In call pattern completions, fallback to search 'callAsFunction' if the base type is not a function type

rdar://problem/59792682

- In member completions, when 'callAsFunction' decls are found, suggest
  call patterns
- In call pattern completions, fallback to search 'callAsFunction' if
  the base type is not a function type

rdar://problem/59792682
@rintaro
Copy link
Member Author

rintaro commented Mar 11, 2020

@swift-ci Please smoke test

@rintaro rintaro requested a review from benlangmuir March 11, 2020 23:30
Copy link
Contributor

@benlangmuir benlangmuir left a comment

Choose a reason for hiding this comment

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

LGTM, but what do you think of also turning the completion for the value into a call?

add3

into

add3
add3(x: <##>, y: <##>)

Would that be too expensive to compute for all variables in scope?

@rintaro
Copy link
Member Author

rintaro commented Mar 11, 2020

Hm, we don't do that even for function type values (rdar://problem/44826862) so far. Filed rdar://problem/60347865 for the enhancement.

@rintaro rintaro merged commit ddaad60 into swiftlang:master Mar 12, 2020
@rintaro rintaro deleted the ide-completion-callasfunction-rdar59792682 branch March 12, 2020 01:16
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.

2 participants