Skip to content

Commit

Permalink
Make lsp-completion--resolve-async public
Browse files Browse the repository at this point in the history
  • Loading branch information
wyuenho committed Nov 28, 2024
1 parent 5bc2096 commit 6e3b7d7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lsp-completion.el
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ ITEM can be string or a CompletionItem"
item))
(_ completion-item)))))

(defun lsp-completion--resolve-async (item callback &optional cleanup-fn)
(defun lsp-completion-resolve-async (item callback &optional cleanup-fn)
"Resolve completion ITEM asynchronously with CALLBACK.
The CLEANUP-FN will be called to cleanup."
(cl-assert item nil "Completion item must not be nil")
Expand Down Expand Up @@ -242,6 +242,8 @@ The CLEANUP-FN will be called to cleanup."
(funcall callback completion-item)
(when cleanup-fn (funcall cleanup-fn))))))

(define-obsolete-function-alias 'lsp-completion--resolve-async 'lsp-completion-resolve-async "9.1.0")

(defun lsp-completion--annotate (item)
"Annotate ITEM detail."
(-let (((completion-item &as &CompletionItem :detail? :kind? :label-details?)
Expand Down Expand Up @@ -713,14 +715,14 @@ Others: CANDIDATES"
(not (seq-empty-p additional-text-edits?)))
(lsp--apply-text-edits additional-text-edits? 'completion)
(-let [(callback cleanup-fn) (lsp--create-apply-text-edits-handlers)]
(lsp-completion--resolve-async
(lsp-completion-resolve-async
item
(-compose callback #'lsp:completion-item-additional-text-edits?)
cleanup-fn))))

(if (or resolved command?)
(when command? (lsp--execute-command command?))
(lsp-completion--resolve-async
(lsp-completion-resolve-async
item
(-lambda ((&CompletionItem? :command?))
(when command? (lsp--execute-command command?)))))
Expand Down

0 comments on commit 6e3b7d7

Please sign in to comment.