Skip to content

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

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

Cherry-pick #25922 to swift-5.1-branch. Reviewed by @xedin and @rintaro


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

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
Copy link
Contributor Author

@swift-ci please test

@benlangmuir
Copy link
Contributor Author

@swift-ci please nominate

  • Explanation: 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.
  • Scope: Code completion inside @functionBuilder closure and function bodies.
  • Issue: rdar://52356229
  • Risk: Low
  • Testing: Performance improvement verified manually in complex SwiftUI examples. No correctness regressions in existing tests.
  • Reviewer: @xedin and @rintaro

@benlangmuir benlangmuir merged commit 4031070 into swiftlang:swift-5.1-branch Jul 2, 2019
@benlangmuir
Copy link
Contributor Author

Ted approved.

@benlangmuir benlangmuir deleted the cc-dsl-slow-51 branch July 2, 2019 18:05
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.

1 participant