Commit 00de38eb authored by Erik Hetzner's avatar Erik Hetzner Committed by Sebastian Wiesner

Add support for handlebars checking in web-mode

parent 63def1e3
......@@ -40,4 +40,5 @@
(depends-on "scss-mode")
(depends-on "slim-mode")
(depends-on "yaml-mode")
(depends-on "rpm-spec-mode"))
(depends-on "rpm-spec-mode")
(depends-on "web-mode"))
......@@ -6117,7 +6117,17 @@ See URL `http://handlebarsjs.com/'."
"Error: Parse error on line " line ":" (optional "\r") "\n"
(zero-or-more not-newline) "\n" (zero-or-more not-newline) "\n"
(message) line-end))
:modes (handlebars-mode handlebars-sgml-mode))
:modes (handlebars-mode handlebars-sgml-mode web-mode)
:predicate
(lambda ()
(if (eq major-mode 'web-mode)
;; Check if this is a handlebars file since web-mode does not store the
;; non-canonical engine name
(let* ((regexp-alist (bound-and-true-p web-mode-engine-file-regexps))
(pattern (cdr (assoc "handlebars" regexp-alist))))
(and pattern (buffer-file-name)
(string-match-p pattern (buffer-file-name))))
t)))
(defconst flycheck-haskell-module-re
(rx line-start (zero-or-more (or "\n" (any space)))
......
......@@ -4271,7 +4271,7 @@ The term \"1\" has type \"nat\" while it is expected to have type
(flycheck-ert-def-checker-test handlebars handlebars nil
(flycheck-ert-should-syntax-check
"checkers/handlebars-error.hbs" 'handlebars-mode
"checkers/handlebars-error.hbs" '(handlebars-mode web-mode)
'(2 nil error "Expecting 'ID', 'STRING', 'NUMBER', 'BOOLEAN', 'DATA', got 'INVALID'"
:checker handlebars)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment