Skip to content

Commit b2a51c5

Browse files
committed
Fix RunTest error by properly persisting 'project'
1 parent d813c6a commit b2a51c5

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

autoload/OmniSharp/actions/project.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ endfunction
1616

1717
function! s:ProjectRH(Callback, bufnr, response) abort
1818
if !a:response.Success | return | endif
19-
let host = OmniSharp#GetHost(a:bufnr)
19+
let host = getbufvar(a:bufnr, 'OmniSharp_host')
2020
let host.project = a:response.Body
2121
call a:Callback()
2222
endfunction

autoload/OmniSharp/actions/test.vim

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@ set cpoptions&vim
33

44
let s:runningTest = 0
55

6-
function! OmniSharp#actions#test#Run() abort
6+
function! OmniSharp#actions#test#Run(...) abort
77
if !s:CheckCapabilities() | return | endif
8-
if !has_key(OmniSharp#GetHost(bufnr('%')), 'project')
8+
let bufnr = a:0 ? a:1 : bufnr('%')
9+
if !has_key(OmniSharp#GetHost(bufnr), 'project')
910
" Initialize the test by fetching the project for the buffer - then call
1011
" this function again in the callback
11-
call OmniSharp#actions#project#Get(bufnr('%'),
12-
\ function('OmniSharp#actions#test#Run'))
12+
call OmniSharp#actions#project#Get(bufnr,
13+
\ function('OmniSharp#actions#test#Run', [bufnr]))
1314
return
1415
endif
1516
let s:runningTest = 1
16-
call OmniSharp#actions#codestructure#Get(bufnr('%'),
17+
call OmniSharp#actions#codestructure#Get(bufnr,
1718
\ function('s:RunTest', [function('s:CBRunTest')]))
1819
endfunction
1920

0 commit comments

Comments
 (0)