Skip to content

Commit 2ec525e

Browse files
authored
Use 'resolveDebugConfigWithSubVariables' (#6328)
This PR uses the DebugConfigurationProvider.resolveDebugConfigurationWithSubstitutedVariables which allows the debug configuration to wait for the preLaunchTask to complete before continuing on and resolving variables that may have been set in the 'tasks.json'. This also resolves the logging issue where the 'Build and Debug Active File' preLaunchTask uses the current file but we switch to the output window for logging.
1 parent b124e44 commit 2ec525e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Extension/src/Debugger/configurationProvider.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ export class QuickPickConfigurationProvider implements vscode.DebugConfiguration
8888
return [selection.configuration];
8989
}
9090

91-
resolveDebugConfiguration(folder: vscode.WorkspaceFolder | undefined, config: vscode.DebugConfiguration, token?: vscode.CancellationToken): vscode.ProviderResult<vscode.DebugConfiguration> {
92-
return this.underlyingProvider.resolveDebugConfiguration ? this.underlyingProvider.resolveDebugConfiguration(folder, config, token) : undefined;
91+
resolveDebugConfigurationWithSubstitutedVariables(folder: vscode.WorkspaceFolder | undefined, config: vscode.DebugConfiguration, token?: vscode.CancellationToken): vscode.ProviderResult<vscode.DebugConfiguration> {
92+
return this.underlyingProvider.resolveDebugConfigurationWithSubstitutedVariables ? this.underlyingProvider.resolveDebugConfigurationWithSubstitutedVariables(folder, config, token) : undefined;
9393
}
9494
}
9595

@@ -188,7 +188,7 @@ class CppConfigurationProvider implements vscode.DebugConfigurationProvider {
188188
/**
189189
* Try to add all missing attributes to the debug configuration being launched.
190190
*/
191-
resolveDebugConfiguration(folder: vscode.WorkspaceFolder | undefined, config: vscode.DebugConfiguration, token?: vscode.CancellationToken): vscode.ProviderResult<vscode.DebugConfiguration> {
191+
resolveDebugConfigurationWithSubstitutedVariables(folder: vscode.WorkspaceFolder | undefined, config: vscode.DebugConfiguration, token?: vscode.CancellationToken): vscode.ProviderResult<vscode.DebugConfiguration> {
192192
// [Microsoft/vscode#54213] If config or type is not specified, return null to trigger VS Code to open a configuration file.
193193
if (!config || !config.type) {
194194
return null;
@@ -274,8 +274,7 @@ class CppConfigurationProvider implements vscode.DebugConfigurationProvider {
274274
const outputChannel: logger.Logger = logger.getOutputChannelLogger();
275275
outputChannel.appendLine(localize("debugger.launchConfig", "Launch configuration:"));
276276
outputChannel.appendLine(JSON.stringify(config, undefined, 2));
277-
// TODO: Enable when https://github.com/microsoft/vscode/issues/108619 is resolved.
278-
// logger.showOutputChannel();
277+
logger.showOutputChannel();
279278
}
280279

281280
return config;

0 commit comments

Comments
 (0)