From 2dfc7a239f7392a44030425ebb640dc2140f7761 Mon Sep 17 00:00:00 2001 From: brettlangdon Date: Tue, 5 Jan 2021 08:13:38 -0500 Subject: [PATCH] Update Python layer --- emacs.d/custom.el | 3 +-- emacs.d/layers/python/init.el | 17 +++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/emacs.d/custom.el b/emacs.d/custom.el index 1424277..863cf46 100644 --- a/emacs.d/custom.el +++ b/emacs.d/custom.el @@ -4,8 +4,7 @@ ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(package-selected-packages - (quote - (adoc-mode csv-mode php-mode python-black cython-mode scss-mode vue-mode tide rust-mode company-auctex tex-site auctex sphinx-doc company-lsp lsp-ui lsp-mode ws-butler use-package smartparens pip-requirements osx-clipboard monokai-theme markdown-mode helm-projectile helm-ag godoctor go-guru go-eldoc go-autocomplete flycheck-gometalinter doom-modeline dockerfile-mode docker-compose-mode diminish company-go company-anaconda)))) + '(adoc-mode csv-mode php-mode lsp-python-ms go-mode company projectile helm python-black cython-mode scss-mode vue-mode tide rust-mode company-auctex tex-site auctex sphinx-doc company-lsp lsp-ui lsp-mode ws-butler use-package smartparens pip-requirements osx-clipboard monokai-theme markdown-mode helm-projectile helm-ag godoctor go-guru go-eldoc go-autocomplete flycheck-gometalinter doom-modeline dockerfile-mode docker-compose-mode diminish company-go company-anaconda))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. diff --git a/emacs.d/layers/python/init.el b/emacs.d/layers/python/init.el index 34f7cba..5fca242 100644 --- a/emacs.d/layers/python/init.el +++ b/emacs.d/layers/python/init.el @@ -1,8 +1,9 @@ -;; lsp-mode -;; https://github.com/emacs-lsp/lsp-mode -(use-package lsp-mode - :hook (python-mode . lsp) - :commands lsp) +(use-package lsp-python-ms + :ensure t + :init (setq lsp-python-ms-auto-install-server t) + :hook (python-mode . (lambda () + (require 'lsp-python-ms) + (lsp)))) ; or lsp-deferred (use-package lsp-ui :ensure t @@ -10,7 +11,7 @@ :commands lsp-ui-mode) (use-package company-lsp - :hook (python-mode . lsp)) + :commands company-lsp) ;; Enable pip-requirements when editing a `requirements.txt` file (use-package pip-requirements @@ -30,8 +31,8 @@ ;; https://github.com/wbolster/emacs-python-black (use-package python-black :demand t - :after python) - ;; :hook (python-mode . python-black-on-save-mode)) + :after python + :hook (python-mode . python-black-on-save-mode)) ;; Enable Flycheck for python (enable-flycheck 'python-mode-hook)