Skip to content

[5.3][CodeCompletion] Disable multi trailing closure completion at newline #33266

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 Aug 3, 2020

Cherry-pick of #33262 into release/5.3

  • Explanation: Fix an issue where code completion doesn't suggest let/var decls initialized with trailing closure expression at next line of the declaration. This was caused by multiple trailing closure completion recently introduced. As a workaround, disable trailing closure completion on newline positions.
  • Scope: Code completion at next line of trailing closures
  • Risk: Low
  • Testing: Added regression test cases
  • Issue: rdar://problem/66456159
  • Reviewer: Ben Langmuir (@benlangmuir)

@rintaro rintaro requested a review from a team as a code owner August 3, 2020 20:44
@rintaro
Copy link
Member Author

rintaro commented Aug 3, 2020

@swift-ci Please test

@theblixguy theblixguy added the r5.3 label Aug 3, 2020
  let value = SomeThing {
    ...
  }
  <HERE>

Since Parser parses code-completion token as a part of the expression,
completion failed to suggest 'value'. Also, the type of 'value' is
often '<<error type>>' because of the code completion token.

For now, disable additional trailing closure completion (suggesting
'label: { <#code#> }') on newline positions. Users still get the
compltion on the same line as the closing brace.

rdar://problem/66456159
(cherry picked from commit 5936ddb)
@rintaro rintaro force-pushed the 5.3-ide-completion-rdar66456159 branch from cb2f974 to e7360e0 Compare August 3, 2020 21:29
@rintaro
Copy link
Member Author

rintaro commented Aug 3, 2020

@swift-ci Please test

@swift-ci

This comment has been minimized.

@swift-ci

This comment has been minimized.

@rintaro
Copy link
Member Author

rintaro commented Aug 3, 2020

Windows: Build Status

@rintaro
Copy link
Member Author

rintaro commented Aug 3, 2020

@swift-ci Please nominate

@akyrtzi
Copy link
Contributor

akyrtzi commented Aug 4, 2020

@swift-ci test OS X platform

@rintaro rintaro merged commit 17098b1 into swiftlang:release/5.3 Aug 4, 2020
@rintaro rintaro deleted the 5.3-ide-completion-rdar66456159 branch August 4, 2020 04:28
@AnthonyLatsis AnthonyLatsis added swift 5.3 🍒 release cherry pick Flag: Release branch cherry picks labels Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 5.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants