diff options
author | Adrian Zalewski <aazalewski@hotmail.com> | 2017-05-28 21:19:47 +0200 |
---|---|---|
committer | Adrian Zalewski <aazalewski@hotmail.com> | 2017-05-28 21:19:47 +0200 |
commit | 7ed343965cb839263466fa3b3a028a7581d61934 (patch) | |
tree | 7aa218bfc43347ab66bb81c16a2859899ddd2ba9 /ale_linters/handlebars | |
parent | 945ed7d4e7d801108103e97ac41063a85c3b4c5d (diff) | |
download | ale-7ed343965cb839263466fa3b3a028a7581d61934.zip |
Ember-template-lint handler: properly handle template parsing errors.
Diffstat (limited to 'ale_linters/handlebars')
-rw-r--r-- | ale_linters/handlebars/embertemplatelint.vim | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/ale_linters/handlebars/embertemplatelint.vim b/ale_linters/handlebars/embertemplatelint.vim index bbf7dd90..e7fa149c 100644 --- a/ale_linters/handlebars/embertemplatelint.vim +++ b/ale_linters/handlebars/embertemplatelint.vim @@ -26,13 +26,23 @@ function! ale_linters#handlebars#embertemplatelint#Handle(buffer, lines) abort let l:file_errors = values(l:input_json)[0] for l:error in l:file_errors - call add(l:output, { - \ 'bufnr': a:buffer, - \ 'lnum': l:error.line, - \ 'col': l:error.column, - \ 'text': l:error.rule . ': ' . l:error.message, - \ 'type': l:error.severity == 1 ? 'W' : 'E', - \}) + if has_key(l:error, 'fatal') + call add(l:output, { + \ 'bufnr': a:buffer, + \ 'lnum': 1, + \ 'col': 1, + \ 'text': l:error.message, + \ 'type': l:error.severity == 1 ? 'W' : 'E', + \}) + else + call add(l:output, { + \ 'bufnr': a:buffer, + \ 'lnum': l:error.line, + \ 'col': l:error.column, + \ 'text': l:error.rule . ': ' . l:error.message, + \ 'type': l:error.severity == 1 ? 'W' : 'E', + \}) + endif endfor return l:output |