in src/legacyEdge/extension.ts [38:76]
async resolveDebugConfiguration(folder: vscode.WorkspaceFolder | undefined, config: vscode.DebugConfiguration, token?: vscode.CancellationToken): Promise<vscode.DebugConfiguration> {
if (!isEdgeDebuggingSupported()) {
const errorMessage = localize('edge.debug.error.versionNotSupported', 'Your version of Microsoft Edge does not support debugging via the Edge DevTools Protocol. You can read more about supported versions here (https://aka.ms/edp-docs).');
return vscode.window.showErrorMessage(errorMessage).then(_ => {
return undefined;
});
}
// if launch.json is missing or empty
if (!config.type && !config.request && !config.name) {
// Return null so it will create a launch.json and fall back on provideDebugConfigurations - better to point the user towards the config
// than try to work automagically.
return null;
}
if (config.request === 'attach') {
const discovery = new Core.chromeTargetDiscoveryStrategy.ChromeTargetDiscovery(
new Core.NullLogger(), new Core.telemetry.NullTelemetryReporter());
let targets;
try {
targets = await discovery.getAllTargets(config.address || '127.0.0.1', config.port, targetFilter, config.url);
} catch (e) {
// Target not running?
}
if (targets && targets.length > 1) {
const selectedTarget = await pickTarget(targets);
if (!selectedTarget) {
// Quickpick canceled, bail
return null;
}
config.websocketUrl = selectedTarget.websocketDebuggerUrl;
}
}
return config;
}