From eb42f95777a28e4c613a9f5c35e7444fba81b090 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 5 Jul 2019 19:08:11 +0200 Subject: [PATCH] tools/lsp: noop lsp! if used more than once --- modules/tools/lsp/autoload.el | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/modules/tools/lsp/autoload.el b/modules/tools/lsp/autoload.el index 55a827573..27a693d4c 100644 --- a/modules/tools/lsp/autoload.el +++ b/modules/tools/lsp/autoload.el @@ -11,15 +11,16 @@ been moved out to their respective modules, or these hooks: + `+lsp|init-company' (on `lsp-mode-hook') + `+lsp|init-ui-flycheck-or-flymake' (on `lsp-ui-mode-hook')" (require 'lsp-mode) - (when lsp-auto-configure - (require 'lsp-clients)) - (when (and (buffer-file-name) - (setq-local lsp--buffer-workspaces - (or (lsp--try-open-in-library-workspace) - (lsp--try-project-root-workspaces (equal arg '(4)) - (and arg (not (equal arg 1))))))) - (lsp-mode 1) - (lsp--info - "Connected to %s." - (apply #'concat (mapcar (lambda (it) (format "[%s]" (lsp--workspace-print it))) - lsp--buffer-workspaces))))) + (unless lsp-mode + (when lsp-auto-configure + (require 'lsp-clients)) + (when (and (buffer-file-name) + (setq-local lsp--buffer-workspaces + (or (lsp--try-open-in-library-workspace) + (lsp--try-project-root-workspaces (equal arg '(4)) + (and arg (not (equal arg 1))))))) + (lsp-mode 1) + (lsp--info + "Connected to %s." + (apply #'concat (mapcar (lambda (it) (format "[%s]" (lsp--workspace-print it))) + lsp--buffer-workspaces))))))