Improving flycheck and consult usage

This commit is contained in:
Joseph Ferano 2022-12-08 04:33:21 +04:00
parent 053cd3209d
commit b1269af232

View File

@ -539,6 +539,7 @@ The theme of `C-x 4` bindings is that they operate on other windows, so this fun
'("\\*compilation\\*" compilation-mode '("\\*compilation\\*" compilation-mode
"^\\*vterm\\*" vterm-mode "^\\*vterm\\*" vterm-mode
"^\\*Flymake.*" flymake-mode "^\\*Flymake.*" flymake-mode
"^\\*Flycheck.*" flycheck-error-list-mode
"^\\*lsp-help\\*" lsp-help-mode "^\\*lsp-help\\*" lsp-help-mode
;; "^\\*ansi-term\\*$" term-mode ;; "^\\*ansi-term\\*$" term-mode
("^\\*Warnings\\*$" . hide) ("^\\*Warnings\\*$" . hide)
@ -743,6 +744,7 @@ targets."
*** Consult *** Consult
#+begin_src emacs-lisp #+begin_src emacs-lisp
(straight-use-package 'consult) (straight-use-package 'consult)
(straight-use-package 'consult-lsp)
;; (defun joe/consult-line () ;; (defun joe/consult-line ()
;; (interactive) ;; (interactive)
@ -1032,12 +1034,10 @@ startup. Reason we have to call this is so the vterm fucntion can call `vterm--i
(setq lsp-eldoc-render-all nil) (setq lsp-eldoc-render-all nil)
(evil-global-set-key 'normal (kbd "M-d") #'lsp-describe-thing-at-point) (evil-global-set-key 'normal (kbd "M-d") #'lsp-describe-thing-at-point)
(evil-global-set-key 'normal (kbd "<leader>le") 'flycheck-mode)
(evil-global-set-key 'normal (kbd "<leader>lh") 'lsp-headerline-breadcrumb-mode) (evil-global-set-key 'normal (kbd "<leader>lh") 'lsp-headerline-breadcrumb-mode)
(evil-global-set-key 'normal (kbd "<leader>li") 'lsp-rust-analyzer-inlay-hints-mode) (evil-global-set-key 'normal (kbd "<leader>li") 'lsp-rust-analyzer-inlay-hints-mode)
;; (evil-global-set-key 'normal (kbd "<leader>ls") 'lsp-) (evil-global-set-key 'normal (kbd "<leader>cs") 'consult-lsp-symbols)
;; (lsp-request-async "textDocument/hover" (lsp--text-document-position-params) (evil-global-set-key 'normal (kbd "<leader>cf") 'consult-lsp-file-symbols)
;; (lambda (docs) (message docs)))
;; This function allows us to extract Rust's true function signature ;; This function allows us to extract Rust's true function signature
(cl-defmethod lsp-clients-extract-signature-on-hover (contents (_server-id (eql rust-analyzer))) (cl-defmethod lsp-clients-extract-signature-on-hover (contents (_server-id (eql rust-analyzer)))
@ -1061,9 +1061,11 @@ startup. Reason we have to call this is so the vterm fucntion can call `vterm--i
;; TODO Add wrapping to these functions ;; TODO Add wrapping to these functions
(evil-global-set-key 'normal (kbd "M-e") #'flycheck-next-error) (evil-global-set-key 'normal (kbd "M-e") #'flycheck-next-error)
(evil-global-set-key 'normal (kbd "M-E") #'flycheck-previous-error) (evil-global-set-key 'normal (kbd "M-E") #'flycheck-previous-error)
(evil-global-set-key 'normal (kbd "<leader>ee") 'flycheck-mode)
(evil-global-set-key 'normal (kbd "<leader>el") #'flycheck-list-errors) (evil-global-set-key 'normal (kbd "<leader>el") #'flycheck-list-errors)
(evil-global-set-key 'normal (kbd "<leader>ce") #'consult-lsp-diagnostics)
#+end_src #+end_src
** * Languages ** Languages
*** Rust *** Rust
#+begin_src emacs-lisp #+begin_src emacs-lisp
(straight-use-package 'rustic) (straight-use-package 'rustic)