From 40719bfde2c8163acab63c727f9205127cc11193 Mon Sep 17 00:00:00 2001 From: Ivan Yonchovski Date: Wed, 1 Jul 2020 07:52:57 +0300 Subject: [PATCH] Always run the cleanup to avoid stale :cancel-tokens --- lsp-mode.el | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lsp-mode.el b/lsp-mode.el index 1e7b7266df1..5a5b1867067 100644 --- a/lsp-mode.el +++ b/lsp-mode.el @@ -3469,14 +3469,13 @@ If NO-MERGE is non-nil, don't merge the results but return alist workspace->resu (body (plist-put body :id id))) ;; cancel request in any of the hooks - (when hooks - (mapc (-lambda ((hook . local)) - (add-hook hook - (lsp--create-request-cancel - id target-workspaces hook buf method) - nil local)) - hooks) - (puthash id cleanup-hooks lsp--request-cleanup-hooks)) + (mapc (-lambda ((hook . local)) + (add-hook hook + (lsp--create-request-cancel + id target-workspaces hook buf method) + nil local)) + hooks) + (puthash id cleanup-hooks lsp--request-cleanup-hooks) (setq lsp--last-active-workspaces target-workspaces) @@ -5054,6 +5053,7 @@ Others: TRIGGER-CHARS" (advice-add #'completion-at-point :before #'lsp--capf-clear-cache) + (defun lsp--to-yasnippet-snippet (text) "Convert LSP snippet TEXT to yasnippet snippet." ;; LSP snippet doesn't escape "{", but yasnippet requires escaping it.