File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -4517,11 +4517,15 @@ and the position respectively."
4517
4517
(lsp:location-link-target-selection-range loc)))
4518
4518
4519
4519
(defun lsp--locations-to-xref-items (locations)
4520
- "Return a list of `xref-item' from Location[] or LocationLink[]."
4521
- (setq locations (if (sequencep locations)
4522
- (append locations nil)
4523
- (list locations)))
4524
-
4520
+ "Return a list of `xref-item' given LOCATIONS, which can be of
4521
+ type Location, LocationLink, Location[] or LocationLink[]."
4522
+ (setq locations
4523
+ (if (and (sequencep locations)
4524
+ (let ((fst (lsp-seq-first locations)))
4525
+ (or (lsp-location? fst)
4526
+ (lsp-location-link? fst))))
4527
+ (append locations nil)
4528
+ (list locations)))
4525
4529
4526
4530
(cl-labels ((get-xrefs-in-file
4527
4531
(file-locs)
You can’t perform that action at this time.
0 commit comments