src/vs/workbench/contrib/debug/browser/debugService.ts/DebugService/substituteVariables
class DebugService:	private async substituteVariables(launch: ILaunch | undefined, config: IConfig): Promise<IConfig | undefined> {
		const dbg = this.adapterManager.getDebugger(config.type);
		if (dbg) {
			let folder: IWorkspaceFolder | undefined = undefined;
			if (launch && launch.workspace) {
				folder = launch.workspace;
			} else {
				const folders = this.contextService.getWorkspace().folders;
				if (folders.length === 1) {
					folder = folders[0];
				}
			}
			try {
				return await dbg.substituteVariables(folder, config);
			} catch (err) {
				this.showError(err.message, undefined, !!launch?.getConfiguration(config.name));
				return undefined;	// bail out
			}
		}
		return Promise.resolve(config);
	}