go-language-server / protocol

Package protocol implements Language Server Protocol specification in Go
https://pkg.go.dev/go.lsp.dev/protocol
BSD 3-Clause "New" or "Revised" License
97 stars 15 forks source link

Error unmarshalling `ApplyEdit` response #38

Open dan1994 opened 2 years ago

dan1994 commented 2 years ago

When testing against vscode, using client.ApplyEdit fails when unmarshalling the response. It looks like the response structure should be struct{Applied bool `json:"applied"`}, but it's unmarshalled directly into the boolean result. I was able to confirm this by creating my own client that implements a patched ApplyEdit. It's probably worth taking into account the other optional fields declared by the spec[1].

[1] https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#applyWorkspaceEditResult