@@ -33,18 +33,14 @@ function! OmniSharp#actions#project#DebugProject(stopAtEntry, ...) abort
33
33
let project = getbufvar (a: bufnr , ' OmniSharp_host' ).project
34
34
" Make sure we're not running on a csx script
35
35
if project.ScriptProject is v: null
36
- let targetProgramFilename = fnamemodify (project.MsBuildProject.TargetPath, ' :t' )
37
- let folderWithAppConfigFiles = fnamemodify (project.MsBuildProject.TargetPath, ' :h:p' )
38
- if has (' win32' )
39
- let folderWithAppConfigFiles = substitute (folderWithAppConfigFiles, ' \' , ' /' , ' g' )
40
- endif
36
+ let programPath = project.MsBuildProject.TargetPath
37
+ if has (' win32' ) | let programPath = substitute (programPath, ' \' , ' /' , ' g' ) | endif
41
38
call vimspector#LaunchWithConfigurations ({
42
39
\ ' launch' : {
43
40
\ ' adapter' : ' netcoredbg' ,
44
41
\ ' configuration' : {
45
42
\ ' request' : ' launch' ,
46
- \ ' cwd' : folderWithAppConfigFiles,
47
- \ ' program' : targetProgramFilename,
43
+ \ ' program' : programPath,
48
44
\ ' args' : a: args ,
49
45
\ ' stopAtEntry' : a: stopAtEntry ? v: true : v: false
50
46
\ }
@@ -63,11 +59,8 @@ function! OmniSharp#actions#project#CreateDebugConfig(stopAtEntry, ...) abort
63
59
let bufnr = bufnr (' %' )
64
60
function ! CreateDebugConfigCb (bufnr , stopAtEntry, args ) abort
65
61
let host = getbufvar (a: bufnr , ' OmniSharp_host' )
66
- let targetProgramFilename = fnamemodify (host.project.MsBuildProject.TargetPath, ' :t' )
67
- let folderWithAppConfigFiles = fnamemodify (host.project.MsBuildProject.TargetPath, ' :h:p' )
68
- if has (' win32' )
69
- let folderWithAppConfigFiles = substitute (folderWithAppConfigFiles, ' \' , ' /' , ' g' )
70
- endif
62
+ let programPath = host.project.MsBuildProject.TargetPath
63
+ if has (' win32' ) | let programPath = substitute (programPath, ' \' , ' /' , ' g' ) | endif
71
64
let contents = [
72
65
\' {',
73
66
\' " configurations" : {',
@@ -82,8 +75,7 @@ function! OmniSharp#actions#project#CreateDebugConfig(stopAtEntry, ...) abort
82
75
\' " adapter" : " netcoredbg" ,',
83
76
\' " configuration" : {',
84
77
\' " request" : " launch" ,',
85
- \' " cwd" : " ' . folderWithAppConfigFiles . '" ,',
86
- \' " program" : " ' . targetProgramFilename . '" ,',
78
+ \' " program" : " '.programPath.'" ,',
87
79
\' " args" : ' . json_encode(a:args) . ' ,',
88
80
\' " stopAtEntry" : ' . (a:stopAtEntry ? ' true' : ' false'),
89
81
\' }',
0 commit comments