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

CompletionItemKind can not be deserialized #2

Closed kirides closed 4 years ago

kirides commented 5 years ago

Server can not deserialize capabilities request because TextDocumentClientCapabilitiesCompletion.CompletionItemKind is now an object instead of a plain number.

Before:

// TextDocumentClientCapabilitiesCompletion Capabilities specific to the `textDocument/completion`
type TextDocumentClientCapabilitiesCompletion struct {
// ...
    CompletionItem // ...
        // This here is not a plain number anymore
    CompletionItemKind CompletionItemKind `json:"completionItemKind,omitempty"`
// ...
}

After:

// TextDocumentClientCapabilitiesCompletion Capabilities specific to the `textDocument/completion`
type TextDocumentClientCapabilitiesCompletion struct {
// ... 
    CompletionItem ...
// ...
        // better would be an additional struct instead of an inline one
    CompletionItemKind struct {
        ValueSet []CompletionItemKind `json:"valueSet,omitempty"`
    } `json:"completionItemKind,omitempty"`

// ...
}