Remove project requirement for eglot-ensure hooks

Misc formatting
This commit is contained in:
Evie Litherland-Smith 2024-08-06 08:14:19 +01:00
parent ace2792607
commit cb6b8f9ef5

View file

@ -1201,16 +1201,11 @@ Configure email with iCalendar event support, to integrate with
("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 ((eglot-managed-mode . (lambda () (add-hook 'flymake-diagnostic-functions 'eglot-flymake-backend nil t))) :hook ((eglot-managed-mode . (lambda () (add-hook 'flymake-diagnostic-functions 'eglot-flymake-backend nil t)))
(nix-mode . (lambda () (if (and (project-current nil) (executable-find "nixd" t)) (nix-mode . (lambda () (if (executable-find "nixd" t) (eglot-ensure))))
(eglot-ensure)))) (python-base-mode . (lambda () (if (executable-find "pylsp" t) (eglot-ensure))))
(python-base-mode . (lambda () (if (and (project-current nil) (executable-find "pylsp" t)) (lua-mode . (lambda () (if (executable-find "lua-language-server" t) (eglot-ensure))))
(eglot-ensure)))) ((rust-ts-mode rust-mode) . (lambda () (if (executable-find "rust-analyzer" t) (eglot-ensure))))
(lua-mode . (lambda () (if (and (project-current nil) (executable-find "lua-language-server" t)) ((js-base-mode typescript-ts-base-mode) . (lambda () (if (executable-find "typescript-language-server" t) (eglot-ensure))))
(eglot-ensure))))
((rust-ts-mode rust-mode) . (lambda () (if (and (project-current nil) (executable-find "rust-analyzer" t))
(eglot-ensure))))
((js-base-mode typescript-ts-base-mode) . (lambda () (if (and (project-current nil) (executable-find "typescript-language-server" t))
(eglot-ensure))))
) )
:custom :custom
(eglot-menu-string "lsp") (eglot-menu-string "lsp")
@ -1371,11 +1366,14 @@ Configure email with iCalendar event support, to integrate with
(use-package python (use-package python
:hook ((python-base-mode . (lambda () (my/enable-fill-column 88))) :hook ((python-base-mode . (lambda () (my/enable-fill-column 88)))
(python-base-mode . (lambda () (setq-local (python-base-mode . (lambda ()
python-check-command (cond (setq-local
python-check-command
(cond
((executable-find "mypy" t) "mypy --check-untyped-defs --warn-unreachable --show-error-codes --ignore-missing-imports") ((executable-find "mypy" t) "mypy --check-untyped-defs --warn-unreachable --show-error-codes --ignore-missing-imports")
(t "pyflakes")) (t "pyflakes"))
python-flymake-command (cond python-flymake-command
(cond
((executable-find "ruff" t) '("ruff" "check" "--output-format=concise" "--stdin-filename=stdin" "-")) ((executable-find "ruff" t) '("ruff" "check" "--output-format=concise" "--stdin-filename=stdin" "-"))
((executable-find "flake8" t) '("flake8" "--max-line-length" "88" "-")) ((executable-find "flake8" t) '("flake8" "--max-line-length" "88" "-"))
(t '("pyflakes"))))))) (t '("pyflakes")))))))