Update lsp-python-ms config to reflect changes upstream

mspyls should be installed with M-x lsp-install-server from now on.
This commit is contained in:
Henrik Lissner 2020-01-10 04:39:22 -05:00
parent 780100131d
commit 4acd60aba3
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 8 additions and 29 deletions

View file

@ -7,7 +7,6 @@
- [[#description][Description]] - [[#description][Description]]
- [[#module-flags][Module Flags]] - [[#module-flags][Module Flags]]
- [[#plugins][Plugins]] - [[#plugins][Plugins]]
- [[#hacks][Hacks]]
- [[#prerequisites][Prerequisites]] - [[#prerequisites][Prerequisites]]
- [[#language-server-protocol-support][Language Server Protocol Support]] - [[#language-server-protocol-support][Language Server Protocol Support]]
- [[#features][Features]] - [[#features][Features]]
@ -49,11 +48,6 @@ Adds Python support to Doom Emacs.
+ [[https://github.com/cython/cython/blob/master/Tools/cython-mode.el][Cython-mode]] + [[https://github.com/cython/cython/blob/master/Tools/cython-mode.el][Cython-mode]]
+ ~:tools flycheck~ [[https://github.com/lbolla/emacs-flycheck-cython/tree/master][Flycheck-cython]] + ~:tools flycheck~ [[https://github.com/lbolla/emacs-flycheck-cython/tree/master][Flycheck-cython]]
** Hacks
+ As per our "your system your rules" mantra, lsp-python-ms has been modified to
*not* automatically install its server if it cannot find it. Install it with
~M-x lsp-python-ms-setup~.
* Prerequisites * Prerequisites
This module has no direct prerequisites. Here are some of its soft dependencies. This module has no direct prerequisites. Here are some of its soft dependencies.
@ -79,16 +73,14 @@ This module has no direct prerequisites. Here are some of its soft dependencies.
+ ~cython~ requires [[https://cython.org/][Cython]] + ~cython~ requires [[https://cython.org/][Cython]]
** Language Server Protocol Support ** Language Server Protocol Support
Requires the ~+lsp~ flag and ~:tools lsp~ module to be enabled. This module must be enabled with the =+lsp= flag, and the =:tools lsp= module
By default LSP will use Microsoft's language server if installed. must be enabled. LSP will try mspyls, then pyls; whichever is available.
To install the language server: mypyls can be installed with ~M-x lsp-install-server~ after opening a python
~M-x lsp-python-ms-setup~ buffer.
To update the server:
~M-x lsp-python-ms-update-server~
Alternatively you can use the [[https://pypi.org/project/python-language-server/][Python Language Server]] instead. Alternatively, use the [[https://pypi.org/project/python-language-server/][Python Language Server]] instead. ~pip install
~pip install 'python-language-server[all]'~ 'python-language-server[all]'~
* Features * Features
This module supports LSP. It requires installation of [[https://pypi.org/project/python-language-server/][Python Language This module supports LSP. It requires installation of [[https://pypi.org/project/python-language-server/][Python Language

View file

@ -282,15 +282,11 @@ called.")
(use-package! lsp-python-ms (use-package! lsp-python-ms
:when (featurep! +lsp) :when (featurep! +lsp)
:after (python lsp-clients) :after lsp-clients
:preface :preface
(autoload 'lsp-python-ms-update-server "lsp-python-ms" nil t)
(autoload 'lsp-python-ms-setup "lsp-python-ms" nil t)
(after! python (after! python
(setq lsp-python-ms-python-executable-cmd python-shell-interpreter)) (setq lsp-python-ms-python-executable-cmd python-shell-interpreter))
:init :init
(setq lsp-python-ms-dir (concat doom-etc-dir "mspyls/"))
;; HACK If you don't have python installed, then opening python buffers with ;; HACK If you don't have python installed, then opening python buffers with
;; this on causes a "wrong number of arguments: nil 0" error, because of ;; this on causes a "wrong number of arguments: nil 0" error, because of
;; careless usage of `cl-destructuring-bind'. This silences that error, ;; careless usage of `cl-destructuring-bind'. This silences that error,
@ -298,16 +294,7 @@ called.")
;; python installed! ;; python installed!
(defadvice! +python--silence-errors-a (orig-fn &rest args) (defadvice! +python--silence-errors-a (orig-fn &rest args)
:around #'lsp-python-ms--extra-init-params :around #'lsp-python-ms--extra-init-params
(ignore-errors (apply orig-fn args))) (ignore-errors (apply orig-fn args))))
;; 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 ()
:override #'lsp-python-ms--command-string
lsp-python-ms-executable))
(use-package! cython-mode (use-package! cython-mode