expect warn or error

This commit is contained in:
Atsuya Takagi 2021-01-04 16:00:30 +09:00
parent 280d2dedae
commit 89403b4a06

View file

@ -13,7 +13,7 @@ function! ale_linters#vala#vala_lint#GetCommand(buffer) abort
endfunction
function! ale_linters#vala#vala_lint#Handle(buffer, lines) abort
let l:pattern = '^\s*\(\d\+\)\.\(\d\+\)\s\+\(\w\+\)\s\+\(.\+\)\s\([A-Za-z0-9_\-]\+\)'
let l:pattern = '^\s*\(\d\+\)\.\(\d\+\)\s\+\(error\|warn\)\s\+\(.\+\)\s\([A-Za-z0-9_\-]\+\)'
let l:output = []
for l:line in a:lines
@ -26,10 +26,13 @@ function! ale_linters#vala#vala_lint#Handle(buffer, lines) abort
continue
endif
let l:refined_type = l:match[3] is# 'warn' ? 'W' : 'E'
let l:cleaned_text = substitute(l:match[4], '^\s*\(.\{-}\)\s*$', '\1', '')
let l:lnum = l:match[1] + 0
let l:column = l:match[2] + 0
let l:type = 'E'
let l:text = substitute(l:match[4], '^\s*\(.\{-}\)\s*$', '\1', '')
let l:type = l:refined_type
let l:text = l:cleaned_text
let l:code = l:match[5]
call add(l:output, {