]> xn--ix-yja.es Git - alex.git/commitdiff
Make eglot + rustic + flymake + vale play nice
authorAlex <alex.corcoles@veecle.io>
Tue, 29 Apr 2025 12:19:34 +0000 (14:19 +0200)
committeralexpdp7 <alex@corcoles.net>
Tue, 29 Apr 2025 12:21:29 +0000 (14:21 +0200)
emacs/emacs.el

index e44188cc7ab0c01ef81a1cefac10a9e46ec1d265..6e0300f78959cd83ab1b7d0115d9c6768368af09 100644 (file)
@@ -71,9 +71,7 @@
   :config
   (setq rustic-format-on-save t)
   (setq rustic-rustfmt-args "--edition 2018")
-  (setq rustic-lsp-client 'eglot)
-  (add-hook 'eglot--managed-mode-hook (lambda () (flymake-mode -1)))
-  (add-hook 'rust-mode-hook (lambda () (setq indent-tabs-mode nil))))
+  (setq rustic-lsp-client 'eglot))
 
 ;; https://download.eclipse.org/jdtls/milestones/1.43.0/jdt-language-server-1.43.0-202412191447.tar.gz is the last language server that supports Debian 12 JDK
 ;; Untar the archive and symlink the jdtls binary in ~/.local/bin
 (setq auto-mode-alist (append '(("\\.pl\\'" . prolog-mode))
                               auto-mode-alist))
 
-(add-hook 'markdown-mode-hook 'flymake-mode)
 
 (use-package flymake-vale
   :vc (:url "https://github.com/tpeacock19/flymake-vale.git"
             :rev :newest)
   :config
-  (add-hook 'markdown-mode-hook #'flymake-vale-load)
-  (add-hook 'rust-mode-hook #'flymake-vale-load)
-  )
+  (add-hook 'find-file-hook 'flymake-vale-maybe-load)
+  (add-to-list 'flymake-vale-modes 'rustic-mode))
+
+(setq eglot-stay-out-of '(flymake))
+(add-hook 'eglot--managed-mode-hook (lambda ()
+  (add-hook 'flymake-diagnostic-functions 'eglot-flymake-backend nil t)
+  (flymake-mode 1)))
+(add-hook 'markdown-mode-hook 'flymake-mode)