Skip to content

Commit 6069800

Browse files
committed
Update testrunner state when debugging test
1 parent 502d631 commit 6069800

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

autoload/OmniSharp/actions/test.vim

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function! s:debug.prepare(bufferTests) abort
3232
let project = OmniSharp#GetHost(bufnr).project
3333
let targetFramework = project.MsBuildProject.TargetFramework
3434
let opts = {
35-
\ 'ResponseHandler': funcref('s:debug.launch', [bufnr, tests]),
35+
\ 'ResponseHandler': funcref('s:debug.launch', [bufnr, currentTest.name]),
3636
\ 'Parameters': {
3737
\ 'MethodName': currentTest.name,
3838
\ 'NoBuild': get(s:, 'nobuild', 0),
@@ -45,12 +45,14 @@ function! s:debug.prepare(bufferTests) abort
4545
call OmniSharp#stdio#Request('/v2/debugtest/getstartinfo', opts)
4646
endfunction
4747

48-
function! s:debug.launch(bufnr, tests, response) abort
48+
function! s:debug.launch(bufnr, testname, response) abort
4949
let args = split(substitute(a:response.Body.Arguments, '\"', '', 'g'), ' ')
5050
let cmd = a:response.Body.FileName
5151
let testhost = [cmd] + args
5252
if !s:debug.process.start(testhost) | return | endif
5353
let s:run.running = 1
54+
call OmniSharp#testrunner#StateRunning(a:bufnr, a:testname)
55+
let s:debug.bufnr = a:bufnr
5456
let s:omnisharp_pre_debug_cwd = getcwd()
5557
call vimspector#LaunchWithConfigurations({
5658
\ 'attach': {
@@ -77,6 +79,7 @@ function! s:debug.complete(response) abort
7779
if !a:response.Success
7880
call s:utils.log.warn(['Error debugging unit test', a:response.Message])
7981
endif
82+
call OmniSharp#testrunner#StateSkipped(s:debug.bufnr)
8083
endfunction
8184

8285
function! s:debug.process.start(command) abort

autoload/OmniSharp/testrunner.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ function! s:SpinnerSpin(test, lnum, timer) abort
123123
call setbufvar(s:testrunner_bufnr, '&modifiable', 1)
124124
call setbufline(s:testrunner_bufnr, a:lnum, line)
125125
call setbufvar(s:testrunner_bufnr, '&modifiable', 0)
126+
call setbufvar(s:testrunner_bufnr, '&modified', 0)
126127
endfunction
127128

128129
function! s:SpinnerStart(test, lnum) abort

0 commit comments

Comments
 (0)