Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new "console" launch config for cppvsdbg #6794

Merged
merged 6 commits into from
Jan 16, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions Extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1984,10 +1984,22 @@
"description": "%c_cpp.debuggers.cppvsdbg.visualizerFile.description%",
"default": ""
},
"externalConsole": {
WardenGnaw marked this conversation as resolved.
Show resolved Hide resolved
"type": "boolean",
"description": "%c_cpp.debuggers.cppvsdbg.externalConsole.description%",
"default": false
"console": {
"type": "string",
"enum": [
"internalConsole",
"integratedTerminal",
"externalTerminal",
"newExternalWindow"
],
"enumDescriptions": [
"%c_cpp.debuggers.cppvsdbg.console.internalConsole.description%",
"%c_cpp.debuggers.cppvsdbg.console.integratedTerminal.description%",
"%c_cpp.debuggers.cppvsdbg.console.externalTerminal.description%",
"%c_cpp.debuggers.cppvsdbg.console.newExternalWindow.description%"
],
"description": "%c_cpp.debuggers.cppvsdbg.console.description%",
"default": "internalConsole"
sean-mcmanus marked this conversation as resolved.
Show resolved Hide resolved
},
"sourceFileMap": {
"type": "object",
Expand Down Expand Up @@ -2730,7 +2742,7 @@
},
{
"description": "Visual Studio Windows Debugger",
"url": "https://go.microsoft.com/fwlink/?linkid=2152353",
"url": "https://go.microsoft.com/fwlink/?linkid=2153010",
"platforms": [
"win32"
],
Expand All @@ -2741,7 +2753,7 @@
"binaries": [
"./debugAdapters/vsdbg/bin/vsdbg.exe"
],
"integrity": "8299A112D1260C2CEA53AC74D18FA73DE8533C058AAAB254571B503FBAC37297"
"integrity": "52C4234976D527A7BF02EB2E8844F3C605DC4BD1D3847F83C8675CD23967BAB3"
}
]
}
6 changes: 5 additions & 1 deletion Extension/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,11 @@
"c_cpp.debuggers.serverLaunchTimeout.description": "Optional time, in milliseconds, for the debugger to wait for the debugServer to start up. Default is 10000.",
"c_cpp.debuggers.coreDumpPath.description": "Optional full path to a core dump file for the specified program. Defaults to null.",
"c_cpp.debuggers.cppdbg.externalConsole.description": "If true, a console is launched for the debuggee. If false, on Linux and Windows, it will appear in the Integrated Console.",
"c_cpp.debuggers.cppvsdbg.externalConsole.description": "If true, a console is launched for the debuggee. If false, no console is launched.",
"c_cpp.debuggers.cppvsdbg.console.description": "Where to launch the debug target.",
"c_cpp.debuggers.cppvsdbg.console.internalConsole.description": "Output to the VS Code Debug Console. This doesn't support reading console input (ex:Console.ReadLine)",
WardenGnaw marked this conversation as resolved.
Show resolved Hide resolved
"c_cpp.debuggers.cppvsdbg.console.integratedTerminal.description": "VS Code's integrated terminal",
"c_cpp.debuggers.cppvsdbg.console.externalTerminal.description": "External terminal that can be configured via user settings",
WardenGnaw marked this conversation as resolved.
Show resolved Hide resolved
"c_cpp.debuggers.cppvsdbg.console.newExternalWindow.description": "Console applications will be launched in their own external console window which will end when the application stops. Non-console applications will run without a terminal, and stdout/stderr will be ignored.",
"c_cpp.debuggers.avoidWindowsConsoleRedirection.description": "If true, disables debuggee console redirection that is required for Integrated Terminal support.",
"c_cpp.debuggers.sourceFileMap.description": "Optional source file mappings passed to the debug engine. Example: '{ \"/original/source/path\":\"/current/source/path\" }'",
"c_cpp.debuggers.processId.anyOf.description": "Optional process id to attach the debugger to. Use \"${command:pickProcess}\" to get a list of local running processes to attach to. Note that some platforms require administrator privileges in order to attach to a process.",
Expand Down
7 changes: 6 additions & 1 deletion Extension/src/Debugger/configurationProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class CppConfigurationProvider implements vscode.DebugConfigurationProvider {

newConfig.name = compilerName + buildAndDebugActiveFileStr();
newConfig.preLaunchTask = task.name;
newConfig.externalConsole = false;
newConfig.console = "internalConsole";
const exeName: string = path.join("${fileDirname}", "${fileBasenameNoExtension}");
const isWindows: boolean = platform === 'win32';
newConfig.program = isWindows ? exeName + ".exe" : exeName;
Expand Down Expand Up @@ -246,6 +246,11 @@ class CppConfigurationProvider implements vscode.DebugConfigurationProvider {
}

if (config.type === 'cppvsdbg') {
// Handle legacy 'externalConsole' bool and convert to console: "externalTerminal"
if (config.externalConsole && !config.console) {
config.console = "externalTerminal";
}

// Fail if cppvsdbg type is running on non-Windows
if (os.platform() !== 'win32') {
logger.getOutputChannelLogger().showWarningMessage(localize("debugger.not.available", "Debugger of type: '{0}' is only available on Windows. Use type: '{1}' on the current OS platform.", "cppvsdbg", "cppdbg"));
Expand Down
2 changes: 1 addition & 1 deletion Extension/src/Debugger/configurations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function createLaunchString(name: string, type: string, executable: string): str
"stopAtEntry": false,
"cwd": "$\{workspaceFolder\}",
"environment": [],
"externalConsole": false
"console": "internalConsole"
`;
}

Expand Down
20 changes: 16 additions & 4 deletions Extension/tools/OptionsSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -541,10 +541,22 @@
"description": "%c_cpp.debuggers.cppvsdbg.visualizerFile.description%",
"default": ""
},
"externalConsole": {
"type": "boolean",
"description": "%c_cpp.debuggers.cppvsdbg.externalConsole.description%",
"default": false
"console": {
"type": "string",
"enum": [
"internalConsole",
"integratedTerminal",
"externalTerminal",
"newExternalWindow"
],
"enumDescriptions": [
"%c_cpp.debuggers.cppvsdbg.console.internalConsole.description%",
"%c_cpp.debuggers.cppvsdbg.console.integratedTerminal.description%",
"%c_cpp.debuggers.cppvsdbg.console.externalTerminal.description%",
"%c_cpp.debuggers.cppvsdbg.console.newExternalWindow.description%"
],
"description": "%c_cpp.debuggers.cppvsdbg.console.description%",
"default": "internalConsole"
},
"sourceFileMap": {
"type": "object",
Expand Down