Skip to content

Commit

Permalink
Always run the cleanup to avoid stale :cancel-tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
yyoncho committed Jul 1, 2020
1 parent 135d28f commit 40719bf
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lsp-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 40719bf

Please sign in to comment.