From 89403b4a0600011ad94d51a7aef9e26afe284fd6 Mon Sep 17 00:00:00 2001 From: Atsuya Takagi Date: Mon, 4 Jan 2021 16:00:30 +0900 Subject: [PATCH] expect warn or error --- ale_linters/vala/vala_lint.vim | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ale_linters/vala/vala_lint.vim b/ale_linters/vala/vala_lint.vim index b53e9b86..a38bf9bf 100644 --- a/ale_linters/vala/vala_lint.vim +++ b/ale_linters/vala/vala_lint.vim @@ -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, {