diff --git a/Extension/package.json b/Extension/package.json index 709863e86..fef67dd39 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -4859,6 +4859,11 @@ ] }, "default": [] + }, + "ignoreRunWithoutDebuggingWarnings": { + "type": "boolean", + "description": "%c_cpp.debuggers.ignoreRunWithoutDebuggingWarnings.description%", + "default": false } } }, @@ -5895,6 +5900,11 @@ } } } + }, + "ignoreRunWithoutDebuggingWarnings": { + "type": "boolean", + "description": "%c_cpp.debuggers.ignoreRunWithoutDebuggingWarnings.description%", + "default": false } } }, diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 94685cde9..17df9bcdb 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -1031,6 +1031,12 @@ "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": { + "message": "If true, no warning will be logged when run without debugging fails to launch the program in the terminal.", + "comment": [ + "{Locked=\"true\"}" + ] + }, "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 c20c12719..8777b0340 100644 --- a/Extension/src/Debugger/debugAdapterDescriptorFactory.ts +++ b/Extension/src/Debugger/debugAdapterDescriptorFactory.ts @@ -86,21 +86,32 @@ function noDebugSupported(configuration: vscode.DebugConfiguration): boolean { } function logReasonForNoDebugNotSupported(configuration: vscode.DebugConfiguration): void { + if (configuration.ignoreRunWithoutDebuggingWarnings === true) { + return; + } + + const disallowedProperties: string[] = []; 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.show(true); + 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.")); } + diff --git a/Extension/tools/OptionsSchema.json b/Extension/tools/OptionsSchema.json index d359bb86e..fe506f147 100644 --- a/Extension/tools/OptionsSchema.json +++ b/Extension/tools/OptionsSchema.json @@ -846,6 +846,11 @@ }, "deploySteps": { "$ref": "#/definitions/DeploySteps" + }, + "ignoreRunWithoutDebuggingWarnings": { + "type": "boolean", + "description": "%c_cpp.debuggers.ignoreRunWithoutDebuggingWarnings.description%", + "default": false } } }, @@ -1116,6 +1121,11 @@ "searchPaths": [], "searchMicrosoftSymbolServer": false } + }, + "ignoreRunWithoutDebuggingWarnings": { + "type": "boolean", + "description": "%c_cpp.debuggers.ignoreRunWithoutDebuggingWarnings.description%", + "default": false } } },