Skip to content

[code-completion] Disable diagnostics in @functionBuilder bodies #25922

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
merged 1 commit into from
Jul 2, 2019

Conversation

benlangmuir
Copy link
Contributor

@benlangmuir benlangmuir commented Jul 1, 2019

When performing code-completion inside the body of a @functionBuilder
closure/function, set the flag to suppress diagnostics. This works
around a big performance problem in some complex bodies that do not
typecheck, which is typical during code-completion. A real-world example
with SwitfUI went from ~50 seconds to 0.5. We do not disable diagnostics
in general because the diagnostic paths provide falback types that are
useful to code-completion.

rdar://52356229

@benlangmuir benlangmuir requested review from rintaro and xedin July 1, 2019 20:59
@benlangmuir
Copy link
Contributor Author

Note: we have #24842 open to do this for all code-completions, but we need to figure out a plan to recover from the regressions that we saw there. For now, just do this for DSL closures.

@benlangmuir
Copy link
Contributor Author

@swift-ci please test

@benlangmuir
Copy link
Contributor Author

@swift-ci please test

@swiftlang swiftlang deleted a comment from swift-ci Jul 1, 2019
@swiftlang swiftlang deleted a comment from swift-ci Jul 1, 2019
When performing code-completion inside the body of a @functionBuilder
closure/function, set the flag to suppress diagnostics. This works
around a big performance problem in some complex bodies that do not
typecheck, which is typical during code-completion. A real-world example
with SwitfUI went from ~50 seconds to 0.5. We do not disable diagnostics
in general because the diagnostic paths provide falback types that are
useful to code-completion.

rdar://52356229
@benlangmuir benlangmuir force-pushed the cc-dsl-slow branch 2 times, most recently from 8f33ec2 to c6eade1 Compare July 2, 2019 14:34
@benlangmuir
Copy link
Contributor Author

@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.

3 participants