-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
[code-completion] Disable diagnostics during code completion and fix regressions #26888
[code-completion] Disable diagnostics during code completion and fix regressions #26888
Conversation
@swift-ci please test |
Build failed |
@swift-ci please test OS X Platform |
Build failed |
@swift-ci please test OS X Platform |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
It seems disabling diagnstics doesn't introduce any regression. rdar://problem/50679428
TypeCheckExprFlags::SuppressDiagnostics is now done by DiagnosticSuppression.
…ies" This reverts commit c6eade1.
…ics in code completion There were some changes to completion results because AST mutations that were made while diagnosing are no longer happening. This patch 1) changes expression type checking to allow unresolved types when solving constraint systems, so we get a solution and apply its types in more cases, and 2) fixes a parsing issue where we would drop a ternary expression completely if the code completion point was in its true branch.
91553b5
to
feb48a6
Compare
@swift-ci please test and merge |
@swift-ci test and merge |
This is just @rintaro's PR to disable diagnostics and merge diagnostic suppression mechanisms (#24842) but with additional fixes for cases the stress tester found where it regressed the completion results (the two test cases in
test/IDE/complete_in_closures.swift
).It changed the completion results because AST mutations were being made while diagnosing, and these are no longer happening. On top of Rintaro's changes, this PR 1) changes expression type checking for code completion to allow unresolved types when solving so we get a solution and apply the types it did manage to resolve in more cases, and 2) fixes a parsing issue where we would sometimes drop a ternary expression completely if the code completion point was in its true branch.
Resolves rdar://problem/50679428