From 9b5dce1c56cae49111d19e389b6bbf7569986cab Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 28 Jul 2019 23:29:22 +0200 Subject: [PATCH] Refactor lsp! function --- modules/tools/lsp/autoload.el | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/modules/tools/lsp/autoload.el b/modules/tools/lsp/autoload.el index 27a693d4c..7b6baffd6 100644 --- a/modules/tools/lsp/autoload.el +++ b/modules/tools/lsp/autoload.el @@ -8,19 +8,23 @@ Meant to be a lighter alternative to `lsp', which is too eager about initializing lsp-ui-mode, company, yasnippet and flycheck. Instead, these have 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')" ++ `+lsp-init-company-h' (on `lsp-mode-hook') ++ `+lsp-init-ui-flycheck-or-flymake-h' (on `lsp-ui-mode-hook')" (require 'lsp-mode) (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))))))) + (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)))))) + (apply + #'concat (mapcar + (lambda (it) (format "[%s]" (lsp--workspace-print it))) + lsp--buffer-workspaces))))))