Skip to content

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

Open
@JustinGrote

Description

@JustinGrote

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions