@@ -283,28 +283,14 @@ export class DebugAdapterExecutableFactory implements vscode.DebugAdapterDescrip
283283 // debugger has finished installation, kick off our debugger process
284284
285285 // use the executable specified in the package.json if it exists or determine it based on some other information (e.g. the session)
286- if ( ! executable ) {
287- const dotNetInfo = await getDotnetInfo ( omnisharpOptions . dotNetCliPaths ) ;
288- const pipeTransport = _session . configuration . pipeTransport ;
289- let command = '' ;
290- let args = [ '--interpreter=vscode' ] ;
291- if ( typeof pipeTransport === 'object' ) {
292- command = pipeTransport . debuggerPath ;
293- args = pipeTransport . pipeArgs ;
294- } else {
295- command = path . join (
296- common . getExtensionPath ( ) ,
297- '.debugger' ,
298- 'netcoredbg' ,
299- 'netcoredbg' + CoreClrDebugUtil . getPlatformExeExtension ( )
300- ) ;
301- }
302-
286+ const pipeTransport = _session . configuration . pipeTransport ;
287+ if ( ! executable || typeof pipeTransport === 'object' ) {
303288 // Look to see if DOTNET_ROOT is set, then use dotnet cli path
289+ const dotNetInfo = await getDotnetInfo ( omnisharpOptions . dotNetCliPaths ) ;
304290 const dotnetRoot : string =
305291 process . env . DOTNET_ROOT ?? ( dotNetInfo . CliPath ? path . dirname ( dotNetInfo . CliPath ) : '' ) ;
306292
307- let options : vscode . DebugAdapterExecutableOptions | undefined = undefined ;
293+ let options : vscode . DebugAdapterExecutableOptions = { } ;
308294 if ( dotnetRoot ) {
309295 options = {
310296 env : {
@@ -313,6 +299,43 @@ export class DebugAdapterExecutableFactory implements vscode.DebugAdapterDescrip
313299 } ;
314300 }
315301
302+ let command = '' ;
303+ let args = [ ] ;
304+ if ( typeof pipeTransport === 'object' ) {
305+ if ( pipeTransport . debuggerPath ) {
306+ command = pipeTransport . debuggerPath ;
307+ } else {
308+ command = path . join (
309+ common . getExtensionPath ( ) ,
310+ '.debugger' ,
311+ 'netcoredbg' ,
312+ 'netcoredbg' + CoreClrDebugUtil . getPlatformExeExtension ( )
313+ ) ;
314+ }
315+ if ( pipeTransport . debuggerArgs ) {
316+ args = pipeTransport . debuggerArgs ;
317+ } else {
318+ args . push ( '--interpreter=vscode' , '--' ) ;
319+ }
320+ if ( pipeTransport . pipeProgram ) {
321+ args . push ( pipeTransport . pipeProgram ) ;
322+ }
323+ if ( pipeTransport . pipeArgs ) {
324+ args . push ( pipeTransport . pipeArgs ) ;
325+ }
326+ if ( pipeTransport . pipeCwd ) {
327+ options . cwd = pipeTransport . pipeCwd ;
328+ }
329+ } else {
330+ command = path . join (
331+ common . getExtensionPath ( ) ,
332+ '.debugger' ,
333+ 'netcoredbg' ,
334+ 'netcoredbg' + CoreClrDebugUtil . getPlatformExeExtension ( )
335+ ) ;
336+ args = [ '--interpreter=vscode' ] ;
337+ }
338+
316339 executable = new vscode . DebugAdapterExecutable ( command , args , options ) ;
317340 }
318341
0 commit comments