Skip to content

[CodeCompletion] Fix completion for local decls in trailing closure #19709

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

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Oct 4, 2018

Previously, local decls in trailing closure didn't show up if the closure had preceding arguments and the completion was triggered at beginning position of expression context. like:

   funcName(x: arg1) {
      var localVar = 12
      if <HERE>
   }

The completion mode used to be overwritten in completeCallArg() which is called from parseExprCallSuffix(). We should detect completion for immediate argument position in parseExprList().

rdar://problem/41869885

Previously, local decls in trailing closure didn't show up if the
closure had preceding arguments and the completion was triggered at
beginning position of expression context. like:

   funcName(x: arg1) {
      var localVar = 12
      if <HERE>
   }

The completion mode used to be overwritten in 'completeCallArg()' which
is called from 'parseExprCallSuffix(). We should detect completion for
immediate argument position in 'parseExprList()'.

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

rintaro commented Oct 4, 2018

@swift-ci Please smoke test

@rintaro rintaro requested a review from benlangmuir October 4, 2018 08:45
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.

Nice simplification!

@benlangmuir benlangmuir merged commit f08c2b0 into swiftlang:master Oct 4, 2018
@rintaro rintaro deleted the ide-completion-trailingclosurelocal-rdar41869885 branch October 4, 2018 22:38
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