Skip to content

[6.0] Rewrite test-sourcekit-lsp.py to not rely on --sync option in sourcekit-lsp #135

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

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Mar 26, 2024

ahoppen added 3 commits March 26, 2024 19:17
Stderr contains log output from sourcekit-lsp but we want to match the LSP communication that happens over stdin/stdout. It seems that the additional stderr output can confuse `FileCheck`.

rdar://125139888
…ekit-lsp

The `test-sourcekit-lsp` integration test sent all requests to `sourcekit-lsp` via stdin in one go and relies on the `--sync` option in sourcekit-lsp to handle one request at a time. It closes `stdin` when it reaches the end of the data it wants to send to sourcekit-lsp. With the refactored `JSONRPCConnection` implementation, this caused us to immediately close the connection, without waiting for any outstanding replies to be sent.

Rewrite `test-sourcekit-lsp.py` to actually wait for the request results. This also allows us to delete the `--sync` option of sourcekit-lsp and test a configuration of sourcekit-lsp that is a lot closer to what actual users are going to use.
…st reply

If sourcekit-lsp sent a `publishDiagnostics` notification, we would try to interpret it as a request reply. This failed because the notification wasn’t actually the reply to the request we were expecting.

Ignore all notifications or requests from sourcekit-lsp when waiting for a request reply to fix this issue.
@ahoppen ahoppen requested a review from bnbarham March 26, 2024 18:21
@bnbarham bnbarham merged commit fcd000f into swiftlang:release/6.0 Mar 26, 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