Update lsp-mode config for new version
This commit is contained in:
parent
a7135a8baa
commit
b621c3709a
@ -467,57 +467,34 @@
|
|||||||
:bind (("C-a" . crux-move-beginning-of-line)))
|
:bind (("C-a" . crux-move-beginning-of-line)))
|
||||||
|
|
||||||
(use-package lsp-mode :ensure
|
(use-package lsp-mode :ensure
|
||||||
|
:hook ((python-mode html-mode web-mode css-mode) . lsp)
|
||||||
:config
|
:config
|
||||||
|
(use-package lsp-clients :demand)
|
||||||
|
|
||||||
(setq lsp-inhibit-message t
|
(setq lsp-inhibit-message t
|
||||||
lsp-eldoc-render-all nil)
|
lsp-eldoc-render-all nil)
|
||||||
|
|
||||||
;; hack to make LSP servers use current directory if no project detected
|
|
||||||
(defun my-default-directory ()
|
|
||||||
"Returns the current directory."
|
|
||||||
default-directory)
|
|
||||||
(advice-add #'lsp--suggest-project-root
|
|
||||||
:after-until #'my-default-directory)
|
|
||||||
|
|
||||||
(use-package company-lsp :ensure
|
(use-package company-lsp :ensure
|
||||||
:config
|
:config
|
||||||
(push 'company-lsp company-backends)
|
|
||||||
(setq company-lsp-enable-snippet t
|
(setq company-lsp-enable-snippet t
|
||||||
company-lsp-cache-candidates t))
|
company-lsp-async t
|
||||||
|
company-lsp-cache-candidates nil))
|
||||||
|
|
||||||
(use-package lsp-ui :ensure
|
(use-package lsp-ui :ensure
|
||||||
:bind (:map lsp-ui-mode-map
|
:bind (:map lsp-ui-mode-map
|
||||||
([remap xref-find-definitions] . lsp-ui-peek-find-definitions)
|
([remap xref-find-definitions] . lsp-ui-peek-find-definitions)
|
||||||
([remap xref-find-references] . lsp-ui-peek-find-references))
|
([remap xref-find-references] . lsp-ui-peek-find-references))
|
||||||
:hook (lsp-mode . lsp-ui-mode)
|
|
||||||
:config
|
:config
|
||||||
(setq lsp-ui-sideline-ignore-duplicate t
|
(setq lsp-ui-sideline-ignore-duplicate t
|
||||||
lsp-ui-sideline-update-mode 'point))
|
lsp-ui-doc-max-height 10
|
||||||
|
;; lsp-ui-sideline-update-mode 'point
|
||||||
(use-package lsp-python
|
))
|
||||||
;; requires python-language-server and/or python2-language-server
|
|
||||||
:hook (python-mode . lsp-python-enable))
|
|
||||||
|
|
||||||
(use-package lsp-java
|
(use-package lsp-java
|
||||||
;; requires eclipse jdt language server ("jdtls" in arch)
|
;; requires eclipse jdt language server ("jdtls" in arch)
|
||||||
:hook (java-mode . lsp-java-enable)
|
:hook (java-mode . lsp-java-enable)
|
||||||
:config
|
:config
|
||||||
(setq lsp-java-save-action-organize-imports nil))
|
(setq lsp-java-save-action-organize-imports nil)))
|
||||||
|
|
||||||
(use-package lsp-typescript
|
|
||||||
;; requires typescript-language-server
|
|
||||||
:hook ((js-mode . lsp-typescript-enable)
|
|
||||||
(typescript-mode . lsp-typescript-enable)
|
|
||||||
(js2-mode . lsp-typescript-enable)
|
|
||||||
(rjsx-mode . lsp-typescript-enable)))
|
|
||||||
|
|
||||||
(use-package lsp-html
|
|
||||||
;; requires vscode-html-languageserver-bin
|
|
||||||
:hook ((html-mode . lsp-html-enable)
|
|
||||||
(web-mode . lsp-html-enable)))
|
|
||||||
|
|
||||||
(use-package lsp-css
|
|
||||||
;; requires vscode-css-languageserver-bin
|
|
||||||
:hook ((css-mode . lsp-css-enable))))
|
|
||||||
|
|
||||||
;;;; optional external packages
|
;;;; optional external packages
|
||||||
(use-package arduino-mode
|
(use-package arduino-mode
|
||||||
|
Loading…
Reference in New Issue
Block a user