Skip to content
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

[IDE] Disable constraint system diagnostics during code completion #24842

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented May 16, 2019

It seems disabling diagnostics doesn't introduce any regression.

rdar://problem/50679428

@rintaro
Copy link
Member Author

rintaro commented May 16, 2019

@swift-ci Please smoke test

@@ -2175,7 +2176,8 @@ Type TypeChecker::typeCheckExpressionImpl(Expr *&expr, DeclContext *dc,
// Construct a constraint system from this expression.
ConstraintSystemOptions csOptions = ConstraintSystemFlags::AllowFixes;

if (options.contains(TypeCheckExprFlags::SuppressDiagnostics))
if (options.contains(TypeCheckExprFlags::SuppressDiagnostics) ||
DiagnosticSuppression::isEnabled(Diags))
Copy link
Contributor

Choose a reason for hiding this comment

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

@xedin Do we really need both mechanisms?

Copy link
Contributor

Choose a reason for hiding this comment

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

@rintaro Shouldn't enabled diagnostic suppression mean SuppressDiagnostics flag while forming constraint system?

Copy link
Member Author

Choose a reason for hiding this comment

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

@xedin
Currently, DiagnosticSuppression does nothing related to TypeCheckExprFlags::SuppressDiagnostics.

@slavapestov
We can drop TypeCheckExprFlags::SuppressDiagnostics and consolidate it to DiagnosticSuppression.
Currently, we have only 2 usage of TypeCheckExprFlags::SuppressDiagnostics, and one of them is already under DiagnosticSuppression.

Copy link
Contributor

Choose a reason for hiding this comment

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

@rintaro I think DiagnosticSuppression::isEnabled returning true should correspond to ConstraintSystemFlags::SuppressDiagnostics flag set in ConstraintSystem so we only have one source of input about this in the solver.

Copy link
Member Author

Choose a reason for hiding this comment

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

I added another commit to consolidate TypeCheckExprFlags::SuppressDiagnostics with DiagnosticSuppression. Is this what you are suggesting?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I think the way you changed it is okay, I just how that we wouldn't need to decouple it again later...

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm all in favor of consolidating them. I don't have an opinion on which one is 'better', I just think it's confusing when there are two ways of doing the same thing :)

@rintaro
Copy link
Member Author

rintaro commented May 17, 2019

@swift-ci Please smoke test

@@ -233,9 +233,6 @@ enum class TypeCheckExprFlags {
/// that we force for style or other reasons.
DisableStructuralChecks = 0x02,

/// Set if the client wants diagnostics suppressed.
SuppressDiagnostics = 0x04,
Copy link
Contributor

Choose a reason for hiding this comment

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

Yay!

@nathawes
Copy link
Contributor

@swift-ci Please Build Toolchain macOS Platform

@swift-ci
Copy link
Contributor

macOS Toolchain
Download Toolchain
Git Sha - 581519ef303135e39b8f0b4d0386bae406f1507f

Install command
tar -zxf swift-PR-24842-310-osx.tar.gz --directory ~/

@rintaro
Copy link
Member Author

rintaro commented Jul 2, 2019

@swift-ci Please Sourcekit Stress test

It seems disabling diagnstics doesn't introduce any regression.

rdar://problem/50679428
TypeCheckExprFlags::SuppressDiagnostics is now done by
DiagnosticSuppression.
@rintaro rintaro force-pushed the ide-completion-disableexprdiag-rdar50679428 branch from 581519e to 1813202 Compare July 2, 2019 22:00
@rintaro
Copy link
Member Author

rintaro commented Jul 2, 2019

Added revert commit for #25922.

@rintaro
Copy link
Member Author

rintaro commented Jul 2, 2019

@swift-ci Please Sourcekit Stress test

@rintaro
Copy link
Member Author

rintaro commented Jul 2, 2019

@swift-ci Please smoke test

@rintaro
Copy link
Member Author

rintaro commented Aug 29, 2019

Superseded by #26888

@rintaro rintaro closed this Aug 29, 2019
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.

5 participants