Merge pull request #589 from bardzusny/ember-template-lint-handler-parsing-error

Ember-template-lint handler: properly handle template parsing errors.
This commit is contained in:
w0rp
2017-05-30 09:45:20 +01:00
committed by w0rp
parent e94aea9144
commit 9b6d6344b2
2 changed files with 44 additions and 7 deletions
+17 -7
View File
@@ -35,13 +35,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