From 73d02ab60344af6a4746e53afffb89ac30b1ee6f Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sat, 24 Sep 2022 12:35:03 -0700 Subject: fix(prog/lsp): apply a number of fixes related to LSP Now that I've switched back to LSP, there's some configuration to delete and some to update. The configuration related to rust is fixed (lsp-ui was not loading properly), and I'm also disabling the inlay hints (they are very intrusive, I'll need more tweaks to find something that works for me). For the LSP configuration itself, I'm tweaking a few more things, especially related to the UI. Finally, deleting configurations for eglot and go: eglot is replaced by lsp-mode, and go's configuration is in its own file. Change-Id: I73fb4b66c8816dd6e20efa358c81e3c306b8255f --- emacs/custom/my-lsp.el | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'emacs/custom/my-lsp.el') diff --git a/emacs/custom/my-lsp.el b/emacs/custom/my-lsp.el index 98c061a..c10e06c 100644 --- a/emacs/custom/my-lsp.el +++ b/emacs/custom/my-lsp.el @@ -7,26 +7,30 @@ (require 'lsp-mode) (require 'lsp-ui) +(require 'lsp-diagnostics) +(require 'consult-lsp) +(require 'lsp-completion) -(setq lsp-ui-doc-position 'at-point) +(setq lsp-ui-doc-enable t) ;; Enable documentation +(setq lsp-ui-doc-position 'at-point) ;; Show the documentation at point +(setq lsp-ui-doc-header t) +(setq lsp-ui-doc-include-signature t) (setq lsp-ui-peek-enable t) ;; Enable `lsp-ui-peek'. (setq lsp-ui-peek-show-directory t) ;; Show the directory of files. -(setq lsp-ui-sideline-enable t) ;; Enable `lsp-ui-sideline'. -(setq lsp-ui-sideline-show-hover t) ;; Show hover messages in sideline. -(setq lsp-ui-sideline-show-code-actions t) ;; Show code actions in sideline. +(setq lsp-ui-sideline-enable nil) ;; Don't enable `lsp-ui-sideline'. -(setq lsp-completion-enable t) ;; Enable `completion-at-point' integration. +(add-hook 'lsp-mode-hook #'lsp-ui-mode) -(require 'lsp-diagnostics) -(setq lsp-diagnostics-provider :flymake) +;; Enable `completion-at-point' integration. +(setq lsp-completion-enable t) -(add-hook 'lsp-mode-hook #'lsp-ui-mode) +;; The default is to use flycheck +(setq lsp-diagnostics-provider :flymake) -(require 'consult-lsp) (define-key lsp-mode-map [remap xref-find-apropos] #'consult-lsp-symbols) -(require 'lsp-completion) -(setq lsp-completion-provider :none) ;; I use corfu +;; Configure the completion to be corfu +(setq lsp-completion-provider :none) (add-hook 'lsp-completion-mode-hook (lambda () (setf (alist-get 'lsp-capf completion-category-defaults) '((styles . (orderless flex)))))) -- cgit 1.4.1