Skip to content

[CodeCompletion] Typecheck without CodeCompletionExpr #32283

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 Jun 9, 2020

when falling back to "postfix expression completion" after labeled trailing closure completion.

There were cases where we cannot get any information from ExprContextAnalysis. We used to give up providing postfix completions after trailing closures. e.g.

        VStack {
            Text("Hello, world!")
        } #^HERE^#

In such cases, re-type checking is needed, but without CodeCompletionExpr after the closure.

rdar://problem/64176730

@rintaro rintaro force-pushed the ide-completion-postfixfallback-rdar64176730 branch 2 times, most recently from 2cfa02c to 0263a21 Compare June 9, 2020 23:05
@rintaro
Copy link
Member Author

rintaro commented Jun 9, 2020

@swift-ci Please smoke test

@rintaro rintaro requested a review from benlangmuir June 10, 2020 16:18
@rintaro
Copy link
Member Author

rintaro commented Jun 10, 2020

@swift-ci Please smoke test

@rintaro
Copy link
Member Author

rintaro commented Jun 10, 2020

@swift-ci Please smoke test Linux

func testFallbackPostfix() {
MyStruct4 {
1
} #^INIT_FALLBACK^#
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to test without a trailing closure, or is that the only time it reproduces? Also, maybe a test that uses a non-default argument as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

The problem only happens after trailing closures because otherwise they are parsed as normal postfix expression completions.

Added a test case with non-defaulted arguments

when falling back to "postfix expression completion" after labeled
trailing closure completion.

rdar://problem/64176730
@rintaro rintaro force-pushed the ide-completion-postfixfallback-rdar64176730 branch from 0263a21 to 5db0f1a Compare June 16, 2020 04:40
@rintaro
Copy link
Member Author

rintaro commented Jun 16, 2020

@swift-ci Please smoke test

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