From 9026efcf5ae916b2299afc846c61492e8d89cbaa Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 30 Sep 2019 12:42:56 -0400 Subject: [PATCH] tools/lsp: enable flymake or flycheck, not both And only enable flycheck if it is installed. --- modules/tools/lsp/config.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/tools/lsp/config.el b/modules/tools/lsp/config.el index ae82a5e9b..b6beca4fa 100644 --- a/modules/tools/lsp/config.el +++ b/modules/tools/lsp/config.el @@ -35,12 +35,13 @@ This can be a single company backend or a list thereof. It can be anything (add-hook! 'lsp-ui-mode-hook (defun +lsp-init-ui-flycheck-or-flymake-h () "Sets up flymake-mode or flycheck-mode, depending on `lsp-prefer-flymake'." - (unless (eq :none lsp-prefer-flymake) - (if (and (not (version< emacs-version "26.1")) - lsp-prefer-flymake) - (lsp--flymake-setup)) - (require 'lsp-ui-flycheck) - (lsp-ui-flycheck-enable t)))) + (cond ((eq :none lsp-prefer-flymake)) + ((and (not (version< emacs-version "26.1")) + lsp-prefer-flymake) + (lsp--flymake-setup)) + ((require 'flycheck nil t) + (require 'lsp-ui-flycheck) + (lsp-ui-flycheck-enable t))))) :config (setq lsp-prefer-flymake nil lsp-ui-doc-max-height 8