Skip to content

Commit 4083075

Browse files
authored
Merge pull request #10501 from microsoft/main
Merge for 1.14.2
2 parents b745ebc + e4696c5 commit 4083075

File tree

10 files changed

+523
-350
lines changed

10 files changed

+523
-350
lines changed

Extension/CHANGELOG.md

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

3+
## Version 1.14.2: February 9, 2023
4+
### Enhancements
5+
* Add error messages for Create Declaration / Definition. [#10163](https://github.com/microsoft/vscode-cpptools/issues/10163)
6+
* Follow up changes to the new status UI. [#10413](https://github.com/microsoft/vscode-cpptools/issues/10413)
7+
* Add Ada to supported languages for debugging. [#10475](https://github.com/microsoft/vscode-cpptools/issues/10475)
8+
* Anthony Leonardo Gracio (@AnthonyLeonardoGracio) [PR #10476](https://github.com/microsoft/vscode-cpptools/pull/10476)
9+
10+
### Bug Fixes
11+
* Show a reload prompt after `C_Cpp.hover` is changed. [#10076](https://github.com/microsoft/vscode-cpptools/issues/10076)
12+
* Fix a crash with empty PATH entries on Linux/Mac.
13+
314
## Version 1.14.1: February 2, 2023
415
### New Features
516
* Add recursive macro expansion on hover. [#3579](https://github.com/microsoft/vscode-cpptools/issues/3579)
@@ -40,6 +51,7 @@
4051
* Fix an incorrect IntelliSense error with `std::bind`, c++17, and windows-msvc-arm64 mode. [#10304](https://github.com/microsoft/vscode-cpptools/issues/10304)
4152
* Fix vcFormat when using lambda functions. [#10326](https://github.com/microsoft/vscode-cpptools/issues/10326)
4253
* Fix IntelliSense crash in field_for_lambda_capture. [#10359](https://github.com/microsoft/vscode-cpptools/issues/10359)
54+
* Fix an IntelliSense crash when using the French language pack. [#10374](https://github.com/microsoft/vscode-cpptools/issues/10374)
4355

4456
## Version 1.13.9: January 4, 2023
4557
### Bug Fix

Extension/package.json

Lines changed: 10 additions & 5 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.1-main",
5+
"version": "1.14.2-main",
66
"publisher": "ms-vscode",
77
"icon": "LanguageCCPP_color_128x.png",
88
"readme": "README.md",
@@ -3146,6 +3146,7 @@
31463146
"type": "cppdbg",
31473147
"label": "C++ (GDB/LLDB)",
31483148
"languages": [
3149+
"ada",
31493150
"c",
31503151
"cpp",
31513152
"cuda-cpp",
@@ -3515,7 +3516,7 @@
35153516
},
35163517
{
35173518
"type": "boolean",
3518-
"description": "%c_cpp.debuggers.logging.engineLogging.description%",
3519+
"description": "%c_cpp.debuggers.logging.natvisDiagnostics.description%",
35193520
"default": false
35203521
}
35213522
]
@@ -4303,7 +4304,7 @@
43034304
},
43044305
{
43054306
"type": "boolean",
4306-
"description": "%c_cpp.debuggers.logging.engineLogging.description%",
4307+
"description": "%c_cpp.debuggers.logging.natvisDiagnostics.description%",
43074308
"default": false
43084309
}
43094310
]
@@ -4893,6 +4894,7 @@
48934894
"label": "C++ (Windows)",
48944895
"when": "workspacePlatform == windows",
48954896
"languages": [
4897+
"ada",
48964898
"c",
48974899
"cpp",
48984900
"cuda-cpp",
@@ -5289,6 +5291,9 @@
52895291
}
52905292
],
52915293
"breakpoints": [
5294+
{
5295+
"language": "ada"
5296+
},
52925297
{
52935298
"language": "c"
52945299
},
@@ -5962,8 +5967,8 @@
59625967
"vscode-debugprotocol": "^1.35.0",
59635968
"vscode-dts": "^0.3.2",
59645969
"vscode-nls-dev": "^4.0.0-next.1",
5965-
"webpack": "^5.28.0",
5966-
"webpack-cli": "^4.5.0",
5970+
"webpack": "^5.75.0",
5971+
"webpack-cli": "^5.0.1",
59675972
"xml2js": "^0.4.19"
59685973
},
59695974
"dependencies": {

Extension/src/LanguageServer/client.ts

Lines changed: 105 additions & 64 deletions
Large diffs are not rendered by default.

Extension/src/LanguageServer/configurations.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,15 @@ export class CppProperties {
396396
(isUnset(settings.defaultCompileCommands) || settings.defaultCompileCommands === "") && !configuration.compileCommands) {
397397
// compile_commands.json already specifies a compiler. compilerPath overrides the compile_commands.json compiler so
398398
// don't set a default when compileCommands is in use.
399-
configuration.compilerPath = this.defaultCompilerPath;
399+
400+
// if the compiler is a cl.exe compiler, replace the full path with the "cl.exe" string.
401+
const compiler: string = path.basename(this.defaultCompilerPath).toLowerCase();
402+
403+
if (compiler === "cl.exe") {
404+
configuration.compilerPath = "cl.exe";
405+
} else {
406+
configuration.compilerPath = this.defaultCompilerPath;
407+
}
400408
}
401409
if ((isUnset(settings.defaultCStandard) || settings.defaultCStandard === "") && this.defaultCStandard) {
402410
configuration.cStandard = this.defaultCStandard;

Extension/src/LanguageServer/extension.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,8 +488,10 @@ export function registerCommands(enabled: boolean): void {
488488
}
489489

490490
async function logForUIExperiment(command: string): Promise<void> {
491+
const settings: CppSettings = new CppSettings((vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 0) ? vscode.workspace.workspaceFolders[0]?.uri : undefined);
491492
const isNewUI: string = ui.isNewUI.toString();
492-
telemetry.logLanguageServerEvent(`experiment${command}`, { newUI: isNewUI });
493+
const isOverridden: string = (settings.experimentalFeatures ?? false).toString();
494+
telemetry.logLanguageServerEvent(`experiment${command}`, { newUI: isNewUI, uiOverride: isOverridden });
493495
}
494496

495497
function onDisabledCommand(): void {

Extension/src/LanguageServer/settingsTracker.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ type FilterFunction = (key: string, val: string, settings: vscode.WorkspaceConfi
1414
type KeyValuePair = { key: string; value: string };
1515

1616
const maxSettingLengthForTelemetry: number = 50;
17-
let cache: SettingsTracker;
1817

1918
export class SettingsTracker {
2019
private previousCppSettings: { [key: string]: any } = {};
@@ -207,10 +206,3 @@ export class SettingsTracker {
207206
return value1 === value2;
208207
}
209208
}
210-
211-
export function getTracker(resource: vscode.Uri | undefined): SettingsTracker {
212-
if (!cache) {
213-
cache = new SettingsTracker(resource);
214-
}
215-
return cache;
216-
}

Extension/src/LanguageServer/ui_new.ts

Lines changed: 43 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ export class NewUI implements UI {
6868
private codeAnalysisTotal: number = 0;
6969
private readonly workspaceParsingRunningText: string = localize("running.tagparser.text", "Parsing Workspace");
7070
private readonly workspaceParsingPausedText: string = localize("paused.tagparser.text", "Parsing Workspace: Paused");
71-
private readonly workspaceParseingDoneText: string = localize("complete.tagparser.text", "Parsing Complete");
71+
private readonly workspaceParsingDoneText: string = localize("complete.tagparser.text", "Parsing Complete");
72+
private readonly workspaceParsingInitializing: string = localize("initializing.tagparser.text", "Initializing Workspace");
73+
private readonly workspaceParsingIndexing: string = localize("indexing.tagparser.text", "Indexing Workspace");
7274
private workspaceParsingStatus: string = "";
7375
private workspaceParsingProgress: string = "";
7476
private readonly workspaceRescanText = localize("rescan.tagparse.text", "Rescan Workspace");
@@ -109,7 +111,7 @@ export class NewUI implements UI {
109111

110112
this.browseEngineStatusBarItem = vscode.languages.createLanguageStatusItem(`cpptools.status.${LanguageStatusPriority.Mid}.tagparser`, documentSelector);
111113
this.browseEngineStatusBarItem.name = localize("cpptools.status.tagparser", "C/C++ Tag Parser Status");
112-
this.browseEngineStatusBarItem.detail = localize("indexing.files.tooltip", "Indexing Workspace");
114+
this.browseEngineStatusBarItem.detail = localize("cpptools.detail.tagparser", "Initializing...");
113115
this.browseEngineStatusBarItem.text = "$(database)";
114116
this.browseEngineStatusBarItem.command = {
115117
command: "C_Cpp.RescanWorkspaceUI_Telemetry",
@@ -143,27 +145,38 @@ export class NewUI implements UI {
143145
}
144146
}
145147

148+
private setIsInitializingWorkspace(val: boolean): void {
149+
if (val) {
150+
this.browseEngineStatusBarItem.text = "$(database)";
151+
this.browseEngineStatusBarItem.detail = this.workspaceParsingInitializing;
152+
}
153+
}
154+
private setIsIndexingWorkspace(val: boolean): void {
155+
if (val) {
156+
this.browseEngineStatusBarItem.text = "$(database)";
157+
this.browseEngineStatusBarItem.detail = this.workspaceParsingIndexing;
158+
this.browseEngineStatusBarItem.busy = true;
159+
}
160+
}
161+
146162
private dbTimeout?: NodeJS.Timeout;
147163
private setIsParsingWorkspace(val: boolean): void {
148164
this.isParsingWorkspace = val;
149165
const showIcon: boolean = val || this.isParsingFiles;
150-
const twoStatus: boolean = val && this.isParsingFiles;
151166

152167
// Leave this outside for more realtime respone
153168
this.browseEngineStatusBarItem.busy = showIcon;
154169

155170
if (showIcon) {
156171
this.browseEngineStatusBarItem.text = "$(database)";
157-
this.browseEngineStatusBarItem.detail = (this.isParsingFiles ? this.parsingFilesTooltip : "")
158-
+ (twoStatus ? " | " : "")
159-
+ (val ? this.workspaceParsingStatus : "");
172+
this.browseEngineStatusBarItem.detail = this.tagParseText();
160173

161174
if (this.dbTimeout) {
162175
clearTimeout(this.dbTimeout);
163176
}
164177
} else {
165178
this.dbTimeout = setTimeout(() => {
166-
this.browseEngineStatusBarItem.text = this.workspaceParseingDoneText;
179+
this.browseEngineStatusBarItem.text = this.workspaceParsingDoneText;
167180
this.browseEngineStatusBarItem.detail = "";
168181
this.browseEngineStatusBarItem.command = {
169182
command: "C_Cpp.RescanWorkspaceUI_Telemetry",
@@ -173,6 +186,17 @@ export class NewUI implements UI {
173186
}
174187
}
175188

189+
private tagParseText(): string {
190+
if (this.isParsingWorkspacePaused) {
191+
const twoStatus: boolean = this.isParsingFiles && this.isParsingWorkspace;
192+
return (this.isParsingFiles ? this.parsingFilesTooltip : "")
193+
+ (twoStatus ? " | " : "")
194+
+ (this.isParsingWorkspace ? this.workspaceParsingStatus : "");
195+
} else {
196+
return this.isParsingWorkspace ? this.workspaceParsingStatus : this.parsingFilesTooltip;
197+
}
198+
}
199+
176200
private setIsParsingWorkspacePausable(val: boolean): void {
177201
if (val && this.isParsingWorkspace) {
178202
this.browseEngineStatusBarItem.command = {
@@ -183,11 +207,15 @@ export class NewUI implements UI {
183207
}
184208

185209
private setIsParsingWorkspacePaused(val: boolean): void {
210+
if (!this.isParsingFiles && !this.isParsingWorkspace) {
211+
// Ignore a pause change if no parsing is actually happening.
212+
return;
213+
}
186214
this.isParsingWorkspacePaused = val;
187215
this.browseEngineStatusBarItem.busy = !val || this.isParsingFiles;
188216
this.browseEngineStatusBarItem.text = "$(database)";
189217
this.workspaceParsingStatus = val ? this.workspaceParsingPausedText : this.workspaceParsingRunningText;
190-
this.browseEngineStatusBarItem.detail = (this.isParsingFiles ? `${this.parsingFilesTooltip} | ` : "") + this.workspaceParsingStatus;
218+
this.browseEngineStatusBarItem.detail = this.tagParseText();
191219
this.browseEngineStatusBarItem.command = val ? {
192220
command: "C_Cpp.ResumeParsingUI_Telemetry",
193221
title: localize("tagparser.resume.text", "Resume")
@@ -210,24 +238,21 @@ export class NewUI implements UI {
210238
private setIsParsingFiles(val: boolean): void {
211239

212240
this.isParsingFiles = val;
213-
const showIcon: boolean = val || (!this.isParsingWorkspacePaused && this.isParsingWorkspace);
214-
const twoStatus: boolean = val && this.isParsingWorkspace;
241+
const showIcon: boolean = val || this.isParsingWorkspace;
215242

216243
// Leave this outside for more realtime respone
217-
this.browseEngineStatusBarItem.busy = showIcon;
244+
this.browseEngineStatusBarItem.busy = val || (!this.isParsingWorkspacePaused && this.isParsingWorkspace);
218245

219246
if (showIcon) {
220247
this.browseEngineStatusBarItem.text = "$(database)";
221-
this.browseEngineStatusBarItem.detail = (val ? this.parsingFilesTooltip : "")
222-
+ (twoStatus ? " | " : "")
223-
+ (this.isParsingWorkspace ? this.workspaceParsingStatus : "");
248+
this.browseEngineStatusBarItem.detail = this.tagParseText();
224249

225250
if (this.dbTimeout) {
226251
clearTimeout(this.dbTimeout);
227252
}
228-
} else if (!this.isParsingWorkspace && !val) {
253+
} else {
229254
this.dbTimeout = setTimeout(() => {
230-
this.browseEngineStatusBarItem.text = this.workspaceParseingDoneText;
255+
this.browseEngineStatusBarItem.text = this.workspaceParsingDoneText;
231256
this.browseEngineStatusBarItem.detail = "";
232257
this.browseEngineStatusBarItem.command = {
233258
command: "C_Cpp.RescanWorkspaceUI_Telemetry",
@@ -376,6 +401,8 @@ export class NewUI implements UI {
376401
}
377402

378403
public bind(client: Client): void {
404+
client.InitializingWorkspaceChanged(value => { this.setIsInitializingWorkspace(value); });
405+
client.IndexingWorkspaceChanged(value => { this.setIsIndexingWorkspace(value); });
379406
client.ParsingWorkspaceChanged(value => { this.setIsParsingWorkspace(value); });
380407
client.ParsingWorkspacePausableChanged(value => { this.setIsParsingWorkspacePausable(value); });
381408
client.ParsingWorkspacePausedChanged(value => { this.setIsParsingWorkspacePaused(value); });

Extension/src/nativeStrings.json

Lines changed: 71 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@
267267
"file_tag": "File",
268268
"compiler_default_language_standard_version_old" : "Compiler returned default language standard version: {0}. Since this version is old, will try to use newer version {1} as default.",
269269
"unexpected_output_from_clang_tidy": "Unexpected output from clang-tidy: {0}. Expected: {1}.",
270-
"generate_doxygen_comment": "Generate Doxygen Comment",
270+
"generate_doxygen_comment": "Generate Doxygen comment",
271271
"offer_create_declaration": {
272272
"text": "Create declaration of '{0}' in {1}",
273273
"hint": "{0} is the name of a C/C++ function, {1} is a file name."
@@ -368,5 +368,74 @@
368368
},
369369
"cm_addfunction": {
370370
"text": "Automatic add function"
371-
}
371+
},
372+
"e_com_virtual_redundant": {
373+
"text": "vsCMFunctionVirtual is redundant and must not be specified when with vsCMFunctionComMethod.",
374+
"hint": "Do not localize 'vsCMFunctionVirtual' and 'vsCMFunctionComMethod', they are code implementation."
375+
},
376+
"e_static_com_method": {
377+
"text": "vsCMFunctionComMethod cannot be static.",
378+
"hint": "Do not localize 'vsCMFunctionComMethod', it is code implementation."
379+
},
380+
"e_invalid_ftype": {
381+
"text": "Invalid C/C++ file: '%s'.",
382+
"hint": "%s is the invalid file."
383+
},
384+
"e_fname_to_long": {
385+
"text": "File name too long: '%s'.",
386+
"hint": "%s is the file that has a long name."
387+
},
388+
"e_create_file": {
389+
"text": "Cannot create file '%s'.",
390+
"hint": "%s is the file that could not be created."
391+
},
392+
"e_access_file": {
393+
"text": "Cannot access directory or file '%s' for writing.",
394+
"hint": "%s is the directory or file that could not be accessed for writing."
395+
},
396+
"e_invalid_pathname": {
397+
"text": "Invalid file path: '%s'.",
398+
"hint": "%s is the file that has an invalid path."
399+
},
400+
"e_cm_file_not_in_project": {
401+
"text": "File '%s' was not found.",
402+
"hint": "%s is the file that was not found."
403+
},
404+
"refactor_create_declaration_definition_failed":
405+
{
406+
"text": "Create Declaration / Definition failed: %s",
407+
"hint": "The operation 'Create Declaration / Definition' on a function was not successful. %s is the error info that has a period at the end of the string."
408+
},
409+
"refactor_create_default_delete":
410+
{
411+
"text": "Unable to create function '%s'. Creating defaulted or deleted functions is not supported.",
412+
"hint": "%s is the function that could not be created."
413+
},
414+
"refactor_function_copied_to_clipboard": "The function signature was copied to the clipboard.",
415+
"refactor_function_not_created":
416+
{
417+
"text": "Unable to create function '%s'.",
418+
"hint": "%s is the function that could not be created."
419+
},
420+
"refactor_ambiguous_locations":
421+
{
422+
"text": "Unable to find an unambiguous location for function '%s'.",
423+
"hint": "%s is the function for the unambiguous location."
424+
},
425+
"refactor_file_not_in_project":
426+
{
427+
"text": "File '%s' was not found.",
428+
"hint": "%s is the file that was not found."
429+
},
430+
"refactor_not_class_namespace":
431+
{
432+
"text": "Could not find class or namespace '%s'.",
433+
"hint": "%s is the class or namespace code that could not be found."
434+
},
435+
"refactor_operation_unsupported":
436+
{
437+
"text": "The operation is not supported for '%s'.",
438+
"hint": "%s is the function that is not supported for an operation that involves automatically generating code."
439+
},
440+
"unknown_error": "Unknown error."
372441
}

Extension/tools/OptionsSchema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
},
133133
{
134134
"type": "boolean",
135-
"description": "%c_cpp.debuggers.logging.engineLogging.description%",
135+
"description": "%c_cpp.debuggers.logging.natvisDiagnostics.description%",
136136
"default": false
137137
}
138138
]

0 commit comments

Comments
 (0)