Skip to content

Commit 9f2d17d

Browse files
authored
Merge pull request #10603 from microsoft/seanmcm/1_14_4_release
Merge for 1.14.4
2 parents fa77454 + 2e66dc7 commit 9f2d17d

File tree

9 files changed

+206
-181
lines changed

9 files changed

+206
-181
lines changed

Build/loc/TranslationsImportExport.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ pool:
2424
- ImageOverride -equals AzurePipelinesWindows2022compliant
2525

2626
steps:
27+
- task: NodeTool@0
28+
inputs:
29+
versionSpec: '16.x'
30+
displayName: 'Install Node.js'
31+
2732
- task: CmdLine@2
2833
inputs:
2934
script: 'cd Extension && yarn install'

Extension/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# C/C++ for Visual Studio Code Changelog
22

3+
## Version 1.14.4: February 27, 2023
4+
### Enhancements
5+
* Add `c23` and `c2x` support for clang and gcc modes. [#7471](https://github.com/microsoft/vscode-cpptools/issues/7471)
6+
* Filter out clang-tidy `#pragma once in main file` warnings. [#10539](https://github.com/microsoft/vscode-cpptools/issues/10539)
7+
8+
### Bug Fixes
9+
* Fix `--` in args making compiler querying fail. [#10529](https://github.com/microsoft/vscode-cpptools/issues/10529)
10+
* Fix every .C file being opened in a compile_commands.json if it's build for C++. [#10540](https://github.com/microsoft/vscode-cpptools/issues/10540)
11+
* Fix `-std=c++` not being used in compile_commands.json for .C files. [#10541](https://github.com/microsoft/vscode-cpptools/issues/10541)
12+
* Fix a bug that could cause IntelliSense to randomly stop updating.
13+
* Fix some random failures that could happen during database deletion.
14+
* Fix some random crashes on shutdown.
15+
316
## Version 1.14.3: February 14, 2023
417
### New Features
518
* Add recursive macro expansion on hover. [#3579](https://github.com/microsoft/vscode-cpptools/issues/3579)

Extension/c_cpp_properties.schema.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,12 @@
3636
"c99",
3737
"c11",
3838
"c17",
39+
"c23",
3940
"gnu89",
4041
"gnu99",
4142
"gnu11",
4243
"gnu17",
44+
"gnu23",
4345
"${default}"
4446
]
4547
},

Extension/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "cpptools",
33
"displayName": "C/C++",
44
"description": "C/C++ IntelliSense, debugging, and code browsing.",
5-
"version": "1.14.3-main",
5+
"version": "1.14.4-main",
66
"publisher": "ms-vscode",
77
"icon": "LanguageCCPP_color_128x.png",
88
"readme": "README.md",
@@ -572,10 +572,12 @@
572572
"c99",
573573
"c11",
574574
"c17",
575+
"c23",
575576
"gnu89",
576577
"gnu99",
577578
"gnu11",
578-
"gnu17"
579+
"gnu17",
580+
"gnu23"
579581
],
580582
"markdownDescription": "%c_cpp.configuration.default.cStandard.markdownDescription%",
581583
"scope": "resource"

Extension/src/LanguageServer/Providers/codeActionProvider.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ export class CodeActionProvider implements vscode.CodeActionProvider {
169169
resultCodeActions.push(...docCodeActions);
170170
return;
171171
}
172+
if (command.command === 'C_Cpp.CreateDeclarationOrDefinition' && (command.arguments ?? []).length === 0) {
173+
command.arguments = ['codeAction']; // We report the sender of the command
174+
}
172175
const vscodeCodeAction: vscode.CodeAction = {
173176
title: title,
174177
command: command.command === "edit" ? undefined : {

Extension/src/LanguageServer/extension.ts

Lines changed: 41 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -423,75 +423,25 @@ export function registerCommands(enabled: boolean): void {
423423
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.RestartIntelliSenseForFile', enabled ? onRestartIntelliSenseForFile : onDisabledCommand));
424424
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.GenerateDoxygenComment', enabled ? onGenerateDoxygenComment : onDisabledCommand));
425425
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.CreateDeclarationOrDefinition', enabled ? onCreateDeclarationOrDefinition : onDisabledCommand));
426-
// ---------------- Wrappers -------------
427-
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ConfigurationSelectUI_Telemetry', enabled ?
428-
() => {
429-
logForUIExperiment("ConfigurationSelect");
430-
onSelectConfiguration();
431-
}
432-
: onDisabledCommand));
433-
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.RescanWorkspaceUI_Telemetry', enabled ?
434-
() => {
435-
logForUIExperiment("RescanWorkspace");
436-
onRescanWorkspace();
437-
}
438-
: onDisabledCommand));
439-
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ShowIdleCodeAnalysisCommandsUI_Telemetry', enabled ?
440-
() => {
441-
logForUIExperiment("ShowIdleCodeAnalysisCommands");
442-
onShowIdleCodeAnalysisCommands();
443-
}
444-
: onDisabledCommand));
445-
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ShowActiveCodeAnalysisCommandsUI_Telemetry', enabled ?
446-
() => {
447-
logForUIExperiment("ShowActiveCodeAnalysisCommands");
448-
onShowActiveCodeAnalysisCommands();
449-
}
450-
: onDisabledCommand));
451-
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.PauseParsingUI_Telemetry', enabled ?
452-
() => {
453-
logForUIExperiment("ParsingCommands");
454-
onPauseParsing();
455-
}
456-
: onDisabledCommand));
457-
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ResumeParsingUI_Telemetry', enabled ?
458-
() => {
459-
logForUIExperiment("ParsingCommands");
460-
onResumeParsing();
461-
}
462-
: onDisabledCommand));
463-
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.CheckForCompilerUI_Telemetry', enabled ?
464-
() => {
465-
logForUIExperiment("CheckForCompiler");
466-
onCheckForCompiler();
467-
}
468-
: onDisabledCommand));
469-
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.RestartIntelliSenseForFileUI_Telemetry', enabled ?
470-
() => {
471-
logForUIExperiment("RestartIntelliSenseForFile");
472-
onRestartIntelliSenseForFile();
473-
}
474-
: onDisabledCommand));
475-
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ShowReferencesProgressUI_Telemetry', enabled ?
476-
() => {
477-
logForUIExperiment("ShowReferencesProgress");
478-
onShowReferencesProgress();
479-
}
480-
: onDisabledCommand));
481-
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ShowParsingCommandsUI_Telemetry', enabled ?
482-
() => {
483-
logForUIExperiment("ParsingCommands");
484-
onShowParsingCommands();
485-
}
486-
: onDisabledCommand));
487-
// ----------------------------------------
488426
}
489427

490-
async function logForUIExperiment(command: string): Promise<void> {
428+
function logForUIExperiment(command: string, sender?: any): void {
491429
const settings: CppSettings = new CppSettings((vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 0) ? vscode.workspace.workspaceFolders[0]?.uri : undefined);
492-
const isNewUI: string = ui.isNewUI.toString();
493-
const isOverridden: string = (settings.experimentalFeatures ?? false).toString();
494-
telemetry.logLanguageServerEvent(`experiment${command}`, { newUI: isNewUI, uiOverride: isOverridden });
430+
const properties: {[key: string]: string} = {
431+
newUI: ui.isNewUI.toString(),
432+
uiOverride: (settings.experimentalFeatures ?? false).toString(),
433+
sender: getSenderType(sender)
434+
};
435+
telemetry.logLanguageServerEvent(`experiment${command}`, properties);
436+
}
437+
438+
function getSenderType(sender?: any): string {
439+
if (util.isString(sender)) {
440+
return sender;
441+
} else if (util.isUri(sender)) {
442+
return 'contextMenu';
443+
}
444+
return 'commandPalette';
495445
}
496446

497447
function onDisabledCommand(): void {
@@ -506,7 +456,8 @@ function onDisabledCommand(): void {
506456
vscode.window.showWarningMessage(message);
507457
}
508458

509-
function onRestartIntelliSenseForFile(): void {
459+
function onRestartIntelliSenseForFile(sender?: any): void {
460+
logForUIExperiment("RestartIntelliSenseForFile", sender);
510461
const activeEditor: vscode.TextEditor | undefined = vscode.window.activeTextEditor;
511462
if (!activeEditor || !activeEditor.document || activeEditor.document.uri.scheme !== "file" ||
512463
(activeEditor.document.languageId !== "c" && activeEditor.document.languageId !== "cpp" && activeEditor.document.languageId !== "cuda-cpp")) {
@@ -590,7 +541,8 @@ function selectDefaultCompiler(): void {
590541
clients.ActiveClient.promptSelectCompiler(true);
591542
}
592543

593-
function onSelectConfiguration(): void {
544+
function onSelectConfiguration(sender?: any): void {
545+
logForUIExperiment("ConfigurationSelect", sender);
594546
if (!isFolderOpen()) {
595547
vscode.window.showInformationMessage(localize("configuration.select.first", 'Open a folder first to select a configuration.'));
596548
} else {
@@ -656,7 +608,8 @@ function onGoToPrevDirectiveInGroup(): void {
656608
client.handleGoToDirectiveInGroup(false);
657609
}
658610

659-
function onCheckForCompiler(): void {
611+
function onCheckForCompiler(sender?: any): void {
612+
logForUIExperiment("CheckForCompiler", sender);
660613
const client: Client = getActiveClient();
661614
client.handleCheckForCompiler();
662615
}
@@ -731,7 +684,11 @@ async function onDisableAllTypeCodeAnalysisProblems(code: string, identifiersAnd
731684
getActiveClient().handleDisableAllTypeCodeAnalysisProblems(code, identifiersAndUris);
732685
}
733686

734-
async function onCreateDeclarationOrDefinition(): Promise<void> {
687+
async function onCreateDeclarationOrDefinition(sender?: any): Promise<void> {
688+
const properties: { [key: string]: string } = {
689+
sender: getSenderType(sender)
690+
};
691+
telemetry.logLanguageServerEvent('CreateDeclDefn', properties);
735692
getActiveClient().handleCreateDeclarationOrDefinition();
736693
}
737694

@@ -769,11 +726,13 @@ function onToggleDimInactiveRegions(): void {
769726
settings.update<boolean>("dimInactiveRegions", !settings.dimInactiveRegions);
770727
}
771728

772-
function onPauseParsing(): void {
729+
function onPauseParsing(sender?: any): void {
730+
logForUIExperiment("ParsingCommands", sender);
773731
clients.ActiveClient.pauseParsing();
774732
}
775733

776-
function onResumeParsing(): void {
734+
function onResumeParsing(sender?: any): void {
735+
logForUIExperiment("ParsingCommands", sender);
777736
clients.ActiveClient.resumeParsing();
778737
}
779738

@@ -789,19 +748,23 @@ function onCancelCodeAnalysis(): void {
789748
clients.ActiveClient.CancelCodeAnalysis();
790749
}
791750

792-
function onShowParsingCommands(): void {
751+
function onShowParsingCommands(sender?: any): void {
752+
logForUIExperiment("ParsingCommands", sender);
793753
clients.ActiveClient.handleShowParsingCommands();
794754
}
795755

796-
function onShowActiveCodeAnalysisCommands(): void {
756+
function onShowActiveCodeAnalysisCommands(sender?: any): void {
757+
logForUIExperiment("ShowActiveCodeAnalysisCommands", sender);
797758
clients.ActiveClient.handleShowActiveCodeAnalysisCommands();
798759
}
799760

800-
function onShowIdleCodeAnalysisCommands(): void {
761+
function onShowIdleCodeAnalysisCommands(sender?: any): void {
762+
logForUIExperiment("ShowIdleCodeAnalysisCommands", sender);
801763
clients.ActiveClient.handleShowIdleCodeAnalysisCommands();
802764
}
803765

804-
function onShowReferencesProgress(): void {
766+
function onShowReferencesProgress(sender?: any): void {
767+
logForUIExperiment("ShowReferencesProgress", sender);
805768
clients.ActiveClient.handleReferencesIcon();
806769
}
807770

@@ -898,7 +861,8 @@ function onLogDiagnostics(): void {
898861
clients.ActiveClient.logDiagnostics();
899862
}
900863

901-
function onRescanWorkspace(): void {
864+
function onRescanWorkspace(sender?: string): void {
865+
logForUIExperiment("RescanWorkspace", sender);
902866
clients.ActiveClient.rescanFolder();
903867
}
904868

Extension/src/LanguageServer/ui.ts

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ interface ConfigurationStatus {
5656
priority: ConfigurationPriority;
5757
}
5858

59+
const commandArguments: string[] = ['oldUI']; // We report the sender of the command
60+
5961
export class OldUI implements UI {
6062
private configStatusBarItem: vscode.StatusBarItem;
6163
private browseEngineStatusBarItem: vscode.StatusBarItem;
@@ -84,14 +86,22 @@ export class OldUI implements UI {
8486
const configTooltip: string = localize("c.cpp.configuration.tooltip", "C/C++ Configuration");
8587
this.configStatusBarItem = vscode.window.createStatusBarItem("c.cpp.configuration.tooltip", vscode.StatusBarAlignment.Right, 0);
8688
this.configStatusBarItem.name = configTooltip;
87-
this.configStatusBarItem.command = "C_Cpp.ConfigurationSelectUI_Telemetry";
89+
this.configStatusBarItem.command = {
90+
command: "C_Cpp.ConfigurationSelect",
91+
title: configTooltip,
92+
arguments: commandArguments
93+
};
8894
this.configStatusBarItem.tooltip = configTooltip;
8995
this.ShowConfiguration = true;
9096

9197
this.referencesStatusBarItem = vscode.window.createStatusBarItem("c.cpp.references.statusbar", vscode.StatusBarAlignment.Right, 901);
9298
this.referencesStatusBarItem.name = localize("c.cpp.references.statusbar", "C/C++ References Status");
9399
this.referencesStatusBarItem.tooltip = "";
94-
this.referencesStatusBarItem.command = "C_Cpp.ShowReferencesProgressUI_Telemetry";
100+
this.referencesStatusBarItem.command = {
101+
command: "C_Cpp.ShowReferencesProgress",
102+
title: this.referencesStatusBarItem.name,
103+
arguments: commandArguments
104+
};
95105
this.ShowReferencesIcon = false;
96106

97107
this.intelliSenseStatusBarItem = vscode.window.createStatusBarItem("c.cpp.intellisense.statusbar", vscode.StatusBarAlignment.Right, 903);
@@ -133,7 +143,11 @@ export class OldUI implements UI {
133143

134144
private setIsParsingWorkspacePausable(val: boolean): void {
135145
if (val) {
136-
this.browseEngineStatusBarItem.command = "C_Cpp.ShowParsingCommandsUI_Telemetry";
146+
this.browseEngineStatusBarItem.command = {
147+
command: "C_Cpp.ShowParsingCommands",
148+
title: this.browseEngineStatusBarItem.name ?? '',
149+
arguments: commandArguments
150+
};
137151
} else {
138152
this.browseEngineStatusBarItem.command = undefined;
139153
}
@@ -189,7 +203,11 @@ export class OldUI implements UI {
189203
this.intelliSenseStatusBarItem.tooltip = (this.isUpdatingIntelliSense ? this.updatingIntelliSenseTooltip : "")
190204
+ (twoStatus ? " | " : "")
191205
+ (val ? this.runningCodeAnalysisTooltip : "");
192-
this.intelliSenseStatusBarItem.command = val ? "C_Cpp.ShowActiveCodeAnalysisCommandsUI_Telemetry" : undefined;
206+
this.intelliSenseStatusBarItem.command = val ? {
207+
command: "C_Cpp.ShowActiveCodeAnalysisCommands",
208+
title: this.intelliSenseStatusBarItem.name ?? '',
209+
arguments: commandArguments
210+
} : undefined;
193211
}
194212

195213
private updateCodeAnalysisTooltip(): void {

0 commit comments

Comments
 (0)