Skip to content

Conversation

@ahoppen
Copy link
Member

@ahoppen ahoppen commented Jul 2, 2024

  • Explanation: 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.
  • Scope: sourcekitd requests that take more than 2 minutes
  • Risk: Low, no reasonable sourcekitd request should take more than 2 minutes and users can override the timeout duration as a workaround
  • Testing: Added test case
  • Issue: rdar://130948453
  • Reviewer: @hamishknight on Add a maximum duration for sourcekitd requests #1543

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 a review from bnbarham July 2, 2024 21:07
@ahoppen
Copy link
Member Author

ahoppen commented Jul 2, 2024

@swift-ci Please test

@ahoppen ahoppen enabled auto-merge July 2, 2024 21:10
@ahoppen ahoppen merged commit 8c811b5 into swiftlang:release/6.0 Jul 2, 2024
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