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

@ -243,17 +243,21 @@ called.")
;; integration with term/eshell ;; integration with term/eshell
(conda-env-initialize-interactive-shells) (conda-env-initialize-interactive-shells)
(after! eshell (conda-env-initialize-eshell)) (after! eshell (conda-env-initialize-eshell))
(add-to-list 'global-mode-string (add-to-list 'global-mode-string
'(conda-env-current-name (" conda:" conda-env-current-name " ")) '(conda-env-current-name (" conda:" conda-env-current-name " "))
'append)) 'append))
;; lsp-python-ms setup
(defun +python--dont-auto-install-server-a (orig-fn)
lsp-python-ms-executable)
(use-package! lsp-python-ms (use-package! lsp-python-ms
:when (featurep! +lsp) :when (featurep! +lsp)
:after lsp-clients
:init :init
(advice-add #'lsp-python-ms--command-string ;; HACK lsp-python-ms shouldn't install itself if it isn't present. This
:override #'+python--dont-auto-install-server-a)) ;; 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))