Don't hard-code pyls executable and switch out lsp for lsp-deferred

This commit is contained in:
Jeremy Dormitzer 2020-04-28 09:27:32 -04:00
parent 32de5d1527
commit 707b20eeff

View File

@ -2637,7 +2637,7 @@ Some formatting stuff:
(web-mode-set-content-type "jsx")) (web-mode-set-content-type "jsx"))
(when (or (equal web-mode-content-type "javascript") (when (or (equal web-mode-content-type "javascript")
(equal web-mode-content-type "jsx")) (equal web-mode-content-type "jsx"))
(lsp)))) (lsp-deferred))))
(add-hook 'web-mode-hook #'disable-tab-insert)) (add-hook 'web-mode-hook #'disable-tab-insert))
#+END_SRC #+END_SRC
@ -2680,7 +2680,7 @@ Manage node version via NVM within Emacs:
* Java * Java
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package lsp-java (use-package lsp-java
:hook ((java-mode . lsp))) :hook ((java-mode . lsp-deferred)))
#+END_SRC #+END_SRC
* Kotlin * Kotlin
@ -2690,7 +2690,7 @@ Manage node version via NVM within Emacs:
:config :config
(with-eval-after-load 'lsp (with-eval-after-load 'lsp
(when (executable-find "kotlin-language-server") (when (executable-find "kotlin-language-server")
(add-hook 'kotlin-mode-hook #'lsp)))) (add-hook 'kotlin-mode-hook #'lsp-deferred))))
#+END_SRC #+END_SRC
* Groovy * Groovy
@ -2712,7 +2712,7 @@ Used for Jenkins configuration scripts and probably other things.
:mode ("\\.ts\\'") :mode ("\\.ts\\'")
:config :config
(with-eval-after-load 'lsp (with-eval-after-load 'lsp
(add-hook 'typescript-mode-hook 'lsp))) (add-hook 'typescript-mode-hook 'lsp-deferred)))
#+END_SRC #+END_SRC
* LSP Mode * LSP Mode
@ -2750,7 +2750,7 @@ Emacs support for the Language Server Protocol
((normal visual motion) lsp-mode-map "K" #'lsp-describe-thing-at-point) ((normal visual motion) lsp-mode-map "K" #'lsp-describe-thing-at-point)
:config :config
(setq lsp-prefer-flymake nil) (setq lsp-prefer-flymake nil)
:commands lsp-mode) :commands lsp-mode lsp lsp-deferred)
(use-package company-lsp (use-package company-lsp
:after (lsp-mode company) :after (lsp-mode company)
@ -2855,10 +2855,7 @@ Elpy is a python IDE package:
Alternatively, use the LSP python client: Alternatively, use the LSP python client:
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(with-eval-after-load 'lsp-pyls (add-hook 'python-mode-hook #'lsp-deferred)
(when (file-exists-p (expand-file-name "~/.local/bin/pyls"))
(setq lsp-pyls-server-command (list (expand-file-name "~/.local/bin/pyls")))))
(add-hook 'python-mode-hook #'lsp)
(general-def 'normal python-mode-map "C-c C-d" #'lsp-describe-thing-at-point) (general-def 'normal python-mode-map "C-c C-d" #'lsp-describe-thing-at-point)
#+END_SRC #+END_SRC
@ -3106,7 +3103,7 @@ Basic support:
LSP support - requires [[https://github.com/sourcegraph/go-langserver][go-langserver]]. LSP support - requires [[https://github.com/sourcegraph/go-langserver][go-langserver]].
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(add-hook 'go-mode-hook #'lsp) (add-hook 'go-mode-hook #'lsp-deferred)
#+END_SRC #+END_SRC
* Clojure * Clojure
@ -3311,7 +3308,7 @@ An Eshell alias to start PHP using XDebug:
LSP for PHP requires [[https://github.com/felixfbecker/php-language-server][php-language-server]] to be installed in ~/.composer: LSP for PHP requires [[https://github.com/felixfbecker/php-language-server][php-language-server]] to be installed in ~/.composer:
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(add-hook 'php-mode-hook #'lsp) (add-hook 'php-mode-hook #'lsp-deferred)
#+END_SRC #+END_SRC
* YAML * YAML
@ -3330,12 +3327,12 @@ LSP for PHP requires [[https://github.com/felixfbecker/php-language-server][php-
Use LSP if [[https://github.com/mads-hartmann/bash-language-server][bash-language-server]] is installed. Use LSP if [[https://github.com/mads-hartmann/bash-language-server][bash-language-server]] is installed.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(when (executable-find "bash-language-server") (when (executable-find "bash-language-server")
(add-hook 'sh-mode-hook #'lsp)) (add-hook 'sh-mode-hook #'lsp-deferred))
#+END_SRC #+END_SRC
* Ruby * Ruby
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(add-hook 'ruby-mode-hook #'lsp) (add-hook 'ruby-mode-hook #'lsp-deferred)
#+END_SRC #+END_SRC
* Rust * Rust
@ -3345,7 +3342,7 @@ Use LSP if [[https://github.com/mads-hartmann/bash-language-server][bash-languag
:general :general
(rust-mode-map "C-c <tab>" #'rust-format-buffer) (rust-mode-map "C-c <tab>" #'rust-format-buffer)
:config :config
(add-hook 'rust-mode-hook #'lsp)) (add-hook 'rust-mode-hook #'lsp-deferred))
(use-package cargo (use-package cargo