mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-08 21:44:47 +08:00
expect warn or error
This commit is contained in:
@@ -13,7 +13,7 @@ function! ale_linters#vala#vala_lint#GetCommand(buffer) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#vala#vala_lint#Handle(buffer, lines) abort
|
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 = []
|
let l:output = []
|
||||||
|
|
||||||
for l:line in a:lines
|
for l:line in a:lines
|
||||||
@@ -26,10 +26,13 @@ function! ale_linters#vala#vala_lint#Handle(buffer, lines) abort
|
|||||||
continue
|
continue
|
||||||
endif
|
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:lnum = l:match[1] + 0
|
||||||
let l:column = l:match[2] + 0
|
let l:column = l:match[2] + 0
|
||||||
let l:type = 'E'
|
let l:type = l:refined_type
|
||||||
let l:text = substitute(l:match[4], '^\s*\(.\{-}\)\s*$', '\1', '')
|
let l:text = l:cleaned_text
|
||||||
let l:code = l:match[5]
|
let l:code = l:match[5]
|
||||||
|
|
||||||
call add(l:output, {
|
call add(l:output, {
|
||||||
|
|||||||
Reference in New Issue
Block a user