lsp-types
lsp-types copied to clipboard
Empty array is always assumed to be a `Flat` in `DocumentSymbolResponse`
An empty array in DocumentSymbolResponse
is always interpreted as Flat([])
. When the server is known to always return a Nested
result, this makes it inconvenient to handle the result. A similar situation happens with GotoDefinitionResponse
, where an empty array is always assumed to be an array of Location
s instead of LocationLink
s.
Would it be worthwhile to provide an option to control which variant an empty array deserializes as? It can be implemented by declaring an alternative enum with different ordering of variants, but that seems a bit boilerplate.