Lazy load flycheck
This commit is contained in:
parent
095a83896a
commit
19b478efbd
|
@ -21,19 +21,30 @@
|
||||||
:defer t
|
:defer t
|
||||||
:init
|
:init
|
||||||
(progn
|
(progn
|
||||||
|
(spacemacs|add-transient-hook prog-mode-hook
|
||||||
|
(lambda () (when syntax-checking-enable-by-default
|
||||||
|
(global-flycheck-mode 1)))
|
||||||
|
lazy-load-flycheck)
|
||||||
(setq flycheck-standard-error-navigation nil
|
(setq flycheck-standard-error-navigation nil
|
||||||
flycheck-global-modes nil)
|
flycheck-global-modes nil)
|
||||||
|
;; key bindings
|
||||||
|
(spacemacs/set-leader-keys
|
||||||
|
"eb" 'flycheck-buffer
|
||||||
|
"ec" 'flycheck-clear
|
||||||
|
"eh" 'flycheck-describe-checker
|
||||||
|
"el" 'spacemacs/toggle-flycheck-error-list
|
||||||
|
"eL" 'spacemacs/goto-flycheck-error-list
|
||||||
|
"es" 'flycheck-select-checker
|
||||||
|
"eS" 'flycheck-set-checker-executable
|
||||||
|
"ev" 'flycheck-verify-setup
|
||||||
|
"ex" 'flycheck-explain-error-at-point)
|
||||||
(spacemacs|add-toggle syntax-checking
|
(spacemacs|add-toggle syntax-checking
|
||||||
:mode flycheck-mode
|
:mode flycheck-mode
|
||||||
:documentation "Enable error and syntax checking."
|
:documentation "Enable error and syntax checking."
|
||||||
:evil-leader "ts")
|
:evil-leader "ts"))
|
||||||
|
:config
|
||||||
|
(progn
|
||||||
(spacemacs|diminish flycheck-mode " ⓢ" " s")
|
(spacemacs|diminish flycheck-mode " ⓢ" " s")
|
||||||
|
|
||||||
(when syntax-checking-enable-by-default
|
|
||||||
(global-flycheck-mode 1))
|
|
||||||
|
|
||||||
;; Custom fringe indicator
|
;; Custom fringe indicator
|
||||||
(when (and (fboundp 'define-fringe-bitmap)
|
(when (and (fboundp 'define-fringe-bitmap)
|
||||||
(not syntax-checking-use-original-bitmaps))
|
(not syntax-checking-use-original-bitmaps))
|
||||||
|
@ -55,7 +66,6 @@
|
||||||
#b00000000
|
#b00000000
|
||||||
#b00000000
|
#b00000000
|
||||||
#b00000000)))
|
#b00000000)))
|
||||||
|
|
||||||
(let ((bitmap (if syntax-checking-use-original-bitmaps
|
(let ((bitmap (if syntax-checking-use-original-bitmaps
|
||||||
'flycheck-fringe-bitmap-double-arrow
|
'flycheck-fringe-bitmap-double-arrow
|
||||||
'my-flycheck-fringe-indicator)))
|
'my-flycheck-fringe-indicator)))
|
||||||
|
@ -83,19 +93,7 @@
|
||||||
:bindings
|
:bindings
|
||||||
"RET" 'flycheck-error-list-goto-error
|
"RET" 'flycheck-error-list-goto-error
|
||||||
"j" 'flycheck-error-list-next-error
|
"j" 'flycheck-error-list-next-error
|
||||||
"k" 'flycheck-error-list-previous-error)
|
"k" 'flycheck-error-list-previous-error))))
|
||||||
|
|
||||||
;; key bindings
|
|
||||||
(spacemacs/set-leader-keys
|
|
||||||
"eb" 'flycheck-buffer
|
|
||||||
"ec" 'flycheck-clear
|
|
||||||
"eh" 'flycheck-describe-checker
|
|
||||||
"el" 'spacemacs/toggle-flycheck-error-list
|
|
||||||
"eL" 'spacemacs/goto-flycheck-error-list
|
|
||||||
"es" 'flycheck-select-checker
|
|
||||||
"eS" 'flycheck-set-checker-executable
|
|
||||||
"ev" 'flycheck-verify-setup
|
|
||||||
"ex" 'flycheck-explain-error-at-point))))
|
|
||||||
|
|
||||||
(defun syntax-checking/init-flycheck-pos-tip ()
|
(defun syntax-checking/init-flycheck-pos-tip ()
|
||||||
(use-package flycheck-pos-tip
|
(use-package flycheck-pos-tip
|
||||||
|
|
|
@ -41,8 +41,9 @@
|
||||||
(spacemacs/enable-flycheck 'typescript-mode)
|
(spacemacs/enable-flycheck 'typescript-mode)
|
||||||
(spacemacs/enable-flycheck 'typescript-tsx-mode)
|
(spacemacs/enable-flycheck 'typescript-tsx-mode)
|
||||||
(with-eval-after-load 'tide
|
(with-eval-after-load 'tide
|
||||||
(flycheck-add-mode 'typescript-tide 'typescript-tsx-mode))
|
(with-eval-after-load 'flycheck
|
||||||
(flycheck-add-mode 'typescript-tslint 'typescript-tsx-mode))
|
(flycheck-add-mode 'typescript-tide 'typescript-tsx-mode)
|
||||||
|
(flycheck-add-mode 'typescript-tslint 'typescript-tsx-mode))))
|
||||||
|
|
||||||
(defun typescript/post-init-lsp-mode ()
|
(defun typescript/post-init-lsp-mode ()
|
||||||
(add-hook 'typescript-mode-hook 'lsp-mode))
|
(add-hook 'typescript-mode-hook 'lsp-mode))
|
||||||
|
|
Loading…
Reference in a new issue