Skip to content

[SourceKit] Re-enable cancellation of non-completion requests #60573

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
Aug 17, 2022

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Aug 16, 2022

This enables the ability to cancel requests, which aren’t code completion requests, again.

Previous crashes in SILGen are prevented by disabling cancellation during the SIL stages. Instead, we add dedicated cancellation checkpoints before and after SIL.

rdar://98390926

This enables the ability to cancel requests, which aren’t code completion requests, again.

Previous crashes in SILGen are prevented by disabling cancellation during the SIL stages. Instead, we add dedicated cancellation checkpoints before and after SIL.

rdar://98390926
@ahoppen ahoppen requested a review from bnbarham August 16, 2022 14:02
@ahoppen
Copy link
Member Author

ahoppen commented Aug 16, 2022

@swift-ci Please test

// RUN: not %sourcekitd-test -req=diags %s -print-raw-response -id=diag -async -- %s == -cancel=diag 2>&1 | %FileCheck %s

func foo(x: Invalid1, y: Invalid2) {
x / y / x / y / x / y / x / y
Copy link
Contributor

Choose a reason for hiding this comment

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

Not the biggest fan of these tests (same with the CursorInfoTest cases). It's okay for this PR, but IMO we should add a wait either somewhere in type checking or just in ASTBuildOperation that continues once it's set. That would allow something like:

// RUN: not %sourcekitd-test -req=diags %s -print-raw-response -id=diag -async -wait -- %s == -cancel=diag == -continue

Could even have different sections we wait at, eg. before type checking, during, after, etc.

@ahoppen ahoppen merged commit 9b85072 into swiftlang:main Aug 17, 2022
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