diff options
author | Horacio Sanson <hsanson@gmail.com> | 2021-01-20 20:48:53 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-20 20:48:53 +0900 |
commit | 7b42dd7387f4c45ac7d5fffb6662d0177f5e1d54 (patch) | |
tree | 628b4db39414b04c95c5bcc29c707dda0112f469 /ale_linters | |
parent | 16c45b82130c602c1542287d4509fc2809035e04 (diff) | |
parent | 303b89a6b4ace2ee41818499b958a2f486e8864c (diff) | |
download | ale-7b42dd7387f4c45ac7d5fffb6662d0177f5e1d54.zip |
Merge pull request #3475 from benknoble/dafny-include-timeouts
dafny: add a timeLimit option and message-parsing
Diffstat (limited to 'ale_linters')
-rw-r--r-- | ale_linters/dafny/dafny.vim | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/ale_linters/dafny/dafny.vim b/ale_linters/dafny/dafny.vim index e6021d99..de7a7bb8 100644 --- a/ale_linters/dafny/dafny.vim +++ b/ale_linters/dafny/dafny.vim @@ -14,13 +14,28 @@ function! ale_linters#dafny#dafny#Handle(buffer, lines) abort \ }) endfor + for l:match in ale#util#GetMatches(a:lines, '\v(.*)\((\d+),(\d+)\): (Verification of .{-} timed out after \d+ seconds)') + call add(l:output, { + \ 'bufnr': a:buffer, + \ 'col': l:match[3] + 0, + \ 'lnum': l:match[2] + 0, + \ 'text': l:match[4], + \ 'type': 'E', + \ }) + endfor + return l:output endfunction +function! ale_linters#dafny#dafny#GetCommand(buffer) abort + return printf('dafny %%s /compile:0 /timeLimit:%d', ale#Var(a:buffer, 'dafny_dafny_timelimit')) +endfunction + +call ale#Set('dafny_dafny_timelimit', 10) call ale#linter#Define('dafny', { \ 'name': 'dafny', \ 'executable': 'dafny', -\ 'command': 'dafny %s /compile:0', +\ 'command': function('ale_linters#dafny#dafny#GetCommand'), \ 'callback': 'ale_linters#dafny#dafny#Handle', \ 'lint_file': 1, \ }) |