Skip to content

Commit 490a6a1

Browse files
granitrockygranitrocky
authored andcommitted
Add additional configuration options to pipeTransport.
1 parent 3ce4658 commit 490a6a1

File tree

1 file changed

+39
-18
lines changed

1 file changed

+39
-18
lines changed

src/coreclrDebug/activate.ts

Lines changed: 39 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -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,41 @@ 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+
}
318+
if (pipeTransport.pipeProgram) {
319+
args.push(pipeTransport.pipeProgram);
320+
}
321+
if (pipeTransport.pipeArgs) {
322+
args.push(pipeTransport.pipeArgs);
323+
}
324+
if (pipeTransport.pipeCwd) {
325+
options.cwd = pipeTransport.pipeCwd;
326+
}
327+
} else {
328+
command = path.join(
329+
common.getExtensionPath(),
330+
'.debugger',
331+
'netcoredbg',
332+
'netcoredbg' + CoreClrDebugUtil.getPlatformExeExtension()
333+
);
334+
args = ['--interpreter=vscode'];
335+
}
336+
316337
executable = new vscode.DebugAdapterExecutable(command, args, options);
317338
}
318339

0 commit comments

Comments
 (0)