Manually configure eglot for flymake to allow multiple backends

Add config for jedi-language-server, disable built in diagnostics as
I'm using flymake-ruff for linting
This commit is contained in:
Evie Litherland-Smith 2024-01-28 12:54:14 +00:00
parent 405cbcafe2
commit 8edb0dc02c

View file

@ -769,18 +769,14 @@ Set treesit to fontify all elements, default was 3 (out of 4)
("C-c c C-e" . eglot-reconnect) ("C-c c C-e" . eglot-reconnect)
("C-c c a" . eglot-code-actions) ("C-c c a" . eglot-code-actions)
("C-c c r" . eglot-rename)) ("C-c c r" . eglot-rename))
:hook ((nix-mode :hook (((nix-mode fortran-mode f90-mode lua-mode python-base-mode rust-ts-mode) . eglot-ensure)
fortran-mode (eglot-managed-mode . (lambda () (add-to-list 'flymake-diagnostic-functions #'eglot-flymake-backend))))
f90-mode
shell-script-mode
lua-mode
python-base-mode
rust-ts-mode) . eglot-ensure)
:custom :custom
(eglot-extend-to-xref t) (eglot-extend-to-xref t)
(eglot-autoshutdown t) (eglot-autoshutdown t)
(eglot-autoreconnect nil) (eglot-autoreconnect nil)
:config :config
(setq eglot-stay-out-of '(flymake))
(add-to-list 'eglot-server-programs (add-to-list 'eglot-server-programs
`((nix-mode) `((nix-mode)
. ("nil" . ("nil"
@ -795,7 +791,14 @@ Set treesit to fontify all elements, default was 3 (out of 4)
( :check (:command "clippy") ( :check (:command "clippy")
:procMacro (:enable t) :procMacro (:enable t)
:cargo ( :buildScripts (:enable t) :cargo ( :buildScripts (:enable t)
:features "all")))))) :features "all")))))
(add-to-list 'eglot-server-programs
`((python-ts-mode python-mode)
. ("jedi-language-server"
:initializationOptions
( :diagnostics ( :enable nil)
:hover ( :enable t)
:jediSettings ( :autoImportModules ["numpy"]))))))
#+end_src #+end_src
** Apheleia formatting ** Apheleia formatting
@ -838,6 +841,15 @@ Set treesit to fontify all elements, default was 3 (out of 4)
:hook (sh-mode . flymake-shellcheck-load)) :hook (sh-mode . flymake-shellcheck-load))
#+end_src #+end_src
*** ruff
#+begin_src emacs-lisp
(use-package flymake-ruff
:ensure t
:after (flymake eglot)
:diminish
:hook (python-base-mode . flymake-ruff-load))
#+end_src
** Project ** Project
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq project-switch-use-entire-map t (setq project-switch-use-entire-map t