mirror of https://github.com/dense-analysis/ale
dafny: add a timeLimit option and message-parsing
This commit is contained in:
parent
08295ce174
commit
3f01cc247c
|
@ -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,
|
||||
\ })
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
===============================================================================
|
||||
ALE Dafny Integration *ale-dafny-options*
|
||||
|
||||
|
||||
===============================================================================
|
||||
dafny *ale-dafny-dafny*
|
||||
|
||||
g:ale_dafny_dafny_timelimit *g:ale_dafny_dafny_timelimit*
|
||||
*b:ale_dafny_dafny_timelimit*
|
||||
Type: |Number|
|
||||
Default: `10`
|
||||
|
||||
This variable sets the `/timeLimit` used for dafny.
|
||||
|
||||
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
|
@ -2571,6 +2571,8 @@ documented in additional help files.
|
|||
dfmt..................................|ale-d-dfmt|
|
||||
dls...................................|ale-d-dls|
|
||||
uncrustify............................|ale-d-uncrustify|
|
||||
dafny...................................|ale-dafny-options|
|
||||
dafny.................................|ale-dafny-dafny|
|
||||
dart....................................|ale-dart-options|
|
||||
dartanalyzer..........................|ale-dart-dartanalyzer|
|
||||
dartfmt...............................|ale-dart-dartfmt|
|
||||
|
|
Loading…
Reference in New Issue