Skip to content

Commit db58f24

Browse files
committed
Resolved detail may be different from unresolved detail
1 parent d6d8f6d commit db58f24

File tree

1 file changed

+6
-20
lines changed

1 file changed

+6
-20
lines changed

lsp-completion.el

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -463,25 +463,11 @@ The MARKERS and PREFIX value will be attached to each candidate."
463463
(defun lsp-completion--get-documentation (item)
464464
"Get doc comment for completion ITEM."
465465
(or (get-text-property 0 'lsp-completion-item-doc item)
466-
(-let* ((unresolved-item (get-text-property 0 'lsp-completion-unresolved-item item))
467-
(has-unresolved-detail (lsp:completion-item-detail? unresolved-item))
468-
(resolved (get-text-property 0 'lsp-completion-resolved item))
469-
(completion-item (if resolved
470-
(get-text-property 0 'lsp-completion-item item)
471-
unresolved-item))
472-
((&CompletionItem :detail?
466+
(-let* (((&CompletionItem :detail?
473467
:documentation?)
474-
completion-item))
475-
476-
(unless (or resolved (and detail? documentation?))
477-
(setq completion-item (get-text-property 0 'lsp-completion-item (lsp-completion-resolve item))
478-
resolved t))
479-
480-
(setq detail? (lsp:completion-item-detail? completion-item)
481-
documentation? (lsp:completion-item-documentation? completion-item))
482-
483-
(let ((doc
484-
(if (and (null has-unresolved-detail) detail? documentation?)
468+
(get-text-property 0 'lsp-completion-item (lsp-completion-resolve item)))
469+
(doc
470+
(if (and detail? documentation?)
485471
;; detail was resolved, that means the candidate list has no
486472
;; detail, so we may need to prepend it to the documentation
487473
(cond ((lsp-markup-content? documentation?)
@@ -517,8 +503,8 @@ The MARKERS and PREFIX value will be attached to each candidate."
517503

518504
(lsp--render-element documentation?))))
519505

520-
(put-text-property 0 (length item) 'lsp-completion-item-doc doc item)
521-
doc))))
506+
(put-text-property 0 (length item) 'lsp-completion-item-doc doc item)
507+
doc)))
522508

523509
(defun lsp-completion--get-context (trigger-characters same-session?)
524510
"Get completion context with provided TRIGGER-CHARACTERS and SAME-SESSION?."

0 commit comments

Comments
 (0)