|
|
|
@ -57,19 +57,29 @@
|
|
|
|
|
:pin manual
|
|
|
|
|
:hook (
|
|
|
|
|
(python-ts-mode . (lambda ()
|
|
|
|
|
(when (executable-find "poetry")
|
|
|
|
|
(add-poetry-venv-to-path)
|
|
|
|
|
(let ((venv (locate-venv-poetry))) (when venv
|
|
|
|
|
(setq eglot-workspace-configuration
|
|
|
|
|
(list (cons ':python (list ':venvPath venv ':pythonPath (concat venv "/bin/python")))))
|
|
|
|
|
))
|
|
|
|
|
)
|
|
|
|
|
(when-linux
|
|
|
|
|
(eglot-ensure)
|
|
|
|
|
)
|
|
|
|
|
(when-linux
|
|
|
|
|
(when (executable-find "poetry")
|
|
|
|
|
(add-poetry-venv-to-path)
|
|
|
|
|
(let ((venv (locate-venv-poetry))) (when venv
|
|
|
|
|
(setq eglot-workspace-configuration
|
|
|
|
|
(list (cons ':python (list ':venvPath venv ':pythonPath (concat venv "/bin/python")))))
|
|
|
|
|
))
|
|
|
|
|
)
|
|
|
|
|
(eglot-ensure)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
(add-hook 'before-save-hook 'python-fmt nil 'local)
|
|
|
|
|
))
|
|
|
|
|
;; (when-freebsd
|
|
|
|
|
;; (eglot-ensure)
|
|
|
|
|
;; (defclass my/eglot-pylyzer (eglot-lsp-server) ()
|
|
|
|
|
;; :documentation
|
|
|
|
|
;; "Own eglot server class.")
|
|
|
|
|
|
|
|
|
|
;; (add-to-list 'eglot-server-programs
|
|
|
|
|
;; '(python-ts-mode . (my/eglot-pylyzer "pylyzer" "--server")))
|
|
|
|
|
;; )
|
|
|
|
|
|
|
|
|
|
(add-hook 'before-save-hook 'python-fmt nil 'local)
|
|
|
|
|
))
|
|
|
|
|
)
|
|
|
|
|
:bind ((:map python-ts-mode-map ([backspace] . python-backspace))
|
|
|
|
|
)
|
|
|
|
|