diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 5a4a700..ac55eea 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -467,57 +467,34 @@ :bind (("C-a" . crux-move-beginning-of-line))) (use-package lsp-mode :ensure + :hook ((python-mode html-mode web-mode css-mode) . lsp) :config + (use-package lsp-clients :demand) + (setq lsp-inhibit-message t 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 :config - (push 'company-lsp company-backends) (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 :bind (:map lsp-ui-mode-map ([remap xref-find-definitions] . lsp-ui-peek-find-definitions) ([remap xref-find-references] . lsp-ui-peek-find-references)) - :hook (lsp-mode . lsp-ui-mode) :config (setq lsp-ui-sideline-ignore-duplicate t - 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)) + lsp-ui-doc-max-height 10 + ;; lsp-ui-sideline-update-mode 'point + )) (use-package lsp-java ;; requires eclipse jdt language server ("jdtls" in arch) :hook (java-mode . lsp-java-enable) :config - (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)))) + (setq lsp-java-save-action-organize-imports nil))) ;;;; optional external packages (use-package arduino-mode