Skip to content

Commit

Permalink
perf(zig): quote flycheck-define-checker
Browse files Browse the repository at this point in the history
Eager expansion of the flycheck-define-checker macro causes flycheck to
be unavoidably eager-loaded at startup, regardless of other deferral
techniques, slowing down startup considerably, as it pulls in a number
of associated packages/config with it.
  • Loading branch information
hlissner committed Sep 20, 2023
1 parent 96aed4b commit 3983fba
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions modules/lang/zig/config.el
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@

(when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))
(flycheck-define-checker zig
"A zig syntax checker using zig's `ast-check` command."
:command ("zig" "ast-check" (eval (buffer-file-name)))
:error-patterns
((error line-start (file-name) ":" line ":" column ": error: " (message) line-end))
:modes zig-mode)
(eval '(flycheck-define-checker zig
"A zig syntax checker using zig's `ast-check` command."
:command ("zig" "ast-check" (eval (buffer-file-name)))
:error-patterns
((error line-start (file-name) ":" line ":" column ": error: " (message) line-end))
:modes zig-mode)
t)
(add-to-list 'flycheck-checkers 'zig))

(map! :localleader
Expand Down

0 comments on commit 3983fba

Please sign in to comment.