Skip to content

Commit

Permalink
Read pipeTransport from launch.json when debugging (#68)
Browse files Browse the repository at this point in the history
Read the pipeTransport object from launch.json when launching the debugger

Co-authored-by: granitrocky <[email protected]>
  • Loading branch information
granitrocky and granitrocky authored May 31, 2024
1 parent bbd1e40 commit 2749118
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions src/coreclrDebug/activate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,13 +285,20 @@ export class DebugAdapterExecutableFactory implements vscode.DebugAdapterDescrip
// use the executable specified in the package.json if it exists or determine it based on some other information (e.g. the session)
if (!executable) {
const dotNetInfo = await getDotnetInfo(omnisharpOptions.dotNetCliPaths);

const command = path.join(
common.getExtensionPath(),
'.debugger',
'netcoredbg',
'netcoredbg' + CoreClrDebugUtil.getPlatformExeExtension()
);
const pipeTransport = _session.configuration.pipeTransport;
let command = '';
let args = ['--interpreter=vscode'];
if (typeof pipeTransport === 'object') {
command = pipeTransport.debuggerPath;
args = pipeTransport.pipeArgs;
} else {
command = path.join(
common.getExtensionPath(),
'.debugger',
'netcoredbg',
'netcoredbg' + CoreClrDebugUtil.getPlatformExeExtension()
);
}

// Look to see if DOTNET_ROOT is set, then use dotnet cli path
const dotnetRoot: string =
Expand All @@ -306,7 +313,7 @@ export class DebugAdapterExecutableFactory implements vscode.DebugAdapterDescrip
};
}

executable = new vscode.DebugAdapterExecutable(command, ['--interpreter=vscode'], options);
executable = new vscode.DebugAdapterExecutable(command, args, options);
}

// make VS Code launch the DA executable
Expand Down

0 comments on commit 2749118

Please sign in to comment.