Skip to content

Add a maximum duration for sourcekitd requests #1543

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, 2024

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Jul 2, 2024

VS Code does not cancel semantic tokens requests. If a source file gets into a state where an AST build takes very long, this can cause us to wait for the semantic tokens from sourcekitd for a few minutes, effectively blocking all other semantic functionality in that file.

To circumvent this problem (or any other problem where an editor might not be cancelling requests they are no longer interested in) add a maximum request duration for SourceKitD requests, defaulting to 2 minutes.

rdar://130948453

@ahoppen ahoppen requested review from bnbarham and hamishknight July 2, 2024 07:27
@ahoppen ahoppen force-pushed the time-out-sourcekitd branch from d74e630 to f181b45 Compare July 2, 2024 07:28
@ahoppen
Copy link
Member Author

ahoppen commented Jul 2, 2024

@swift-ci Please test

VS Code does not cancel semantic tokens requests. If a source file gets into a state where an AST build takes very long, this can cause us to wait for the semantic tokens from sourcekitd for a few minutes, effectively blocking all other semantic functionality in that file.

To circumvent this problem (or any other problem where an editor might not be cancelling requests they are no longer interested in) add a maximum request duration for SourceKitD requests, defaulting to 2 minutes.

rdar://130948453
@ahoppen ahoppen force-pushed the time-out-sourcekitd branch from f181b45 to 191d366 Compare July 2, 2024 20:47
@ahoppen
Copy link
Member Author

ahoppen commented Jul 2, 2024

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Jul 2, 2024

@swift-ci Please test Windows

@ahoppen ahoppen merged commit ef2dc17 into swiftlang:main Jul 2, 2024
3 checks passed
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