lang/python: lazy load lsp-python-ms

And comment on the hack.
This commit is contained in:
Henrik Lissner 2019-07-27 13:53:38 +02:00
parent 063703bbd6
commit 94d5b73b45
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -248,12 +248,16 @@ called.")
'(conda-env-current-name (" conda:" conda-env-current-name " "))
'append))
;; lsp-python-ms setup
(defun +python--dont-auto-install-server-a (orig-fn)
lsp-python-ms-executable)
(use-package! lsp-python-ms
:when (featurep! +lsp)
:after lsp-clients
:init
(advice-add #'lsp-python-ms--command-string
:override #'+python--dont-auto-install-server-a))
;; HACK lsp-python-ms shouldn't install itself if it isn't present. This
;; circumvents LSP falling back to pyls when lsp-python-ms is absent.
;; Installing the server should be a deliberate act; either 'M-x
;; lsp-python-ms-setup' or setting `lsp-python-ms-executable' to an existing
;; install will do.
(defadvice! +python--dont-auto-install-server-a (orig-fn)
:override #'lsp-python-ms--command-string
lsp-python-ms-executable))