Skip to content

Commit 8edae4b

Browse files
committed
Fix #4757 only resolve at exit-fn when the candidate requires resolution
1 parent d35aa75 commit 8edae4b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: lsp-completion.el

+6-1
Original file line numberDiff line numberDiff line change
@@ -688,10 +688,15 @@ Others: CANDIDATES"
688688
'lsp-completion-item)
689689
candidate
690690
(cl-find candidate (funcall candidates) :test #'equal)))
691+
(item (plist-get (text-properties-at 0 candidate) 'lsp-completion-item))
691692
(candidate
692693
;; see #3498 typescript-language-server does not provide the
693694
;; proper insertText without resolving.
694-
(if (lsp-completion--find-workspace 'ts-ls)
695+
(if (and (lsp-completion--find-workspace 'ts-ls)
696+
(or (and lsp-enable-snippet
697+
(eql (lsp:completion-item-insert-text-format? item)
698+
lsp/insert-text-format-snippet))
699+
(eq (plist-get (lsp:completion-item-data? item) :hasAction) t)))
695700
(lsp-completion--resolve candidate)
696701
candidate))
697702
((&plist 'lsp-completion-item item

0 commit comments

Comments
 (0)