Skip to content

Commit 677a37b

Browse files
authored
Call flycheck stop before enabling flycheck (#2225)
Fixes #2207 - make sure that if there is checker running it is stopped before starting lsp-mode one.
1 parent b82dc51 commit 677a37b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lsp-diagnostics.el

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ on top the flycheck face for that error level."
7878
(declare-function flycheck-define-error-level "ext:flycheck" (level &rest properties))
7979
(declare-function flycheck-buffer "ext:flycheck")
8080
(declare-function flycheck-valid-checker-p "ext:flycheck")
81+
(declare-function flycheck-stop "ext:flycheck")
8182

8283
(declare-function lsp-cpp-flycheck-clang-tidy-error-explainer "lsp-cpp")
8384

@@ -200,6 +201,7 @@ See https://github.com/emacs-lsp/lsp-mode."
200201
(lsp-cpp-flycheck-clang-tidy-error-explainer e))
201202
(t (flycheck-error-message e))))))
202203
(flycheck-mode 1)
204+
(flycheck-stop)
203205
(setq-local flycheck-checker 'lsp)
204206
(lsp-flycheck-add-mode major-mode)
205207
(add-to-list 'flycheck-checkers 'lsp)

0 commit comments

Comments
 (0)