From a1e1b424faee57f991024b48d2d2a9823f1a6934 Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Mon, 15 Jun 2026 12:48:06 -0700 Subject: [PATCH 1/3] add a fallback message for unsupported RWD configs --- Extension/src/Debugger/debugAdapterDescriptorFactory.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Extension/src/Debugger/debugAdapterDescriptorFactory.ts b/Extension/src/Debugger/debugAdapterDescriptorFactory.ts index c20c12719..0e1423def 100644 --- a/Extension/src/Debugger/debugAdapterDescriptorFactory.ts +++ b/Extension/src/Debugger/debugAdapterDescriptorFactory.ts @@ -38,6 +38,7 @@ export class CppdbgDebugAdapterDescriptorFactory extends AbstractDebugAdapterDes } // If the configuration is not supported, gracefully fall back to a regular debug session and log a message to the user. logReasonForNoDebugNotSupported(session.configuration); + logFallbackMessage(); properties.noDebugSkipped = true.toString(); } @@ -62,6 +63,7 @@ export class CppvsdbgDebugAdapterDescriptorFactory extends AbstractDebugAdapterD } // If the configuration is not supported, gracefully fall back to a regular debug session and log a message to the user. logReasonForNoDebugNotSupported(session.configuration); + logFallbackMessage(); properties.noDebugSkipped = true.toString(); } @@ -102,5 +104,10 @@ function logReasonForNoDebugNotSupported(configuration: vscode.DebugConfiguratio if (configuration.coreDumpPath) { outputChannel.appendLine(localize("debugger.noDebug.coreDumpPath.not.supported", "Run Without Debugging is not supported for configurations with 'coreDumpPath' set.")); } +} + +function logFallbackMessage(): void { + const outputChannel = getOutputChannel(); + outputChannel.appendLine(localize("debugger.fallback.message", "Falling back to a regular debug session.")); outputChannel.show(true); } From 70ec2b09e13e1a99d182f8f65c750f80163fac90 Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Wed, 17 Jun 2026 09:52:39 -0700 Subject: [PATCH 2/3] Add a property to ignore the warnings --- Extension/package.json | 8 ++++++ Extension/package.nls.json | 1 + .../Debugger/debugAdapterDescriptorFactory.ts | 26 +++++++++++-------- Extension/tools/OptionsSchema.json | 8 ++++++ 4 files changed, 32 insertions(+), 11 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index 82af023f3..9aa887917 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -4859,6 +4859,10 @@ ] }, "default": [] + }, + "ignoreRunWithoutDebuggingWarnings": { + "description": "%c_cpp.debuggers.ignoreRunWithoutDebuggingWarnings.description%", + "default": false } } }, @@ -5895,6 +5899,10 @@ } } } + }, + "ignoreRunWithoutDebuggingWarnings": { + "description": "%c_cpp.debuggers.ignoreRunWithoutDebuggingWarnings.description%", + "default": false } } }, diff --git a/Extension/package.nls.json b/Extension/package.nls.json index f108f9d7d..994a1745c 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -1026,6 +1026,7 @@ "c_cpp.debuggers.VSSymbolOptionsModuleFilter.excludedModules.description": "Array of modules that the debugger should NOT load symbols for. Wildcards (example: MyCompany.*.dll) are supported.\n\nThis property is ignored unless 'mode' is set to 'loadAllButExcluded'.", "c_cpp.debuggers.VSSymbolOptionsModuleFilter.includedModules.description": "Array of modules that the debugger should load symbols for. Wildcards (example: MyCompany.*.dll) are supported.\n\nThis property is ignored unless 'mode' is set to 'loadOnlyIncluded'.", "c_cpp.debuggers.VSSymbolOptionsModuleFilter.includeSymbolsNextToModules.description": "If true, for any module NOT in the 'includedModules' array, the debugger will still check next to the module itself and the launching executable, but it will not check paths on the symbol search list. This option defaults to 'true'.\n\nThis property is ignored unless 'mode' is set to 'loadOnlyIncluded'.", + "c_cpp.debuggers.ignoreRunWithoutDebuggingWarnings.description": "If true, no warning will be logged when run without debugging fails to launch the program in the terminal.", "c_cpp.semanticTokenTypes.referenceType.description": "Style for C++/CLI reference types.", "c_cpp.semanticTokenTypes.cliProperty.description": "Style for C++/CLI properties.", "c_cpp.semanticTokenTypes.genericType.description": "Style for C++/CLI generic types.", diff --git a/Extension/src/Debugger/debugAdapterDescriptorFactory.ts b/Extension/src/Debugger/debugAdapterDescriptorFactory.ts index 0e1423def..646251e94 100644 --- a/Extension/src/Debugger/debugAdapterDescriptorFactory.ts +++ b/Extension/src/Debugger/debugAdapterDescriptorFactory.ts @@ -38,7 +38,6 @@ export class CppdbgDebugAdapterDescriptorFactory extends AbstractDebugAdapterDes } // If the configuration is not supported, gracefully fall back to a regular debug session and log a message to the user. logReasonForNoDebugNotSupported(session.configuration); - logFallbackMessage(); properties.noDebugSkipped = true.toString(); } @@ -63,7 +62,6 @@ export class CppvsdbgDebugAdapterDescriptorFactory extends AbstractDebugAdapterD } // If the configuration is not supported, gracefully fall back to a regular debug session and log a message to the user. logReasonForNoDebugNotSupported(session.configuration); - logFallbackMessage(); properties.noDebugSkipped = true.toString(); } @@ -88,26 +86,32 @@ function noDebugSupported(configuration: vscode.DebugConfiguration): boolean { } function logReasonForNoDebugNotSupported(configuration: vscode.DebugConfiguration): void { + if (configuration.ignoreRunWithoutDebuggingWarnings === true) { + return; + } + + const disallowedProperties = []; const outputChannel = getOutputChannel(); + outputChannel.show(true); + if (configuration.request !== 'launch') { outputChannel.appendLine(localize("debugger.noDebug.requestType.not.supported", "Run Without Debugging is only supported for launch configurations.")); + return; } if (configuration.pipeTransport) { - outputChannel.appendLine(localize("debugger.noDebug.pipeTransport.not.supported", "Run Without Debugging is not supported for configurations with 'pipeTransport' set.")); + disallowedProperties.push('pipeTransport'); } if (configuration.debugServerPath) { - outputChannel.appendLine(localize("debugger.noDebug.debugServerPath.not.supported", "Run Without Debugging is not supported for configurations with 'debugServerPath' set.")); + disallowedProperties.push('debugServerPath'); } if (configuration.miDebuggerServerAddress) { - outputChannel.appendLine(localize("debugger.noDebug.miDebuggerServerAddress.not.supported", "Run Without Debugging is not supported for configurations with 'miDebuggerServerAddress' set.")); + disallowedProperties.push('miDebuggerServerAddress'); } if (configuration.coreDumpPath) { - outputChannel.appendLine(localize("debugger.noDebug.coreDumpPath.not.supported", "Run Without Debugging is not supported for configurations with 'coreDumpPath' set.")); + disallowedProperties.push('coreDumpPath'); } + outputChannel.appendLine(localize("debugger.unsupported.properties", "Launch configurations with the following properties cannot be run directly in the terminal: {0}", disallowedProperties.join(', '))); + outputChannel.appendLine(localize("debugger.fallback.message", "Program output will appear in the Debug Console instead.")); + outputChannel.appendLine(localize("debugger.fallback.message2", "To suppress this warning, set the 'ignoreRunWithoutDebuggingWarnings' property to true in your launch configuration.")); } -function logFallbackMessage(): void { - const outputChannel = getOutputChannel(); - outputChannel.appendLine(localize("debugger.fallback.message", "Falling back to a regular debug session.")); - outputChannel.show(true); -} diff --git a/Extension/tools/OptionsSchema.json b/Extension/tools/OptionsSchema.json index 96e5c8e27..76f3f81dc 100644 --- a/Extension/tools/OptionsSchema.json +++ b/Extension/tools/OptionsSchema.json @@ -847,6 +847,10 @@ }, "deploySteps": { "$ref": "#/definitions/DeploySteps" + }, + "ignoreRunWithoutDebuggingWarnings": { + "description": "%c_cpp.debuggers.ignoreRunWithoutDebuggingWarnings.description%", + "default": false } } }, @@ -1118,6 +1122,10 @@ "searchPaths": [], "searchMicrosoftSymbolServer": false } + }, + "ignoreRunWithoutDebuggingWarnings": { + "description": "%c_cpp.debuggers.ignoreRunWithoutDebuggingWarnings.description%", + "default": false } } }, From df142ee7275ea29e1e087120d48c6f04056885ae Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Wed, 17 Jun 2026 11:52:18 -0700 Subject: [PATCH 3/3] Address PR feedback --- Extension/package.json | 2 ++ Extension/src/Debugger/debugAdapterDescriptorFactory.ts | 2 +- Extension/tools/OptionsSchema.json | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Extension/package.json b/Extension/package.json index 9aa887917..958f0c6fc 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -4861,6 +4861,7 @@ "default": [] }, "ignoreRunWithoutDebuggingWarnings": { + "type": "boolean", "description": "%c_cpp.debuggers.ignoreRunWithoutDebuggingWarnings.description%", "default": false } @@ -5901,6 +5902,7 @@ } }, "ignoreRunWithoutDebuggingWarnings": { + "type": "boolean", "description": "%c_cpp.debuggers.ignoreRunWithoutDebuggingWarnings.description%", "default": false } diff --git a/Extension/src/Debugger/debugAdapterDescriptorFactory.ts b/Extension/src/Debugger/debugAdapterDescriptorFactory.ts index 646251e94..8777b0340 100644 --- a/Extension/src/Debugger/debugAdapterDescriptorFactory.ts +++ b/Extension/src/Debugger/debugAdapterDescriptorFactory.ts @@ -90,7 +90,7 @@ function logReasonForNoDebugNotSupported(configuration: vscode.DebugConfiguratio return; } - const disallowedProperties = []; + const disallowedProperties: string[] = []; const outputChannel = getOutputChannel(); outputChannel.show(true); diff --git a/Extension/tools/OptionsSchema.json b/Extension/tools/OptionsSchema.json index 76f3f81dc..db4d0aa59 100644 --- a/Extension/tools/OptionsSchema.json +++ b/Extension/tools/OptionsSchema.json @@ -849,6 +849,7 @@ "$ref": "#/definitions/DeploySteps" }, "ignoreRunWithoutDebuggingWarnings": { + "type": "boolean", "description": "%c_cpp.debuggers.ignoreRunWithoutDebuggingWarnings.description%", "default": false } @@ -1124,6 +1125,7 @@ } }, "ignoreRunWithoutDebuggingWarnings": { + "type": "boolean", "description": "%c_cpp.debuggers.ignoreRunWithoutDebuggingWarnings.description%", "default": false }