Skip to content

Commit 295d898

Browse files
authored
Fix peek--get-references for lsp-use-plists (#743)
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.
1 parent fb10730 commit 295d898

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lsp-ui-peek.el

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,10 @@ references. The function returns a list of `ls-xref-item'."
726726
Returns item(s)."
727727
(-when-let* ((locs (lsp-request method params))
728728
(locs (if (listp locs)
729-
locs
729+
(if (symbolp (car locs))
730+
;; A single plist was returned
731+
(list locs)
732+
locs)
730733
(if (vectorp locs)
731734
(append locs nil)
732735
(list locs)))))

0 commit comments

Comments
 (0)