Skip to content
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

LSP Client Initialize should return after capabilities response and not wait until server Initialized Message #1408

Open
JustinGrote opened this issue Dec 3, 2024 · 0 comments

Comments

@JustinGrote
Copy link

JustinGrote commented Dec 3, 2024

The Debug Adapter Protocol spec states:

Initialization happens first, and the debug adapter must respond to the initialize request with any capabilities before any further communication can take place.
At any point after the client receives the capabilities, it sends a launch or attach request.
Once the debug adapter is ready to receive configuration from the client, it sends an initialized event to the client. As described above, the client sends zero or more configuration-related requests before sending a configurationDone request.

It is valid for the client to send launch/attach requests prior to initialized being received from the server, and this is required for some DAP extensions (PowerShell), but without getting the client adapter back from the await, this is currently not possible with the client.

Workaround

Add a OnInitialized handler that completes a TaskCompletionSource with the client early, and don't wait on the From or InitializeClient Tasks.

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

No branches or pull requests

1 participant