From 84e6fe876ca07478c8068f333e78522d884699e2 Mon Sep 17 00:00:00 2001 From: Jessie Hildebrandt Date: Fri, 13 Oct 2023 14:56:24 -0400 Subject: [PATCH] Replace lsp-mode and flycheck with eglot, flymake --- init.el | 97 ++++++++++++++++++--------------------------------------- 1 file changed, 31 insertions(+), 66 deletions(-) diff --git a/init.el b/init.el index 1047bbc..1b34b66 100644 --- a/init.el +++ b/init.el @@ -436,6 +436,20 @@ This overrides the default `display-startup-echo-area-message' function." :bind ("C-c n" . display-line-numbers-mode)) +;; ---------------------------------- ;; +;; eglot +;; ---------------------------------- ;; + +(editor-feature eglot + "Integrates LSP client features into Emacs." + :config + ;; Remove the mode-line segment that Eglot adds + (setq mode-line-misc-info (assoc-delete-all 'eglot--managed-mode mode-line-misc-info)) + :hook + (gdscript-mode . eglot-ensure) + (js-mode-hook . eglot-ensure) + (typescript-mode-hook . eglot-ensure)) + ;; ---------------------------------- ;; ;; elec-pair ;; ---------------------------------- ;; @@ -583,6 +597,19 @@ have been closed." :hook (before-save-hook . delete-trailing-whitespace)) +;; ---------------------------------- ;; +;; flymake +;; ---------------------------------- ;; + +(editor-feature flymake + "Provides universal on-the-fly syntax checking." + :custom + (flymake-no-changes-timeout 2 "Wait for 2 seconds of idle time before invoking any checkers") + :hook + (prog-mode-hook . flymake-mode) + :bind + ("C-c e" . flymake-show-buffer-diagnostics)) + ;; ---------------------------------- ;; ;; frame ;; ---------------------------------- ;; @@ -1124,29 +1151,15 @@ DOCSTRING is an optional form that is discarded upon expansion." (eshell-mode-hook . fish-completion-mode)) ;; ---------------------------------- ;; -;; flycheck +;; flymake-kondor ;; ---------------------------------- ;; -(external-package flycheck - "Enables on-the-fly syntax checking for supported languages." - :custom - (flycheck-idle-change-delay 2 "Wait for 2 seconds of idling before invoking any checkers") - (flycheck-check-syntax-automatically '(save idle-change mode-enabled)) - :hook - (prog-mode-hook . flycheck-mode) - :bind - ("C-c e" . flycheck-list-errors)) - -;; ---------------------------------- ;; -;; flycheck-clj-kondo -;; ---------------------------------- ;; - -(external-package flycheck-clj-kondo - "Integrates clj-kondo as a flycheck checker for Clojure buffers." +(external-package flymake-kondor + "Integrates clj-kondo as a flymake checker for Clojure buffers." :when (executable-find "clj-kondo") :hook - (clojure-mode-hook . (lambda () (require 'flycheck-clj-kondo)))) + (clojure-mode-hook . flymake-kondor-setup)) ;; ---------------------------------- ;; ;; fussy @@ -1258,54 +1271,6 @@ DOCSTRING is an optional form that is discarded upon expansion." :hook (prog-mode-hook . ligature-mode)) -;; ---------------------------------- ;; -;; lsp-mode -;; ---------------------------------- ;; - -(external-package lsp-mode - "Provides Language Server Protocol support and integration." - :custom - (lsp-eldoc-enable-hover nil "Do not print symbol eldoc information in the echo area") - (lsp-signature-auto-activate nil "Do not display function signature docs in the echo area") - (lsp-headerline-breadcrumb-enable nil "Do not display a file/function breadcrumb headerline") - (lsp-modeline-code-actions-enable nil "Do not display suggested code actions in the mode line") - :commands - (lsp - lsp-deferred) - :hook - (css-mode-hook . lsp-deferred) - (gdscript-mode-hook . lsp-deferred) - (js-mode-hook . lsp-deferred) - (json-mode-hook . lsp-deferred) - (rust-mode-hook . lsp-deferred) - (typescript-mode-hook . lsp-deferred) - (web-mode-hook . lsp-deferred)) - -;; ---------------------------------- ;; -;; lsp-ui -;; ---------------------------------- ;; - -(external-package lsp-ui - "Provides higher-level UI integration of LSP features for `lsp-mode'." - :config - (setq lsp-ui-doc-border (face-background 'lsp-ui-doc-background)) - :custom - (lsp-ui-imenu-enable nil "Disable automatic activation of imenu side window") - (lsp-ui-peek-always-show t "Always show peek popup, even with only one entry") - (lsp-ui-doc-enable nil "Disable automatic activation of documentation elements") - (lsp-ui-doc-max-width 50 "Limit documentation popup width to 50 columns") - (lsp-ui-doc-max-height 10 "Limit documentation popup height to 10 lines") - (lsp-ui-doc-header t "Show documentation header displaying the symbol name") - (lsp-ui-doc-position 'top "Show documentation popups at the top of the window") - (lsp-ui-doc-alignment 'window "Align documentation popups with the window, not the frame") - (lsp-ui-doc-include-signature t "Show object signature/type in the documentation popup") - (lsp-ui-doc-show-with-cursor t "Enable displaying documentation of symbols under the cursor") - :bind - (:map lsp-ui-mode-map - ("M-," . lsp-ui-doc-mode) - ("M-." . lsp-ui-peek-find-definitions) - ("M-?" . lsp-ui-peek-find-references))) - ;; ---------------------------------- ;; ;; magit ;; ---------------------------------- ;;