@@ -13,6 +13,7 @@ let s:utils.log = {}
13
13
14
14
function ! OmniSharp#actions#test#Debug (nobuild, ... ) abort
15
15
if ! s: utils .capabilities () | return | endif
16
+ if ! s: utils .isrunning () | return | endif
16
17
let s: nobuild = a: nobuild
17
18
if ! OmniSharp#util#HasVimspector ()
18
19
return s: utils .log .warn (' Vimspector required to debug tests' )
@@ -111,6 +112,7 @@ endfunction
111
112
112
113
function ! OmniSharp#actions#test#Run (nobuild, ... ) abort
113
114
if ! s: utils .capabilities () | return | endif
115
+ if ! s: utils .isrunning () | return | endif
114
116
let s: nobuild = a: nobuild
115
117
let bufnr = a: 0 ? (type (a: 1 ) == type (' ' ) ? bufnr (a: 1 ) : a: 1 ) : bufnr (' %' )
116
118
let RunTest = funcref (' s:run.single.test' , [a: 0 > 1 ? a: 2 : ' ' ])
@@ -186,6 +188,7 @@ endfunction
186
188
function ! OmniSharp#actions#test#RunInFile (nobuild, ... ) abort
187
189
let s: nobuild = a: nobuild
188
190
if ! s: utils .capabilities () | return | endif
191
+ if ! s: utils .isrunning () | return | endif
189
192
if a: 0 && type (a: 1 ) == type ([])
190
193
let files = a: 1
191
194
elseif a: 0 && type (a: 1 ) == type (' ' )
@@ -395,6 +398,10 @@ function! s:utils.capabilities() abort
395
398
if g: OmniSharp_translate_cygwin_wsl
396
399
return self .log .warn (' Tests do not work in WSL unfortunately' )
397
400
endif
401
+ return 1
402
+ endfunction
403
+
404
+ function ! s: utils .isrunning () abort
398
405
if s: run .running
399
406
return self .log .warn (' A test is already running' )
400
407
endif
0 commit comments