Emacs: Clear lsp-ui sideline diagnostics when we clear flycheck

This commit is contained in:
Joseph Ferano 2024-10-06 19:50:04 +07:00
parent 06ea611d53
commit 07f12bb78e

View File

@ -2243,8 +2243,6 @@ These help speed eglot up apparently [[https://www.reddit.com/r/emacs/comments/1
(setq lsp-ui-doc-position 'at-point) (setq lsp-ui-doc-position 'at-point)
(setq lsp-ui-doc-show-with-mouse nil) (setq lsp-ui-doc-show-with-mouse nil)
(add-hook 'after-save-hook #'flycheck-clear)
;; All this changes because we are using eglot now ;; All this changes because we are using eglot now
(when (boundp 'evil-mode) (when (boundp 'evil-mode)
(evil-global-set-key 'normal (kbd "M-d") #'lsp-ui-doc-glance) (evil-global-set-key 'normal (kbd "M-d") #'lsp-ui-doc-glance)
@ -2287,11 +2285,18 @@ These help speed eglot up apparently [[https://www.reddit.com/r/emacs/comments/1
(defun joe/flycheck-buffer-and-next () (interactive) (flycheck-buffer) (flycheck-next-error)) (defun joe/flycheck-buffer-and-next () (interactive) (flycheck-buffer) (flycheck-next-error))
(defun joe/flycheck-buffer-and-previous () (interactive) (flycheck-buffer) (flycheck-previous-error)) (defun joe/flycheck-buffer-and-previous () (interactive) (flycheck-buffer) (flycheck-previous-error))
(defun joe/flycheck-clear ()
(interactive)
(flycheck-clear)
(lsp-ui-sideline--erase))
(add-hook 'after-save-hook #'joe/flycheck-clear)
(when (boundp 'evil-mode) (when (boundp 'evil-mode)
(evil-global-set-key 'normal (kbd "M-E") #'joe/flycheck-buffer-and-previous) (evil-global-set-key 'normal (kbd "M-E") #'joe/flycheck-buffer-and-previous)
(evil-global-set-key 'normal (kbd "M-e") #'joe/flycheck-buffer-and-next) (evil-global-set-key 'normal (kbd "M-e") #'joe/flycheck-buffer-and-next)
(evil-global-set-key 'normal (kbd "C-M-e") #'flycheck-clear) (evil-global-set-key 'normal (kbd "C-M-e") #'joe/flycheck-clear)
(evil-global-set-key 'insert (kbd "C-M-e") #'flycheck-clear)) (evil-global-set-key 'insert (kbd "C-M-e") #'joe/flycheck-clear))
#+end_src #+end_src
*** Compilation *** Compilation
#+begin_src emacs-lisp #+begin_src emacs-lisp