Skip to content

Commit 2749118

Browse files
granitrockygranitrocky
andauthored
Read pipeTransport from launch.json when debugging (#68)
Read the pipeTransport object from launch.json when launching the debugger Co-authored-by: granitrocky <[email protected]>
1 parent bbd1e40 commit 2749118

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

src/coreclrDebug/activate.ts

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -285,13 +285,20 @@ export class DebugAdapterExecutableFactory implements vscode.DebugAdapterDescrip
285285
// use the executable specified in the package.json if it exists or determine it based on some other information (e.g. the session)
286286
if (!executable) {
287287
const dotNetInfo = await getDotnetInfo(omnisharpOptions.dotNetCliPaths);
288-
289-
const command = path.join(
290-
common.getExtensionPath(),
291-
'.debugger',
292-
'netcoredbg',
293-
'netcoredbg' + CoreClrDebugUtil.getPlatformExeExtension()
294-
);
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+
}
295302

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

309-
executable = new vscode.DebugAdapterExecutable(command, ['--interpreter=vscode'], options);
316+
executable = new vscode.DebugAdapterExecutable(command, args, options);
310317
}
311318

312319
// make VS Code launch the DA executable

0 commit comments

Comments
 (0)