From 1e91c04c040867758f1172ee78e82f3c49499830 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 23 Jan 2020 01:44:43 -0500 Subject: [PATCH] Fix #2408: wrong-number-of-args error on lsp-workspace-restart Due to a change to lsp--shutdown-workspace upstream. --- modules/tools/lsp/config.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/tools/lsp/config.el b/modules/tools/lsp/config.el index ab5a1817b..12c585ec2 100644 --- a/modules/tools/lsp/config.el +++ b/modules/tools/lsp/config.el @@ -36,14 +36,13 @@ This can be a single company backend or a list thereof. It can be anything :references 'lsp-find-references) (defvar +lsp--deferred-shutdown-timer nil) - (defadvice! +lsp-defer-server-shutdown-a (orig-fn) + (defadvice! +lsp-defer-server-shutdown-a (orig-fn &optional restart) "Defer server shutdown for a few seconds. This gives the user a chance to open other project files before the server is auto-killed (which is usually an expensive process)." :around #'lsp--shutdown-workspace (if (or lsp-keep-workspace-alive - (eq (lsp--workspace-shutdown-action lsp--cur-workspace) - 'restart)) + restart) (funcall orig-fn) (when (timerp +lsp--deferred-shutdown-timer) (cancel-timer +lsp--deferred-shutdown-timer))