summaryrefslogtreecommitdiff
path: root/ale_linters/cs/mcsc.vim
diff options
context:
space:
mode:
authorhernot <christoph@out-world.com>2019-07-02 09:18:17 +0200
committerw0rp <w0rp@users.noreply.github.com>2019-07-02 08:18:17 +0100
commit46ab7c590404d60567fe57390607c3dc51933c0e (patch)
tree3261827c44d9a7d8fbe8b2154400b2959c0ff5fa /ale_linters/cs/mcsc.vim
parent870058689063b4ba69851cb3f7e71726d2263cf0 (diff)
downloadale-46ab7c590404d60567fe57390607c3dc51933c0e.zip
Support csc, update mcsc (#2586)
* Added a new csc linter for C# code. * More output is now handled for mcsc.
Diffstat (limited to 'ale_linters/cs/mcsc.vim')
-rw-r--r--ale_linters/cs/mcsc.vim34
1 files changed, 24 insertions, 10 deletions
diff --git a/ale_linters/cs/mcsc.vim b/ale_linters/cs/mcsc.vim
index dd067eba..0e4e5667 100644
--- a/ale_linters/cs/mcsc.vim
+++ b/ale_linters/cs/mcsc.vim
@@ -52,20 +52,34 @@ function! ale_linters#cs#mcsc#Handle(buffer, lines) abort
" NOTE: pattern also captures file name as linter compiles all
" files within the source tree rooted at the specified source
" path and not just the file loaded in the buffer
- let l:pattern = '^\v(.+\.cs)\((\d+),(\d+)\)\: ([^ ]+) ([^ ]+): (.+)$'
+ let l:patterns = [
+ \ '^\v(.+\.cs)\((\d+),(\d+)\)\:\s+([^ ]+)\s+([cC][sS][^ ]+):\s(.+)$',
+ \ '^\v([^ ]+)\s+([Cc][sS][^ ]+):\s+(.+)$',
+ \]
let l:output = []
let l:dir = s:GetWorkingDirectory(a:buffer)
- for l:match in ale#util#GetMatches(a:lines, l:pattern)
- call add(l:output, {
- \ 'filename': ale#path#GetAbsPath(l:dir, l:match[1]),
- \ 'lnum': l:match[2] + 0,
- \ 'col': l:match[3] + 0,
- \ 'type': l:match[4] is# 'error' ? 'E' : 'W',
- \ 'code': l:match[5],
- \ 'text': l:match[6],
- \})
+ for l:match in ale#util#GetMatches(a:lines, l:patterns)
+ if len(l:match) > 6 && strlen(l:match[5]) > 2 && l:match[5][:1] is? 'CS'
+ call add(l:output, {
+ \ 'filename': ale#path#GetAbsPath(l:dir, l:match[1]),
+ \ 'lnum': l:match[2] + 0,
+ \ 'col': l:match[3] + 0,
+ \ 'type': l:match[4] is# 'error' ? 'E' : 'W',
+ \ 'code': l:match[5],
+ \ 'text': l:match[6] ,
+ \})
+ elseif strlen(l:match[2]) > 2 && l:match[2][:1] is? 'CS'
+ call add(l:output, {
+ \ 'filename':'<mcs>',
+ \ 'lnum': -1,
+ \ 'col': -1,
+ \ 'type': l:match[1] is# 'error' ? 'E' : 'W',
+ \ 'code': l:match[2],
+ \ 'text': l:match[3],
+ \})
+ endif
endfor
return l:output