Skip to content

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
@ahoppen ahoppen deleted the time-out-sourcekitd branch August 4, 2025 10:48
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