diff options
author | w0rp <devw0rp@gmail.com> | 2017-11-18 23:15:23 +0000 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-11-18 23:15:23 +0000 |
commit | cefc5dc5b8fc7cec75222f3cd4d090c1bd48f796 (patch) | |
tree | f8f134e90d2697e3c2d2a654e30bf4e6221b13d7 /autoload | |
parent | 2b50e68c7e2fb5df831f83ba89a7bd088629e1aa (diff) | |
download | ale-cefc5dc5b8fc7cec75222f3cd4d090c1bd48f796.zip |
#852 - Capture error codes for csslint
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/ale/handlers/css.vim | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/autoload/ale/handlers/css.vim b/autoload/ale/handlers/css.vim index 4c1b81cb..c7ae7c42 100644 --- a/autoload/ale/handlers/css.vim +++ b/autoload/ale/handlers/css.vim @@ -14,23 +14,22 @@ function! ale#handlers#css#HandleCSSLintFormat(buffer, lines) abort let l:output = [] for l:match in ale#util#GetMatches(a:lines, l:pattern) - let l:text = l:match[4] - let l:type = l:match[3] + let l:item = { + \ 'lnum': l:match[1] + 0, + \ 'col': l:match[2] + 0, + \ 'type': l:match[3] is# 'Warning' ? 'W' : 'E', + \ 'text': l:match[4], + \} - let l:group_match = matchlist(l:text, '\v^(.+) \((.+)\)$') + let l:code_match = matchlist(l:match[4], '\v(.+) \(([^(]+)\)$') - " Put the error group at the front, so we can see what kind of error - " it is on small echo lines. - if !empty(l:group_match) - let l:text = '(' . l:group_match[2] . ') ' . l:group_match[1] + " Split up the error code and the text if we find one. + if !empty(l:code_match) + let l:item.text = l:code_match[1] + let l:item.code = l:code_match[2] endif - call add(l:output, { - \ 'lnum': l:match[1] + 0, - \ 'col': l:match[2] + 0, - \ 'text': l:text, - \ 'type': l:type is# 'Warning' ? 'W' : 'E', - \}) + call add(l:output, l:item) endfor return l:output |