Compare commits

..
9 changed files with 33 additions and 115 deletions
-30
View File
@@ -1,35 +1,5 @@
# C/C++ for Visual Studio Code Changelog
## Version 1.17.0: July 26, 2023
### Enhancements
* Enable a subset of markdown to render in hover by default and a `C_Cpp.markdownInComments` setting. [#6020](https://github.com/microsoft/vscode-cpptools/issues/6020), [#10461](https://github.com/microsoft/vscode-cpptools/issues/10461)
* Add default compiler detection of additional compilers in MSYS environments. [#11211](https://github.com/microsoft/vscode-cpptools/issues/11211)
* Add support for additional compiler wrappers: gomacc, distcc, buildcache, and icecc.
### Bug Fixes
* Fix a couple bugs with documentation comments. [#5241](https://github.com/microsoft/vscode-cpptools/issues/5241)
* Added `__float128` support in gcc IntelliSense mode. [#9558](https://github.com/microsoft/vscode-cpptools/issues/9558)
* Address various issues with support for gcc 13. [#11038](https://github.com/microsoft/vscode-cpptools/issues/11038)
* Fix `#include` completion leaving an extra `>`. [#11042](https://github.com/microsoft/vscode-cpptools/issues/11042)
* Fix an issue with matching of glob patterns containing path delimiters. [#11132](https://github.com/microsoft/vscode-cpptools/issues/11132)
* Fix Create Declaration/Definition via `Quick Fix…` from hover tooltip. [#11157](https://github.com/microsoft/vscode-cpptools/issues/11157)
* Fix issues with compiler querying of clang-cl. [#11207](https://github.com/microsoft/vscode-cpptools/issues/11207)
* Fix `files.encoding` setting on startup. [#11210](https://github.com/microsoft/vscode-cpptools/issues/11210)
* Fix a crash related to directories with a very large number of files. [#11226](https://github.com/microsoft/vscode-cpptools/issues/11226)
* Fix Rank > 1 Display Strings for Natvis. [PR MIEngine#1406](https://github.com/microsoft/MIEngine/pull/1406)
* Fix some crashes identified by crash telemetry.
* Fix an issue that could cause zombie processes on Linux/Mac.
* Address some issues with glibc version compatibility. Native binaries for cpptools and the bundled clang-tidy/clang-format are now built with musl and fully statically linked.
* Fix the wrong compiler being set as default when configured to use `compile_commands.json` and overriding the compiler used there with an explicit `compilerPath`.
### Thank You to the Contributors
* [@gareth-rees (Gareth Rees)](https://github.com/gareth-rees): Always use `--simple-values` in newer versions of GDB. [PR MIEngine#1400](https://github.com/microsoft/MIEngine/pull/1400)
* [@iAbadia (Iñaki)](https://github.com/iAbadia): Align use of 'sendInvalidate' request arguments. [PR MIEngine#1402](https://github.com/microsoft/MIEngine/pull/1402)
* [@intel-rganesh (Rakesh Ganesh)](https://github.com/intel-rganesh): Introduce `--thread` and `--frame options`. [PR MIEngine#1401](https://github.com/microsoft/MIEngine/pull/1401)
* [@michalmaka (Michał Mąka)](https://github.com/michalmaka): Add support for Toybox to the remote process picker. [PR #11175](https://github.com/microsoft/vscode-cpptools/pull/11175)
* [@sbobko (Sergey Bobko)](https://github.com/sbobko): Add 'sendInvalidate' request. [PR MIEngine#1367](https://github.com/microsoft/MIEngine/pull/1367)
* [@yne (Rémy F.)](https://github.com/yne): Add wildcard support for `includePath`. [PR #10388](https://github.com/microsoft/vscode-cpptools/pull/10388)
## Version 1.16.3: June 23, 2023
### Bug Fix
* Fix "cout is ambiguous" error. [#11122](https://github.com/microsoft/vscode-cpptools/issues/11122)
-32
View File
@@ -2366,38 +2366,6 @@ ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
---------------------------------------------------------
---------------------------------------------------------
ssh-config 4.2.1 - MIT
https://github.com/cyjake/ssh-config#readme
Copyright (c) 2017 Chen Yangjian
MIT License
Copyright (c) 2017 Chen Yangjian
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
---------------------------------------------------------
---------------------------------------------------------
+1 -1
View File
@@ -2,7 +2,7 @@
"name": "cpptools",
"displayName": "C/C++",
"description": "C/C++ IntelliSense, debugging, and code browsing.",
"version": "1.17.0-main",
"version": "1.16.3-main",
"publisher": "ms-vscode",
"icon": "LanguageCCPP_color_128x.png",
"readme": "README.md",
+2 -3
View File
@@ -132,9 +132,8 @@ export class RemoteAttachPicker {
shPrefix = `/bin/`;
}
return `${outerQuote}${shPrefix}sh -c ${innerQuote}uname && if [ ${parameterBegin}uname -o${parameterEnd} = ${escapedQuote}Toybox${escapedQuote} ] ; ` +
`then ${PsProcessParser.psToyboxCommand} ; elif [ ${parameterBegin}uname${parameterEnd} = ${escapedQuote}Darwin${escapedQuote} ] ; ` +
`then ${PsProcessParser.psLinuxCommand} ; elif [ ${parameterBegin}uname${parameterEnd} = ${escapedQuote}Linux${escapedQuote} ] ; ` +
return `${outerQuote}${shPrefix}sh -c ${innerQuote}uname && if [ ${parameterBegin}uname${parameterEnd} = ${escapedQuote}Linux${escapedQuote} ] ; ` +
`then ${PsProcessParser.psLinuxCommand} ; elif [ ${parameterBegin}uname${parameterEnd} = ${escapedQuote}Darwin${escapedQuote} ] ; ` +
`then ${PsProcessParser.psDarwinCommand}; fi${innerQuote}${outerQuote}`;
}
-1
View File
@@ -119,7 +119,6 @@ export class PsProcessParser {
// Since 'args' contains the full path to the executable, even if truncated, searching will work as desired.
public static get psLinuxCommand(): string { return `ps axww -o pid=,comm=${PsProcessParser.commColumnTitle},args=`; }
public static get psDarwinCommand(): string { return `ps axww -o pid=,comm=${PsProcessParser.commColumnTitle},args= -c`; }
public static get psToyboxCommand(): string { return `ps -A -o pid=,comm=${PsProcessParser.commColumnTitle},args=`; }
// Only public for tests.
public static ParseProcessFromPs(processes: string): Process[] {
@@ -8,7 +8,7 @@ import { DefaultClient } from '../client';
import {
CodeActionCodeInfo, CodeActionDiagnosticInfo, codeAnalysisAllFixes, codeAnalysisCodeToFixes, codeAnalysisFileToCodeActions
} from '../codeAnalysis';
import { LocalizeStringParams, getLocalizedString } from '../localization';
import { getLocalizedString, LocalizeStringParams } from '../localization';
import { CppSettings } from '../settings';
import { makeVscodeRange } from '../utils';
@@ -23,18 +23,12 @@ interface CodeActionCommand {
arguments?: any[];
edit?: TextEdit;
uri?: string;
range?: Range;
}
interface GetCodeActionsResult {
commands: CodeActionCommand[];
}
export interface CreateDeclDefnCommandArguments {
sender: string;
range: Range;
}
export const GetCodeActionsRequest: RequestType<GetCodeActionsRequestParams, GetCodeActionsResult, void> =
new RequestType<GetCodeActionsRequestParams, GetCodeActionsResult, void>('cpptools/getCodeActions');
@@ -186,14 +180,8 @@ export class CodeActionProvider implements vscode.CodeActionProvider {
resultCodeActions.push(...disableCodeActions);
resultCodeActions.push(...docCodeActions);
return;
} else if ((command.command === 'C_Cpp.CreateDeclarationOrDefinition' || command.command === 'C_Cpp.CopyDeclarationOrDefinition')
&& (command.arguments ?? []).length === 0 && command.range !== undefined) {
const args: CreateDeclDefnCommandArguments = {
sender: 'codeAction',
range: command.range
};
command.arguments = [];
command.arguments.push(args);
} else if (command.command === 'C_Cpp.CreateDeclarationOrDefinition' && (command.arguments ?? []).length === 0) {
command.arguments = ['codeAction']; // We report the sender of the command
} else if (command.command === "C_Cpp.SelectIntelliSenseConfiguration") {
command.arguments = ['codeAction'];
hasSelectIntelliSenseConfiguration = true;
+12 -19
View File
@@ -795,7 +795,7 @@ export interface Client {
handleRemoveCodeAnalysisProblems(refreshSquigglesOnSave: boolean, identifiersAndUris: CodeAnalysisDiagnosticIdentifiersAndUri[]): Promise<void>;
handleFixCodeAnalysisProblems(workspaceEdit: vscode.WorkspaceEdit, refreshSquigglesOnSave: boolean, identifiersAndUris: CodeAnalysisDiagnosticIdentifiersAndUri[]): Promise<void>;
handleDisableAllTypeCodeAnalysisProblems(code: string, identifiersAndUris: CodeAnalysisDiagnosticIdentifiersAndUri[]): Promise<void>;
handleCreateDeclarationOrDefinition(isCopyToClipboard: boolean, codeActionRange?: Range): Promise<void>;
handleCreateDeclarationOrDefinition(copy?: boolean): Promise<void>;
onInterval(): void;
dispose(): void;
addFileAssociations(fileAssociations: string, languageId: string): void;
@@ -1856,11 +1856,9 @@ export class DefaultClient implements Client {
if (!currentProvider.isReady) {
return;
}
await Promise.all([
this.clearCustomConfigurations(),
this.handleRemoveAllCodeAnalysisProblems()]);
await Promise.all([
this.handleRemoveAllCodeAnalysisProblems(),
...[...this.trackedDocuments].map(document => this.provideCustomConfiguration(document.uri, undefined, true))
]);
}
@@ -1926,7 +1924,7 @@ export class DefaultClient implements Client {
hasCompleted = true;
this.sendCustomBrowseConfiguration(null, undefined, Version.v0, true);
if (currentProvider.version >= Version.v2) {
console.warn(`Configuration Provider timed out in ${configProviderTimeout}ms.`);
console.warn("Configuration Provider timed out in {0}ms.", configProviderTimeout);
void this.resumeParsing().catch(logAndReturn.undefined);
}
}
@@ -3502,25 +3500,20 @@ export class DefaultClient implements Client {
return this.handleRemoveCodeAnalysisProblems(false, identifiersAndUris);
}
public async handleCreateDeclarationOrDefinition(isCopyToClipboard: boolean, codeActionRange?: Range): Promise<void> {
public async handleCreateDeclarationOrDefinition(copy?: boolean): Promise<void> {
let range: vscode.Range | undefined;
let uri: vscode.Uri | undefined;
// range is based on the cursor position.
const editor: vscode.TextEditor | undefined = vscode.window.activeTextEditor;
if (editor) {
uri = editor.document.uri;
if (codeActionRange !== undefined) {
// Request is from a code action command which provides range from code actions args.
range = makeVscodeRange(codeActionRange);
if (editor.selection.isEmpty) {
range = new vscode.Range(editor.selection.active, editor.selection.active);
} else if (editor.selection.isReversed) {
range = new vscode.Range(editor.selection.active, editor.selection.anchor);
} else {
// Request is from context menu or command palette. Use range from cursor position.
if (editor.selection.isEmpty) {
range = new vscode.Range(editor.selection.active, editor.selection.active);
} else if (editor.selection.isReversed) {
range = new vscode.Range(editor.selection.active, editor.selection.anchor);
} else {
range = new vscode.Range(editor.selection.anchor, editor.selection.active);
}
range = new vscode.Range(editor.selection.anchor, editor.selection.active);
}
}
@@ -3540,7 +3533,7 @@ export class DefaultClient implements Client {
line: range.end.line
}
},
copyToClipboard: isCopyToClipboard
copyToClipboard: copy ?? false
};
const result: CreateDeclarationOrDefinitionResult = await this.languageClient.sendRequest(CreateDeclarationOrDefinitionRequest, params);
@@ -3830,7 +3823,7 @@ class NullClient implements Client {
handleRemoveCodeAnalysisProblems(refreshSquigglesOnSave: boolean, identifiersAndUris: CodeAnalysisDiagnosticIdentifiersAndUri[]): Promise<void> { return Promise.resolve(); }
handleFixCodeAnalysisProblems(workspaceEdit: vscode.WorkspaceEdit, refreshSquigglesOnSave: boolean, identifiersAndUris: CodeAnalysisDiagnosticIdentifiersAndUri[]): Promise<void> { return Promise.resolve(); }
handleDisableAllTypeCodeAnalysisProblems(code: string, identifiersAndUris: CodeAnalysisDiagnosticIdentifiersAndUri[]): Promise<void> { return Promise.resolve(); }
handleCreateDeclarationOrDefinition(isCopyToClipboard: boolean, codeActionRange?: Range): Promise<void> { return Promise.resolve(); }
handleCreateDeclarationOrDefinition(copy?: boolean): Promise<void> { return Promise.resolve(); }
onInterval(): void { }
dispose(): void {
this.booleanEvent.dispose();
+10 -8
View File
@@ -1814,8 +1814,8 @@ export class CppProperties {
// Check for path-related squiggles.
let paths: string[] = [];
let compilerPath: string | undefined;
for (const pathArray of [ (currentConfiguration.browse ? currentConfiguration.browse.path : undefined),
currentConfiguration.includePath, currentConfiguration.macFrameworkPath ]) {
for (const pathArray of [(currentConfiguration.browse ? currentConfiguration.browse.path : undefined),
currentConfiguration.includePath, currentConfiguration.macFrameworkPath]) {
if (pathArray) {
for (const curPath of pathArray) {
paths.push(`${curPath}`);
@@ -1825,7 +1825,7 @@ export class CppProperties {
// Skip the relative forcedInclude files.
if (currentConfiguration.forcedInclude) {
for (const file of currentConfiguration.forcedInclude) {
const resolvedFilePath: string = this.resolvePath(file);
const resolvedFilePath: string = this.resolvePath(file, isWindows);
if (path.isAbsolute(resolvedFilePath)) {
paths.push(`${file}`);
}
@@ -1843,7 +1843,7 @@ export class CppProperties {
// Resolve and split any environment variables
paths = this.resolveAndSplit(paths, undefined, this.ExtendedEnvironment);
compilerPath = util.resolveVariables(compilerPath, this.ExtendedEnvironment).trim();
compilerPath = this.resolvePath(compilerPath);
compilerPath = this.resolvePath(compilerPath, isWindows);
// Get the start/end for properties that are file-only.
const forcedIncludeStart: number = curText.search(/\s*\"forcedInclude\"\s*:\s*\[/);
@@ -1907,7 +1907,7 @@ export class CppProperties {
dotConfigPath = currentConfiguration.dotConfig;
dotConfigPath = util.resolveVariables(dotConfigPath, this.ExtendedEnvironment).trim();
dotConfigPath = this.resolvePath(dotConfigPath);
dotConfigPath = this.resolvePath(dotConfigPath, isWindows);
// does not try resolve if the dotConfig property is empty
dotConfigPath = dotConfigPath !== '' ? dotConfigPath : undefined;
@@ -1946,7 +1946,7 @@ export class CppProperties {
continue;
}
let resolvedPath: string = this.resolvePath(curPath);
let resolvedPath: string = this.resolvePath(curPath, isWindows);
if (!resolvedPath) {
continue;
}
@@ -1986,7 +1986,7 @@ export class CppProperties {
let message: string;
if (!pathExists) {
if (curOffset >= forcedIncludeStart && curOffset <= forcedeIncludeEnd
&& !path.isAbsolute(resolvedPath)) {
&& !path.isAbsolute(resolvedPath)) {
continue; // Skip the error, because it could be resolved recursively.
}
message = localize('cannot.find2', "Cannot find \"{0}\".", resolvedPath);
@@ -1994,7 +1994,7 @@ export class CppProperties {
} else {
// Check for file versus path mismatches.
if ((curOffset >= forcedIncludeStart && curOffset <= forcedeIncludeEnd) ||
(curOffset >= compileCommandsStart && curOffset <= compileCommandsEnd)) {
(curOffset >= compileCommandsStart && curOffset <= compileCommandsEnd)) {
if (util.checkFileExistsSync(resolvedPath)) {
continue;
}
@@ -2018,6 +2018,7 @@ export class CppProperties {
// TODO: This never matches. https://github.com/microsoft/vscode-cpptools/issues/9140
const envMatches: string[] | null = envText.match(pattern);
if (envMatches) {
let curOffset: number = 0;
let endOffset: number = 0;
for (const curMatch of envMatches) {
@@ -2065,6 +2066,7 @@ export class CppProperties {
telemetry.logLanguageServerEvent("ConfigSquiggles", undefined, changedSquiggleMetrics);
}
this.prevSquiggleMetrics.set(currentConfiguration.name, newSquiggleMetrics);
}
private updateToVersion2(): void {
+5 -6
View File
@@ -689,22 +689,20 @@ async function onDisableAllTypeCodeAnalysisProblems(code: string, identifiersAnd
return getActiveClient().handleDisableAllTypeCodeAnalysisProblems(code, identifiersAndUris);
}
async function onCopyDeclarationOrDefinition(args?: any): Promise<void> {
const sender: any | undefined = util.isString(args?.sender) ? args.sender : args;
async function onCopyDeclarationOrDefinition(sender?: any): Promise<void> {
const properties: { [key: string]: string } = {
sender: util.getSenderType(sender)
};
telemetry.logLanguageServerEvent('CopyDeclDefn', properties);
return getActiveClient().handleCreateDeclarationOrDefinition(true, args?.range);
return getActiveClient().handleCreateDeclarationOrDefinition(true);
}
async function onCreateDeclarationOrDefinition(args?: any): Promise<void> {
const sender: any | undefined = util.isString(args?.sender) ? args.sender : args;
async function onCreateDeclarationOrDefinition(sender?: any): Promise<void> {
const properties: { [key: string]: string } = {
sender: util.getSenderType(sender)
};
telemetry.logLanguageServerEvent('CreateDeclDefn', properties);
return getActiveClient().handleCreateDeclarationOrDefinition(false, args?.range);
return getActiveClient().handleCreateDeclarationOrDefinition();
}
function onAddToIncludePath(path: string): void {
@@ -713,6 +711,7 @@ function onAddToIncludePath(path: string): void {
// suggestion to a different workspace.
return clients.ActiveClient.handleAddToIncludePathCommand(path);
}
}
function onEnableSquiggles(): void {