Skip to content

Commit b3c9c14

Browse files
authored
Merge pull request #747 from Melandel/improve_vimspector_config_file_generated
Improve vimspector config file generation
2 parents b25f07c + 2b664e3 commit b3c9c14

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

autoload/OmniSharp/actions/project.vim

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,14 @@ function! OmniSharp#actions#project#DebugProject(stopAtEntry, ...) abort
3333
let project = getbufvar(a:bufnr, 'OmniSharp_host').project
3434
" Make sure we're not running on a csx script
3535
if project.ScriptProject is v:null
36+
let programPath = project.MsBuildProject.TargetPath
37+
if has('win32') | let programPath = substitute(programPath, '\', '/', 'g') | endif
3638
call vimspector#LaunchWithConfigurations({
3739
\ 'launch': {
3840
\ 'adapter': 'netcoredbg',
3941
\ 'configuration': {
40-
\ 'request': 'launch',
41-
\ 'program': project.MsBuildProject.TargetPath,
42+
\ 'request': 'launch',
43+
\ 'program': programPath,
4244
\ 'args': a:args,
4345
\ 'stopAtEntry': a:stopAtEntry ? v:true : v:false
4446
\ }
@@ -57,6 +59,8 @@ function! OmniSharp#actions#project#CreateDebugConfig(stopAtEntry, ...) abort
5759
let bufnr = bufnr('%')
5860
function! CreateDebugConfigCb(bufnr, stopAtEntry, args) abort
5961
let host = getbufvar(a:bufnr, 'OmniSharp_host')
62+
let programPath = host.project.MsBuildProject.TargetPath
63+
if has('win32') | let programPath = substitute(programPath, '\', '/', 'g') | endif
6064
let contents = [
6165
\' {',
6266
\' "configurations": {',
@@ -71,7 +75,7 @@ function! OmniSharp#actions#project#CreateDebugConfig(stopAtEntry, ...) abort
7175
\' "adapter": "netcoredbg",',
7276
\' "configuration": {',
7377
\' "request": "launch",',
74-
\' "program": "'.host.project.MsBuildProject.TargetPath.'",',
78+
\' "program": "'.programPath.'",',
7579
\' "args": ' . json_encode(a:args) . ',',
7680
\' "stopAtEntry": ' . (a:stopAtEntry ? 'true' : 'false'),
7781
\' }',

0 commit comments

Comments
 (0)