Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
16 changes: 15 additions & 1 deletion Extension/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down
21 changes: 19 additions & 2 deletions Extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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%",
Expand Down Expand Up @@ -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"
],
Expand All @@ -2741,7 +2758,7 @@
"binaries": [
"./debugAdapters/vsdbg/bin/vsdbg.exe"
],
"integrity": "8299A112D1260C2CEA53AC74D18FA73DE8533C058AAAB254571B503FBAC37297"
"integrity": "52C4234976D527A7BF02EB2E8844F3C605DC4BD1D3847F83C8675CD23967BAB3"
}
]
}
7 changes: 6 additions & 1 deletion Extension/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
11 changes: 10 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 = "externalTerminal";
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,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"));
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": "externalTerminal"
`;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
8 changes: 7 additions & 1 deletion Extension/src/LanguageServer/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions Extension/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<boolean> {
if (!checkInstallLockFile()) {
return false;
Expand All @@ -540,7 +540,7 @@ export async function checkInstallBinariesExist(): Promise<boolean> {
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<boolean> {
let installJsonsExist: boolean = true;
const jsonFiles: string[] = [
Expand Down
17 changes: 17 additions & 0 deletions Extension/tools/OptionsSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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%",
Expand Down
5 changes: 4 additions & 1 deletion Extension/translations_auto_pr.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down