summaryrefslogtreecommitdiff
path: root/ale_linters
diff options
context:
space:
mode:
authorHoracio Sanson <hsanson@gmail.com>2021-01-20 20:48:53 +0900
committerGitHub <noreply@github.com>2021-01-20 20:48:53 +0900
commit7b42dd7387f4c45ac7d5fffb6662d0177f5e1d54 (patch)
tree628b4db39414b04c95c5bcc29c707dda0112f469 /ale_linters
parent16c45b82130c602c1542287d4509fc2809035e04 (diff)
parent303b89a6b4ace2ee41818499b958a2f486e8864c (diff)
downloadale-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.vim17
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,
\ })