diff --git a/Extension/CHANGELOG.md b/Extension/CHANGELOG.md index 59e38aed47..44e84cdb26 100644 --- a/Extension/CHANGELOG.md +++ b/Extension/CHANGELOG.md @@ -1,5 +1,19 @@ # C/C++ for Visual Studio Code Change Log + +## Version 1.2.0-insiders2: January 20, 2021 +### Enhancement +* Add new "console" launch config for cppvsdbg. [PR #6794](https://github.com/microsoft/vscode-cpptools/pull/6794) + +### Bug Fixes +* Fix autocomplete not working with `for` loop variables with C code. [#2946](https://github.com/microsoft/vscode-cpptools/issues/2946) +* Fix an entry not found error for files in `compile_commands.json` that didn't initially exist. [#6311](https://github.com/microsoft/vscode-cpptools/issues/6311) +* Fix IntelliSense errors with C++20 std::ranges in gcc/clang modes. [#6342](https://github.com/microsoft/vscode-cpptools/issues/6342) +* Fix `compile_commands.json` not working correctly for `*.C` files. [#6497](https://github.com/microsoft/vscode-cpptools/issues/6497) +* Fix IntelliSense errors when "module" is used as a variable name with C++20. [#6719](https://github.com/microsoft/vscode-cpptools/issues/6719) +* Fix a runtime failure on macOS 10.13 or older. [#6787](https://github.com/microsoft/vscode-cpptools/issues/6787) +* Fix `Go to Symbol in Workspace`. [#6793](https://github.com/microsoft/vscode-cpptools/issues/6793) + ## Version 1.2.0-insiders: January 14, 2021 ### New Features * Add support for cross-compilation configurations for IntelliSense. For example, `intelliSenseMode` value "linux-gcc-x64" could be used on a Mac host machine. [#1083](https://github.com/microsoft/vscode-cpptools/issues/1083) @@ -21,6 +35,7 @@ * Fix IntelliSense not switching the language mode after changing C versus C++ `files.associations`. [#2557](https://github.com/microsoft/vscode-cpptools/issues/2557) * Fix Switch Header/Source not switching to an existing file in another column if it's not visible. [#2667](https://github.com/microsoft/vscode-cpptools/issues/2667), [#6749](https://github.com/microsoft/vscode-cpptools/issues/6749) * Fix `#include` completion not sorting _ last. [#3465](https://github.com/microsoft/vscode-cpptools/issues/3465) +* Fix completion not working for templates in gcc/clang mode. [#3501](https://github.com/microsoft/vscode-cpptools/issues/3501) * Fix crash when certain JavaScript files are parsed as C++. [#3858](https://github.com/microsoft/vscode-cpptools/issues/3858) * Fix IntelliSense squiggle about not being able to assign to an object of its own type. [#3883](https://github.com/microsoft/vscode-cpptools/issues/3883) * Fix hover and Find All References for template function overloads. [#4044](https://github.com/microsoft/vscode-cpptools/issues/4044), [#4249](https://github.com/microsoft/vscode-cpptools/issues/4249) @@ -46,7 +61,6 @@ * Fix gcc problem matcher when the column is missing. * @guntern [PR #6490](https://github.com/microsoft/vscode-cpptools/pull/6490) * Disable Insiders prompt for Codespaces. [#6491](https://github.com/microsoft/vscode-cpptools/issues/6491) -* Fix `compile_commands.json` not working correctly for `*.C` files. [#6497](https://github.com/microsoft/vscode-cpptools/issues/6497) * Show an error message when gdb can't be found when generating a `launch.json` (instead of using an invalid `miDebuggerPath`). [#6511](https://github.com/microsoft/vscode-cpptools/issues/6511) * Fix IntelliSense crash with a parenthesized type followed by an initializer list. [#6554](https://github.com/microsoft/vscode-cpptools/issues/6554), [#6624](https://github.com/microsoft/vscode-cpptools/issues/6624) * Fix IntelliSense updating after pasting multi-line code. [#6565](https://github.com/microsoft/vscode-cpptools/issues/6565) diff --git a/Extension/package.json b/Extension/package.json index 8e67ba22a1..2113acea6c 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -1989,6 +1989,23 @@ "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": "externalTerminal" + }, "sourceFileMap": { "type": "object", "description": "%c_cpp.debuggers.sourceFileMap.description%", @@ -2730,7 +2747,7 @@ }, { "description": "Visual Studio Windows Debugger", - "url": "https://go.microsoft.com/fwlink/?linkid=2152353", + "url": "https://go.microsoft.com/fwlink/?linkid=2153010", "platforms": [ "win32" ], @@ -2741,7 +2758,7 @@ "binaries": [ "./debugAdapters/vsdbg/bin/vsdbg.exe" ], - "integrity": "8299A112D1260C2CEA53AC74D18FA73DE8533C058AAAB254571B503FBAC37297" + "integrity": "52C4234976D527A7BF02EB2E8844F3C605DC4BD1D3847F83C8675CD23967BAB3" } ] } diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 6e155b04d3..22479404bd 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -213,7 +213,12 @@ "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.externalConsole.description": "[Deprecated by 'console'] 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. Defaults to 'internalConsole' if not defined.", + "c_cpp.debuggers.cppvsdbg.console.internalConsole.description": "Output to the VS Code Debug Console. This doesn't support reading console input (ex:'std::cin' or 'scanf')", + "c_cpp.debuggers.cppvsdbg.console.integratedTerminal.description": "VS Code's integrated terminal", + "c_cpp.debuggers.cppvsdbg.console.externalTerminal.description": "Console applications will be launched in an external terminal window. The window will be reused in relaunch scenarios, and will not automatically disappear when the application exits.", + "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.", diff --git a/Extension/src/Debugger/configurationProvider.ts b/Extension/src/Debugger/configurationProvider.ts index 0c0eef308a..ab532ef057 100644 --- a/Extension/src/Debugger/configurationProvider.ts +++ b/Extension/src/Debugger/configurationProvider.ts @@ -182,7 +182,7 @@ class CppConfigurationProvider implements vscode.DebugConfigurationProvider { newConfig.name = compilerName + buildAndDebugActiveFileStr(); newConfig.preLaunchTask = task.name; - newConfig.externalConsole = false; + newConfig.console = "externalTerminal"; const exeName: string = path.join("${fileDirname}", "${fileBasenameNoExtension}"); const isWindows: boolean = platform === 'win32'; newConfig.program = isWindows ? exeName + ".exe" : exeName; @@ -246,6 +246,15 @@ class CppConfigurationProvider implements vscode.DebugConfigurationProvider { } if (config.type === 'cppvsdbg') { + // Handle legacy 'externalConsole' bool and convert to console: "externalTerminal" + if (config.hasOwnProperty("externalConsole")) { + logger.getOutputChannelLogger().showWarningMessage(localize("debugger.deprecated.config", "The key '{0}' is deprecated. Please use '{1}' instead.", "externalConsole", "console")); + if (config.externalConsole && !config.console) { + config.console = "externalTerminal"; + } + delete config.externalConsole; + } + // 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")); diff --git a/Extension/src/Debugger/configurations.ts b/Extension/src/Debugger/configurations.ts index 5ed3a0c17a..4a4908ff7d 100644 --- a/Extension/src/Debugger/configurations.ts +++ b/Extension/src/Debugger/configurations.ts @@ -44,7 +44,7 @@ function createLaunchString(name: string, type: string, executable: string): str "stopAtEntry": false, "cwd": "$\{workspaceFolder\}", "environment": [], -"externalConsole": false +"console": "externalTerminal" `; } diff --git a/Extension/src/LanguageServer/Providers/workspaceSymbolProvider.ts b/Extension/src/LanguageServer/Providers/workspaceSymbolProvider.ts index 44c97981a0..31fa30680a 100644 --- a/Extension/src/LanguageServer/Providers/workspaceSymbolProvider.ts +++ b/Extension/src/LanguageServer/Providers/workspaceSymbolProvider.ts @@ -28,11 +28,13 @@ export class WorkspaceSymbolProvider implements vscode.WorkspaceSymbolProvider { if (suffix.length) { name = name + ' (' + suffix + ')'; } + const range: vscode.Range = new vscode.Range(symbol.location.range.start.line, symbol.location.range.start.character, symbol.location.range.end.line, symbol.location.range.end.character); + const uri: vscode.Uri = vscode.Uri.parse(symbol.location.uri.toString()); const vscodeSymbol: vscode.SymbolInformation = new vscode.SymbolInformation( name, symbol.kind, symbol.containerName, - symbol.location + new vscode.Location(uri, range) ); resultSymbols.push(vscodeSymbol); }); diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index f5e9d9f9cf..0162eeaeed 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -302,10 +302,16 @@ export interface LocalizeDocumentSymbol { children: LocalizeDocumentSymbol[]; } +/** Differs from vscode.Location, which has a uri of type vscode.Uri. */ +interface Location { + uri: string; + range: Range; +} + interface LocalizeSymbolInformation { name: string; kind: vscode.SymbolKind; - location: vscode.Location; + location: Location; containerName: string; suffix: LocalizeStringParams; } diff --git a/Extension/src/common.ts b/Extension/src/common.ts index 425357ea6e..9d04bfeffb 100644 --- a/Extension/src/common.ts +++ b/Extension/src/common.ts @@ -516,7 +516,7 @@ export function getInstalledBinaryPlatform(): string | undefined { return installedPlatform; } -/* Check if the core binaries exists in extension's installation folder */ +/** Check if the core binaries exists in extension's installation folder */ export async function checkInstallBinariesExist(): Promise { if (!checkInstallLockFile()) { return false; @@ -540,7 +540,7 @@ export async function checkInstallBinariesExist(): Promise { return installBinariesExist; } -/* Check if the core Json files exists in extension's installation folder */ +/** Check if the core Json files exists in extension's installation folder */ export async function checkInstallJsonsExist(): Promise { let installJsonsExist: boolean = true; const jsonFiles: string[] = [ diff --git a/Extension/tools/OptionsSchema.json b/Extension/tools/OptionsSchema.json index 1cee13b3ef..8b4290e74f 100644 --- a/Extension/tools/OptionsSchema.json +++ b/Extension/tools/OptionsSchema.json @@ -546,6 +546,23 @@ "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", "description": "%c_cpp.debuggers.sourceFileMap.description%", diff --git a/Extension/translations_auto_pr.js b/Extension/translations_auto_pr.js index 5a3903f56e..3dc53ca466 100644 --- a/Extension/translations_auto_pr.js +++ b/Extension/translations_auto_pr.js @@ -150,7 +150,10 @@ octokit.pulls.list({ owner: repoOwner, repo: repoName }).then(({data}) => { console.log(`Restoring default git permissions`); cp.execSync('git remote remove origin'); cp.execSync(`git remote add origin https://github.com/${repoOwner}/${repoName}.git`); - + + console.log(`Run 'git fetch' against updated remote`); + cp.execSync('git fetch'); + console.log(`Switching back to main (git checkout main)`); cp.execSync('git checkout main');