From 6e3b7d70882851aa4e9e25a344ce5c71eef82f11 Mon Sep 17 00:00:00 2001 From: Jimmy Yuen Ho Wong Date: Thu, 28 Nov 2024 16:34:50 +0000 Subject: [PATCH] Make lsp-completion--resolve-async public --- lsp-completion.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lsp-completion.el b/lsp-completion.el index 5826479484b..d793ff433ee 100644 --- a/lsp-completion.el +++ b/lsp-completion.el @@ -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") @@ -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?) @@ -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?)))))