Closed erikarvstedt closed 1 year ago
@yyoncho, can lsp-request
ever return a vector for methods textDocument/references
or textDocument/definition
?
If no, we can simplify the fixed fn.
@erikarvstedt the solution is usually to use seq
methods to handle the cases when it is unclear whether the result is list or vector.
@yyoncho, using seq
doesn't help in this specific case.
Which JSON objects in server responses are deserialised as vectors?
textDocument/{references,definition}
will probably never return vectors as the top-level object, right?
@erikarvstedt vector is returned for json vectors when using native json deserialization. When it is not used - you get list.
Alright, then this PR can be merged.
Alright, then this PR can be merged.
In general lsp-use-plists should not be used outside of lsp-protocol.el
Fixed.
This fixes
lsp-ui-peek-find-definitions/references
whenlsp-use-plists
ist
and a single item is returned by the server.Copy of commit msg
When
lsp-use-plists
is t,lsp-request
returns a single plist (of form(:key val ...)
or a list of plists.Previously, when
lsp-use-plists
was t and a single plist was returned, the plist wasn't wrapped into a list, causing the subsequent code to fail.