Rewrite eglot and flymake configs
Use eglot-workspace-configuration to pass options to LSPs rather than re-defining the list Use flymake-collection to get mypy as a flymake backend Add flymake-clippy (for rust) rather than using via rust-analyzer
This commit is contained in:
parent
14eff0bb89
commit
29f6123983
|
@ -76,23 +76,17 @@ Set treesit to fontify all elements, default was 3 (out of 4)
|
||||||
(eglot-autoreconnect nil)
|
(eglot-autoreconnect nil)
|
||||||
:config
|
:config
|
||||||
(setq eglot-stay-out-of '(flymake))
|
(setq eglot-stay-out-of '(flymake))
|
||||||
(add-to-list 'eglot-server-programs
|
(setq-default eglot-workspace-configuration
|
||||||
`((nix-mode)
|
'( :pylsp
|
||||||
. ("nil"
|
( :plugins
|
||||||
:initializationOptions
|
( :jedi_completion
|
||||||
(:nil (:nix ( :maxMemoryMB 3000
|
( :enabled t
|
||||||
:flake ( :autoArchive t
|
:include_params t
|
||||||
:autoEvalInputs t)))))))
|
:include_class_objects t
|
||||||
(add-to-list 'eglot-server-programs
|
:include_function_objects t
|
||||||
`((rust-ts-mode rust-mode)
|
:fuzzy t)
|
||||||
. ("rust-analyzer"
|
:jedi_definition (:enabled t)
|
||||||
:initializationOptions
|
:jedi_hover (:enabled t))))))
|
||||||
( :check (:command "clippy")
|
|
||||||
:procMacro (:enable t)
|
|
||||||
:cargo ( :buildScripts (:enable t)
|
|
||||||
:features "all")))))
|
|
||||||
(add-to-list 'eglot-server-programs
|
|
||||||
`((python-ts-mode python-mode) . ("pylsp"))))
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
* Apheleia formatting
|
* Apheleia formatting
|
||||||
|
@ -115,7 +109,8 @@ Set treesit to fontify all elements, default was 3 (out of 4)
|
||||||
:ensure t
|
:ensure t
|
||||||
:bind (("C-c C-." . flymake-goto-next-error)
|
:bind (("C-c C-." . flymake-goto-next-error)
|
||||||
("C-c C-," . flymake-goto-prev-error))
|
("C-c C-," . flymake-goto-prev-error))
|
||||||
:hook (prog-mode . flymake-mode))
|
:hook (prog-mode . flymake-mode)
|
||||||
|
:config (require 'flymake-collection))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Diagnostics in popup
|
** Diagnostics in popup
|
||||||
|
@ -128,6 +123,20 @@ Set treesit to fontify all elements, default was 3 (out of 4)
|
||||||
(global-flymake-popon-mode +1))
|
(global-flymake-popon-mode +1))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
** flymake-collection
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package flymake-collection
|
||||||
|
:ensure t
|
||||||
|
:diminish
|
||||||
|
:defer
|
||||||
|
:after flymake)
|
||||||
|
|
||||||
|
(with-eval-after-load 'python
|
||||||
|
(add-hook 'python-base-mode-hook
|
||||||
|
(defun python-mode-setup-flymake ()
|
||||||
|
(add-hook 'flymake-diagnostic-functions 'flymake-collection-mypy nil t))))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
** shellcheck
|
** shellcheck
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package flymake-shellcheck
|
(use-package flymake-shellcheck
|
||||||
|
@ -137,6 +146,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
|
||||||
|
|
||||||
|
** clippy
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package flymake-clippy
|
||||||
|
:ensure t
|
||||||
|
:after flymake
|
||||||
|
:diminish
|
||||||
|
:hook ((rust-mode rust-ts-mode) . flymake-clippy-setup-backend))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
** eslint
|
** eslint
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package flymake-eslint
|
(use-package flymake-eslint
|
||||||
|
@ -150,7 +168,7 @@ Set treesit to fontify all elements, default was 3 (out of 4)
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package flymake-ruff
|
(use-package flymake-ruff
|
||||||
:ensure t
|
:ensure t
|
||||||
:after (flymake eglot)
|
:after flymake
|
||||||
:diminish
|
:diminish
|
||||||
:hook (python-base-mode . flymake-ruff-load))
|
:hook (python-base-mode . flymake-ruff-load))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
@ -388,10 +406,16 @@ Set fill column to 88 and enable display in python buffers
|
||||||
(use-package python
|
(use-package python
|
||||||
:defer t
|
:defer t
|
||||||
:custom
|
:custom
|
||||||
(python-check-command "mypy")
|
(python-check-command (cond ((executable-find "ruff")
|
||||||
|
"ruff check --output-format=pylint")
|
||||||
|
((executable-find "pyflakes")
|
||||||
|
"pyflakes")
|
||||||
|
((executable-find "epylint")
|
||||||
|
"epylint")
|
||||||
|
(t "pyflakes")))
|
||||||
:config
|
:config
|
||||||
(add-hook 'python-base-mode-hook (lambda () (my/enable-fill-column 88)))
|
(setq python-ts-mode-hook python-mode-hook)
|
||||||
(setq python-ts-mode-hook python-mode-hook))
|
(add-hook 'python-base-mode-hook (lambda () (my/enable-fill-column 88))))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Rust
|
** Rust
|
||||||
|
|
Loading…
Reference in a new issue