diff --git a/modules/lang/python/README.org b/modules/lang/python/README.org index b0eff6697..78b140771 100644 --- a/modules/lang/python/README.org +++ b/modules/lang/python/README.org @@ -7,7 +7,6 @@ - [[#description][Description]] - [[#module-flags][Module Flags]] - [[#plugins][Plugins]] - - [[#hacks][Hacks]] - [[#prerequisites][Prerequisites]] - [[#language-server-protocol-support][Language Server Protocol Support]] - [[#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]] + ~: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 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]] ** Language Server Protocol Support -Requires the ~+lsp~ flag and ~:tools lsp~ module to be enabled. -By default LSP will use Microsoft's language server if installed. +This module must be enabled with the =+lsp= flag, and the =:tools lsp= module +must be enabled. LSP will try mspyls, then pyls; whichever is available. -To install the language server: -~M-x lsp-python-ms-setup~ -To update the server: -~M-x lsp-python-ms-update-server~ +mypyls can be installed with ~M-x lsp-install-server~ after opening a python +buffer. -Alternatively you can use the [[https://pypi.org/project/python-language-server/][Python Language Server]] instead. -~pip install 'python-language-server[all]'~ +Alternatively, use the [[https://pypi.org/project/python-language-server/][Python Language Server]] instead. ~pip install +'python-language-server[all]'~ * Features This module supports LSP. It requires installation of [[https://pypi.org/project/python-language-server/][Python Language diff --git a/modules/lang/python/config.el b/modules/lang/python/config.el index e68bf692a..f75675109 100644 --- a/modules/lang/python/config.el +++ b/modules/lang/python/config.el @@ -282,15 +282,11 @@ called.") (use-package! lsp-python-ms :when (featurep! +lsp) - :after (python lsp-clients) + :after lsp-clients :preface - (autoload 'lsp-python-ms-update-server "lsp-python-ms" nil t) - (autoload 'lsp-python-ms-setup "lsp-python-ms" nil t) (after! python (setq lsp-python-ms-python-executable-cmd python-shell-interpreter)) :init - (setq lsp-python-ms-dir (concat doom-etc-dir "mspyls/")) - ;; 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 ;; careless usage of `cl-destructuring-bind'. This silences that error, @@ -298,16 +294,7 @@ called.") ;; python installed! (defadvice! +python--silence-errors-a (orig-fn &rest args) :around #'lsp-python-ms--extra-init-params - (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)) + (ignore-errors (apply orig-fn args)))) (use-package! cython-mode