Skip to content

Commit

Permalink
Allow opening test runner while test is running
Browse files Browse the repository at this point in the history
  • Loading branch information
nickspoons committed Apr 10, 2023
1 parent a5009f9 commit 3720976
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions autoload/OmniSharp/actions/test.vim
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ let s:utils.log = {}

function! OmniSharp#actions#test#Debug(nobuild, ...) abort
if !s:utils.capabilities() | return | endif
if !s:utils.isrunning() | return | endif
let s:nobuild = a:nobuild
if !OmniSharp#util#HasVimspector()
return s:utils.log.warn('Vimspector required to debug tests')
Expand Down Expand Up @@ -111,6 +112,7 @@ endfunction

function! OmniSharp#actions#test#Run(nobuild, ...) abort
if !s:utils.capabilities() | return | endif
if !s:utils.isrunning() | return | endif
let s:nobuild = a:nobuild
let bufnr = a:0 ? (type(a:1) == type('') ? bufnr(a:1) : a:1) : bufnr('%')
let RunTest = funcref('s:run.single.test', [a:0 > 1 ? a:2 : ''])
Expand Down Expand Up @@ -186,6 +188,7 @@ endfunction
function! OmniSharp#actions#test#RunInFile(nobuild, ...) abort
let s:nobuild = a:nobuild
if !s:utils.capabilities() | return | endif
if !s:utils.isrunning() | return | endif
if a:0 && type(a:1) == type([])
let files = a:1
elseif a:0 && type(a:1) == type('')
Expand Down Expand Up @@ -395,6 +398,10 @@ function! s:utils.capabilities() abort
if g:OmniSharp_translate_cygwin_wsl
return self.log.warn('Tests do not work in WSL unfortunately')
endif
return 1
endfunction

function! s:utils.isrunning() abort
if s:run.running
return self.log.warn('A test is already running')
endif
Expand Down

0 comments on commit 3720976

Please sign in to comment.