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