Skip to content

Commit

Permalink
Clean diagnostics when kill lsp-bridge process.
Browse files Browse the repository at this point in the history
  • Loading branch information
manateelazycat committed Sep 10, 2024
1 parent 0983d53 commit a17ef79
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions lsp-bridge.el
Original file line number Diff line number Diff line change
Expand Up @@ -1208,8 +1208,8 @@ So we build this macro to restore postion after code format."
"Stop LSP-Bridge process and kill all LSP-Bridge buffers."
(interactive)

;; Hide diagnostics.
(lsp-bridge-diagnostic-hide-overlays)
;; Clean up.
(lsp-bridge--cleanup)

;; Run stop process hooks.
(run-hooks 'lsp-bridge-stop-process-hook)
Expand Down Expand Up @@ -2636,13 +2636,17 @@ We need exclude `markdown-code-fontification:*' buffer in `lsp-bridge-monitor-be
(apply orig-fun arg args))
(advice-add #'rename-file :around #'lsp-bridge--rename-file-advisor)

;; We use `lsp-bridge-revert-buffer-flag' var avoid lsp-bridge send change_file request while execute `revert-buffer' command.
(defun lsp-bridge--revert-buffer-advisor (orig-fun &optional arg &rest args)
(defun lsp-bridge--cleanup ()
;; We need clean diagnostic overlays before revert buffer.
(lsp-bridge-diagnostic-hide-overlays)

;; Hide inlay hint overlays before revert buffer.
(lsp-bridge-inlay-hint-hide-overlays)
(lsp-bridge-inlay-hint-hide-overlays))

;; We use `lsp-bridge-revert-buffer-flag' var avoid lsp-bridge send change_file request while execute `revert-buffer' command.
(defun lsp-bridge--revert-buffer-advisor (orig-fun &optional arg &rest args)
;; Clean up.
(lsp-bridge--cleanup)

(setq-local lsp-bridge-revert-buffer-flag t)
(apply orig-fun arg args)
Expand Down

0 comments on commit a17ef79

Please sign in to comment.