fix(python): ensure anaconda-mode and +lsp are mutually exclusive

I'm considering removing anaconda entirely from the module (to lean on
LSP), but for the time being, this should help with anaconda taking over
ine eglot-enabled buffers.

Fix: #7823
This commit is contained in:
Henrik Lissner 2024-06-30 13:02:27 -04:00
parent a0dadda266
commit d14ddbf694
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -104,6 +104,12 @@
(bound-and-true-p lsp--buffer-deferred) (bound-and-true-p lsp--buffer-deferred)
(not (executable-find python-shell-interpreter t))) (not (executable-find python-shell-interpreter t)))
(anaconda-mode +1)))) (anaconda-mode +1))))
(add-hook! 'eglot-server-initialized-hook
(defun +python-disable-anaconda-mode-h ()
"Ensure `anaconda-mode' doesn't interfere with `eglot'."
(when (bound-and-true-p anaconda-mode)
(anaconda-mode -1))))
:config :config
(set-company-backend! 'anaconda-mode '(company-anaconda)) (set-company-backend! 'anaconda-mode '(company-anaconda))
(set-lookup-handlers! 'anaconda-mode (set-lookup-handlers! 'anaconda-mode