From f4694c5036957200958a1593150275ef14804a52 Mon Sep 17 00:00:00 2001 From: Colen Garoutte-Carson Date: Thu, 13 Mar 2025 17:21:54 -0700 Subject: [PATCH 01/10] Work in progress --- Extension/c_cpp_properties.schema.json | 29 +++++++++++++- Extension/package.json | 14 +++++++ Extension/package.nls.json | 16 +++++++- .../src/LanguageServer/configurations.ts | 38 +++++++++---------- Extension/src/LanguageServer/settings.ts | 2 + Extension/ui/settings.html | 21 ++++++++++ 6 files changed, 98 insertions(+), 22 deletions(-) diff --git a/Extension/c_cpp_properties.schema.json b/Extension/c_cpp_properties.schema.json index cd7e174d9..62874782d 100644 --- a/Extension/c_cpp_properties.schema.json +++ b/Extension/c_cpp_properties.schema.json @@ -180,7 +180,10 @@ "mergeConfigurations": { "markdownDescription": "Set to `true` to merge include paths, defines, and forced includes with those from a configuration provider.", "descriptionHint": "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered.", - "type": "boolean" + "type": [ + "boolean", + "string" + ] }, "browse": { "type": "object", @@ -208,6 +211,30 @@ }, "additionalProperties": false }, + "recursiveIncludes": { + "type": "object", + "properties": { + "reduce": { + "markdownDescription": "Set to `true` to reduce the number of recursive include paths provided to IntelliSense to only those paths currently referenced by #include statements. This requires first parsing files to determine which files are included. Set to `false` to provide all recursive include paths to IntelliSense. Reducing the number of recursive include paths may improve IntelliSense performance when a very large number of recursive include paths are involved. Not reducing the number of recursive include paths can improve IntelliSense performance by avoiding the need to parse files to determine which include paths to provide.", + "descriptionHint": "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered.", + "type": [ + "boolean", + "string" + ] + }, + "priority": { + "markdownDescription": "The priority of recursive include paths. If set to `beforeSystemIncludes`, the recursive include paths will be searched before system include paths. If set to `afterSystemIncludes`, the recursive include paths will be searched after system include paths.", + "descriptionHint": "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered.", + "type": "string", + "enum": [ + "beforeSystemIncludes", + "afterSystemIncludes", + "${default}" + ] + } + }, + "additionalProperties": false + }, "customConfigurationVariables": { "type": "object", "markdownDescription": "Custom variables that can be queried through the command `${cpptools:activeConfigCustomVariable}` to use for the input variables in `launch.json` or `tasks.json`.", diff --git a/Extension/package.json b/Extension/package.json index 515764ae9..17509ca68 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -897,6 +897,20 @@ "markdownDescription": "%c_cpp.configuration.default.dotConfig.markdownDescription%", "scope": "resource" }, + "C_Cpp.default.recursiveIncludes.reduce": { + "type": "boolean", + "markdownDescription": "%c_cpp.configuration.default.recursiveIncludes.reduce.markdownDescription%", + "scope": "resource" + }, + "C_Cpp.default.recursiveIncludes.priority": { + "type": "string", + "enum": [ + "beforeSystemIncludes", + "afterSystemIncludes" + ], + "markdownDescription": "%c_cpp.configuration.default.recursiveIncludes.priority.markdownDescription%", + "scope": "resource" + }, "C_Cpp.configurationWarnings": { "type": "string", "enum": [ diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 67a3bcb3d..7dd97694b 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -682,7 +682,7 @@ ] }, "c_cpp.configuration.default.mergeConfigurations.markdownDescription": { - "message": "Set to `true` to merge include paths, defines, and forced includes with those from a configuration provider.", + "message": "The value to use in a configuration if `mergeConfigurations` is not specified, or the value to insert if `${default}` is present in `mergeConfigurations`.", "comment": [ "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered." ] @@ -729,13 +729,25 @@ "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered." ] }, - "c_cpp.configuration.updateChannel.deprecationMessage": "This setting is deprecated. Pre-release extensions are now available via the Marketplace.", "c_cpp.configuration.default.dotConfig.markdownDescription": { "message": "The value to use in a configuration if `dotConfig` is not specified, or the value to insert if `${default}` is present in `dotConfig`.", "comment": [ "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered." ] }, + "c_cpp.configuration.default.recursiveIncludes.reduce.markdownDescription": { + "message": "The value to use in a configuration if `recursiveIncludes.reduce` is not specified, or the value to insert if `${default}` is present in `recursiveIncludes.reduce`.", + "comment": [ + "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered." + ] + }, + "c_cpp.configuration.default.recursiveIncludes.priority.markdownDescription": { + "message": "The value to use in a configuration if `recursiveIncludes.priority` is not specified, or the value to insert if `${default}` is present in `recursiveIncludes.priority`.", + "comment": [ + "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered." + ] + }, + "c_cpp.configuration.updateChannel.deprecationMessage": "This setting is deprecated. Pre-release extensions are now available via the Marketplace.", "c_cpp.configuration.experimentalFeatures.description": "Controls whether \"experimental\" features are usable.", "c_cpp.configuration.suggestSnippets.markdownDescription": { "message": "If `true`, snippets are provided by the language server.", diff --git a/Extension/src/LanguageServer/configurations.ts b/Extension/src/LanguageServer/configurations.ts index 8be51b0a7..4e24cc26d 100644 --- a/Extension/src/LanguageServer/configurations.ts +++ b/Extension/src/LanguageServer/configurations.ts @@ -83,8 +83,9 @@ export interface Configuration { forcedInclude?: string[]; configurationProviderInCppPropertiesJson?: string; configurationProvider?: string; - mergeConfigurations?: boolean; + mergeConfigurations?: boolean | string; browse?: Browse; + recursiveIncludes?: RecursiveIncludes; customConfigurationVariables?: { [key: string]: string }; } @@ -107,6 +108,11 @@ export interface Browse { databaseFilename?: string; } +export interface RecursiveIncludes { + reduce?: boolean | string; + priority?: string; +} + export interface KnownCompiler { path: string; isC: boolean; @@ -813,13 +819,16 @@ export class CppProperties { return resolvedGlob; } - private updateConfigurationString(property: string | undefined | null, defaultValue: string | undefined | null, env: Environment, acceptBlank?: boolean): string | undefined { + private updateConfigurationString(property: string | undefined | null, defaultValue: string | undefined | null, env?: Environment, acceptBlank?: boolean): string | undefined { if (property === null || property === undefined || property === "${default}") { property = defaultValue; } if (property === null || property === undefined || (acceptBlank !== true && property === "")) { return undefined; } + if (env === undefined) { + return property; + } return util.resolveVariables(property, env); } @@ -843,21 +852,8 @@ export class CppProperties { return paths; } - private updateConfigurationStringOrBoolean(property: string | boolean | undefined | null, defaultValue: boolean | undefined | null, env: Environment): string | boolean | undefined { - if (!property || property === "${default}") { - property = defaultValue; - } - if (!property || property === "") { - return undefined; - } - if (typeof property === "boolean") { - return property; - } - return util.resolveVariables(property, env); - } - - private updateConfigurationBoolean(property: boolean | undefined | null, defaultValue: boolean | undefined | null): boolean | undefined { - if (property === null || property === undefined) { + private updateConfigurationBoolean(property: boolean | string | undefined | null, defaultValue: boolean | undefined | null): boolean | undefined { + if (property === null || property === undefined || property === "${default}") { property = defaultValue; } @@ -865,7 +861,7 @@ export class CppProperties { return undefined; } - return property; + return property === true || property === "true"; } private updateConfigurationStringDictionary(property: { [key: string]: string } | undefined, defaultValue: { [key: string]: string } | undefined, env: Environment): { [key: string]: string } | undefined { @@ -939,6 +935,10 @@ export class CppProperties { configuration.cStandardIsExplicit = configuration.cStandardIsExplicit || settings.defaultCStandard !== ""; configuration.cppStandardIsExplicit = configuration.cppStandardIsExplicit || settings.defaultCppStandard !== ""; configuration.mergeConfigurations = this.updateConfigurationBoolean(configuration.mergeConfigurations, settings.defaultMergeConfigurations); + if (configuration.recursiveIncludes) { + configuration.recursiveIncludes.reduce = this.updateConfigurationBoolean(configuration.recursiveIncludes.reduce, settings.defaultRecursiveIncludesReduce); + configuration.recursiveIncludes.priority = this.updateConfigurationString(configuration.recursiveIncludes.priority, settings.defaultRecursiveIncludesPriority); + } if (!configuration.compileCommands) { // compile_commands.json already specifies a compiler. compilerPath overrides the compile_commands.json compiler so // don't set a default when compileCommands is in use. @@ -1002,7 +1002,7 @@ export class CppProperties { configuration.browse.path = this.updateConfigurationPathsArray(configuration.browse.path, settings.defaultBrowsePath, env); } - configuration.browse.limitSymbolsToIncludedHeaders = this.updateConfigurationStringOrBoolean(configuration.browse.limitSymbolsToIncludedHeaders, settings.defaultLimitSymbolsToIncludedHeaders, env); + configuration.browse.limitSymbolsToIncludedHeaders = this.updateConfigurationBoolean(configuration.browse.limitSymbolsToIncludedHeaders, settings.defaultLimitSymbolsToIncludedHeaders); configuration.browse.databaseFilename = this.updateConfigurationString(configuration.browse.databaseFilename, settings.defaultDatabaseFilename, env); if (i === this.CurrentConfigurationIndex) { diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index 2c14030c8..16855e0c1 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -445,6 +445,8 @@ export class CppSettings extends Settings { public get defaultBrowsePath(): string[] | undefined { return this.getArrayOfStringsWithUndefinedDefault("default.browse.path"); } public get defaultDatabaseFilename(): string | undefined { return changeBlankStringToUndefined(this.getAsStringOrUndefined("default.browse.databaseFilename")); } public get defaultLimitSymbolsToIncludedHeaders(): boolean { return this.getAsBoolean("default.browse.limitSymbolsToIncludedHeaders"); } + public get defaultRecursiveIncludesReduce(): boolean { return this.getAsBoolean("default.recursiveIncludes.reduce"); } + public get defaultRecursiveIncludesPriority(): string { return this.getAsString("default.recursiveIncludes.priority"); } public get defaultSystemIncludePath(): string[] | undefined { return this.getArrayOfStringsWithUndefinedDefault("default.systemIncludePath"); } public get defaultEnableConfigurationSquiggles(): boolean { return this.getAsBoolean("default.enableConfigurationSquiggles"); } public get defaultCustomConfigurationVariables(): Associations | undefined { return this.getAsAssociations("default.customConfigurationVariables", true) ?? undefined; } diff --git a/Extension/ui/settings.html b/Extension/ui/settings.html index 5bfe02051..fd48501d9 100644 --- a/Extension/ui/settings.html +++ b/Extension/ui/settings.html @@ -722,6 +722,27 @@ +
+
Recursive includes: reduce
+ + Set to true (or checked) to reduce the number of recursive include paths provided to IntelliSense to only those paths currently referenced by #include statements. This requires first parsing files to determine which files are included. Set to false (or unchecked) to provide all recursive include paths to IntelliSense. Reducing the number of recursive include paths may improve IntelliSense performance when a very large number of recursive include paths are involved. Not reducing the number of recursive include paths can improve IntelliSense performance by avoiding the need to parse files to determine which include paths to provide. + +
+ +
+
Recursive includes: priority
+
+ The priority of recursive include paths. If set to beforeSystemIncludes, the recursive include paths will be searched before system include paths. If set to afterSystemIncludes, the recursive include paths will be searched after system include paths. +
+
+ +
+
+ From ab635e9546b19bbef80e2f6744f578c280ba11fd Mon Sep 17 00:00:00 2001 From: Colen Garoutte-Carson Date: Thu, 13 Mar 2025 19:56:10 -0700 Subject: [PATCH 02/10] Add defaults --- Extension/package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Extension/package.json b/Extension/package.json index 17509ca68..b4fec5ffd 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -899,6 +899,7 @@ }, "C_Cpp.default.recursiveIncludes.reduce": { "type": "boolean", + "default": true, "markdownDescription": "%c_cpp.configuration.default.recursiveIncludes.reduce.markdownDescription%", "scope": "resource" }, @@ -908,6 +909,7 @@ "beforeSystemIncludes", "afterSystemIncludes" ], + "default": "afterSystemIncludes", "markdownDescription": "%c_cpp.configuration.default.recursiveIncludes.priority.markdownDescription%", "scope": "resource" }, From 951f4422129eb66eeccb84b6418588119ed9ba42 Mon Sep 17 00:00:00 2001 From: Colen Garoutte-Carson Date: Thu, 13 Mar 2025 20:13:48 -0700 Subject: [PATCH 03/10] Finish plugging into config UI --- Extension/src/LanguageServer/settingsPanel.ts | 14 ++++++++++++++ Extension/ui/settings.ts | 7 +++++++ 2 files changed, 21 insertions(+) diff --git a/Extension/src/LanguageServer/settingsPanel.ts b/Extension/src/LanguageServer/settingsPanel.ts index a13ef8109..12d41293c 100644 --- a/Extension/src/LanguageServer/settingsPanel.ts +++ b/Extension/src/LanguageServer/settingsPanel.ts @@ -52,6 +52,8 @@ const elementId: { [key: string]: string } = { mergeConfigurations: "mergeConfigurations", configurationProvider: "configurationProvider", forcedInclude: "forcedInclude", + recursiveIncludesReduce: "recursiveIncludes.reduce", + recursiveIncludesPriority: "recursiveIncludes.priority", // Browse properties browsePath: "browsePath", @@ -351,6 +353,18 @@ export class SettingsPanel { case elementId.forcedInclude: this.configValues.forcedInclude = splitEntries(message.value); break; + case elementId.recursiveIncludesReduce: + if (!this.configValues.recursiveIncludes) { + this.configValues.recursiveIncludes = {}; + } + this.configValues.recursiveIncludes.reduce = message.value; + break; + case elementId.recursiveIncludesPriority: + if (!this.configValues.recursiveIncludes) { + this.configValues.recursiveIncludes = {}; + } + this.configValues.recursiveIncludes.priority = message.value; + break; case elementId.browsePath: if (!this.configValues.browse) { this.configValues.browse = {}; diff --git a/Extension/ui/settings.ts b/Extension/ui/settings.ts index fc75f4cbd..c9bb48a7b 100644 --- a/Extension/ui/settings.ts +++ b/Extension/ui/settings.ts @@ -42,6 +42,8 @@ const elementId: { [key: string]: string } = { mergeConfigurations: "mergeConfigurations", dotConfig: "dotConfig", dotConfigInvalid: "dotConfigInvalid", + recursiveIncludesReduce: "recursiveIncludes.reduce", + recursiveIncludesPriority: "recursiveIncludes.priority", // Browse properties browsePath: "browsePath", @@ -103,6 +105,7 @@ class SettingsApp { // Special case for checkbox elements document.getElementById(elementId.limitSymbolsToIncludedHeaders)?.addEventListener("change", this.onChangedCheckbox.bind(this, elementId.limitSymbolsToIncludedHeaders)); document.getElementById(elementId.mergeConfigurations)?.addEventListener("change", this.onChangedCheckbox.bind(this, elementId.mergeConfigurations)); + document.getElementById(elementId.recursiveIncludesReduce)?.addEventListener("change", this.onChangedCheckbox.bind(this, elementId.recursiveIncludesReduce)); } private addEventsToConfigNameChanges(): void { @@ -300,6 +303,10 @@ class SettingsApp { (document.getElementById(elementId.configurationProvider)).value = config.configurationProvider ? config.configurationProvider : ""; (document.getElementById(elementId.forcedInclude)).value = joinEntries(config.forcedInclude); (document.getElementById(elementId.dotConfig)).value = config.dotConfig ? config.dotConfig : ""; + if (config.recursiveIncludes) { + (document.getElementById(elementId.recursiveIncludesReduce)).checked = config.recursiveIncludes.reduce; + (document.getElementById(elementId.recursiveIncludesPriority)).value = config.recursiveIncludes.priority; + } if (config.browse) { (document.getElementById(elementId.browsePath)).value = joinEntries(config.browse.path); From d6b7eef22ed7c51d80a449499e868b8ff2a20c6a Mon Sep 17 00:00:00 2001 From: Colen Garoutte-Carson Date: Fri, 14 Mar 2025 11:28:32 -0700 Subject: [PATCH 04/10] Update a setting description --- Extension/package.nls.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 7dd97694b..8abce93e1 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -682,7 +682,7 @@ ] }, "c_cpp.configuration.default.mergeConfigurations.markdownDescription": { - "message": "The value to use in a configuration if `mergeConfigurations` is not specified, or the value to insert if `${default}` is present in `mergeConfigurations`.", + "message": "The value to use in a configuration if `mergeConfigurations` is either not specified or set to `${default}`.", "comment": [ "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered." ] From 99bd55c1db4d11d5439de6566322df1d0fc0cd85 Mon Sep 17 00:00:00 2001 From: Colen Garoutte-Carson Date: Fri, 14 Mar 2025 18:04:32 -0700 Subject: [PATCH 05/10] Add 'order' setting (depthFirst|breadthFirst) --- Extension/c_cpp_properties.schema.json | 9 +++++++++ Extension/package.json | 12 +++++++++++- Extension/package.nls.json | 6 ++++++ Extension/src/LanguageServer/configurations.ts | 2 ++ Extension/src/LanguageServer/settings.ts | 1 + Extension/src/LanguageServer/settingsPanel.ts | 7 +++++++ Extension/ui/settings.html | 14 ++++++++++++++ Extension/ui/settings.ts | 2 ++ 8 files changed, 52 insertions(+), 1 deletion(-) diff --git a/Extension/c_cpp_properties.schema.json b/Extension/c_cpp_properties.schema.json index 62874782d..c9a4ba814 100644 --- a/Extension/c_cpp_properties.schema.json +++ b/Extension/c_cpp_properties.schema.json @@ -231,6 +231,15 @@ "afterSystemIncludes", "${default}" ] + }, + "order": { + "markdownDescription": "The order in which subdirectories of recursive includes are searched.", + "type": "string", + "enum": [ + "depthFirst", + "breadthFirst", + "${default}" + ] } }, "additionalProperties": false diff --git a/Extension/package.json b/Extension/package.json index b4fec5ffd..6fd744623 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -899,7 +899,7 @@ }, "C_Cpp.default.recursiveIncludes.reduce": { "type": "boolean", - "default": true, + "default": false, "markdownDescription": "%c_cpp.configuration.default.recursiveIncludes.reduce.markdownDescription%", "scope": "resource" }, @@ -913,6 +913,16 @@ "markdownDescription": "%c_cpp.configuration.default.recursiveIncludes.priority.markdownDescription%", "scope": "resource" }, + "C_Cpp.default.recursiveIncludes.order": { + "type": "string", + "enum": [ + "depthFirst", + "breadthFirst" + ], + "default": "depthFirst", + "markdownDescription": "%c_cpp.configuration.default.recursiveIncludes.order.markdownDescription%", + "scope": "resource" + }, "C_Cpp.configurationWarnings": { "type": "string", "enum": [ diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 8abce93e1..cf208262e 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -747,6 +747,12 @@ "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered." ] }, + "c_cpp.configuration.default.recursiveIncludes.order.markdownDescription": { + "message": "The value to use in a configuration if `recursiveIncludes.order` is not specified, or the value to insert if `${default}` is present in `recursiveIncludes.order`.", + "comment": [ + "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered." + ] + }, "c_cpp.configuration.updateChannel.deprecationMessage": "This setting is deprecated. Pre-release extensions are now available via the Marketplace.", "c_cpp.configuration.experimentalFeatures.description": "Controls whether \"experimental\" features are usable.", "c_cpp.configuration.suggestSnippets.markdownDescription": { diff --git a/Extension/src/LanguageServer/configurations.ts b/Extension/src/LanguageServer/configurations.ts index 4e24cc26d..bb6db77bf 100644 --- a/Extension/src/LanguageServer/configurations.ts +++ b/Extension/src/LanguageServer/configurations.ts @@ -111,6 +111,7 @@ export interface Browse { export interface RecursiveIncludes { reduce?: boolean | string; priority?: string; + order?: string; } export interface KnownCompiler { @@ -938,6 +939,7 @@ export class CppProperties { if (configuration.recursiveIncludes) { configuration.recursiveIncludes.reduce = this.updateConfigurationBoolean(configuration.recursiveIncludes.reduce, settings.defaultRecursiveIncludesReduce); configuration.recursiveIncludes.priority = this.updateConfigurationString(configuration.recursiveIncludes.priority, settings.defaultRecursiveIncludesPriority); + configuration.recursiveIncludes.order = this.updateConfigurationString(configuration.recursiveIncludes.order, settings.defaultRecursiveIncludesOrder); } if (!configuration.compileCommands) { // compile_commands.json already specifies a compiler. compilerPath overrides the compile_commands.json compiler so diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index 16855e0c1..3654f2e30 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -447,6 +447,7 @@ export class CppSettings extends Settings { public get defaultLimitSymbolsToIncludedHeaders(): boolean { return this.getAsBoolean("default.browse.limitSymbolsToIncludedHeaders"); } public get defaultRecursiveIncludesReduce(): boolean { return this.getAsBoolean("default.recursiveIncludes.reduce"); } public get defaultRecursiveIncludesPriority(): string { return this.getAsString("default.recursiveIncludes.priority"); } + public get defaultRecursiveIncludesOrder(): string { return this.getAsString("default.recursiveIncludes.order"); } public get defaultSystemIncludePath(): string[] | undefined { return this.getArrayOfStringsWithUndefinedDefault("default.systemIncludePath"); } public get defaultEnableConfigurationSquiggles(): boolean { return this.getAsBoolean("default.enableConfigurationSquiggles"); } public get defaultCustomConfigurationVariables(): Associations | undefined { return this.getAsAssociations("default.customConfigurationVariables", true) ?? undefined; } diff --git a/Extension/src/LanguageServer/settingsPanel.ts b/Extension/src/LanguageServer/settingsPanel.ts index 12d41293c..6352e428f 100644 --- a/Extension/src/LanguageServer/settingsPanel.ts +++ b/Extension/src/LanguageServer/settingsPanel.ts @@ -54,6 +54,7 @@ const elementId: { [key: string]: string } = { forcedInclude: "forcedInclude", recursiveIncludesReduce: "recursiveIncludes.reduce", recursiveIncludesPriority: "recursiveIncludes.priority", + recursiveIncludesOrder: "recursiveIncludes.order", // Browse properties browsePath: "browsePath", @@ -365,6 +366,12 @@ export class SettingsPanel { } this.configValues.recursiveIncludes.priority = message.value; break; + case elementId.recursiveIncludesOrder: + if (!this.configValues.recursiveIncludes) { + this.configValues.recursiveIncludes = {}; + } + this.configValues.recursiveIncludes.order = message.value; + break; case elementId.browsePath: if (!this.configValues.browse) { this.configValues.browse = {}; diff --git a/Extension/ui/settings.html b/Extension/ui/settings.html index fd48501d9..5e346ccec 100644 --- a/Extension/ui/settings.html +++ b/Extension/ui/settings.html @@ -743,6 +743,20 @@ +
+
Recursive includes: priority
+
+ The order in which subdirectories under recursive include paths are searched. +
+
+ +
+
+ diff --git a/Extension/ui/settings.ts b/Extension/ui/settings.ts index c9bb48a7b..d28f2d3da 100644 --- a/Extension/ui/settings.ts +++ b/Extension/ui/settings.ts @@ -44,6 +44,7 @@ const elementId: { [key: string]: string } = { dotConfigInvalid: "dotConfigInvalid", recursiveIncludesReduce: "recursiveIncludes.reduce", recursiveIncludesPriority: "recursiveIncludes.priority", + recursiveIncludesOrder: "recursiveIncludes.order", // Browse properties browsePath: "browsePath", @@ -306,6 +307,7 @@ class SettingsApp { if (config.recursiveIncludes) { (document.getElementById(elementId.recursiveIncludesReduce)).checked = config.recursiveIncludes.reduce; (document.getElementById(elementId.recursiveIncludesPriority)).value = config.recursiveIncludes.priority; + (document.getElementById(elementId.recursiveIncludesOrder)).value = config.recursiveIncludes.order; } if (config.browse) { From 62f6213dfe61ea775ba43bb64982962a16a91439 Mon Sep 17 00:00:00 2001 From: Colen Garoutte-Carson Date: Mon, 17 Mar 2025 12:51:18 -0700 Subject: [PATCH 06/10] Add requireHeaders config field --- Extension/c_cpp_properties.schema.json | 8 ++++++++ Extension/package.json | 6 ++++++ Extension/package.nls.json | 14 ++++++++++---- Extension/src/LanguageServer/configurations.ts | 11 +++++++---- Extension/src/LanguageServer/settings.ts | 1 + Extension/src/LanguageServer/settingsPanel.ts | 7 +++++++ Extension/ui/settings.html | 7 +++++++ Extension/ui/settings.ts | 3 +++ 8 files changed, 49 insertions(+), 8 deletions(-) diff --git a/Extension/c_cpp_properties.schema.json b/Extension/c_cpp_properties.schema.json index c9a4ba814..dcbb59f3f 100644 --- a/Extension/c_cpp_properties.schema.json +++ b/Extension/c_cpp_properties.schema.json @@ -214,6 +214,14 @@ "recursiveIncludes": { "type": "object", "properties": { + "requireHeaders": { + "markdownDescription": "Set to `true` to filter expanded recursive include directories to only those currently containing any headers. Set to `false` to provide all recursive include paths to IntelliSense. Excluding recursive include directories that do not contain headers may improve IntelliSense performance when a very large number of recursive include paths are involved. However, performance may be impacted when headers are added or removed from directories, requiring re-expansion of the recursive include directories.", + "descriptionHint": "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered.", + "type": [ + "boolean", + "string" + ] + }, "reduce": { "markdownDescription": "Set to `true` to reduce the number of recursive include paths provided to IntelliSense to only those paths currently referenced by #include statements. This requires first parsing files to determine which files are included. Set to `false` to provide all recursive include paths to IntelliSense. Reducing the number of recursive include paths may improve IntelliSense performance when a very large number of recursive include paths are involved. Not reducing the number of recursive include paths can improve IntelliSense performance by avoiding the need to parse files to determine which include paths to provide.", "descriptionHint": "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered.", diff --git a/Extension/package.json b/Extension/package.json index 3ce3a1c96..e011ad2fd 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -897,6 +897,12 @@ "markdownDescription": "%c_cpp.configuration.default.dotConfig.markdownDescription%", "scope": "resource" }, + "C_Cpp.default.recursiveIncludes.requireHeaders": { + "type": "boolean", + "default": true, + "markdownDescription": "%c_cpp.configuration.default.recursiveIncludes.requireHeaders.markdownDescription%", + "scope": "resource" + }, "C_Cpp.default.recursiveIncludes.reduce": { "type": "boolean", "default": false, diff --git a/Extension/package.nls.json b/Extension/package.nls.json index cf208262e..3119379f7 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -730,25 +730,31 @@ ] }, "c_cpp.configuration.default.dotConfig.markdownDescription": { - "message": "The value to use in a configuration if `dotConfig` is not specified, or the value to insert if `${default}` is present in `dotConfig`.", + "message": "The value to use in a configuration if `dotConfig` is either not specified or set to `${default}`.", + "comment": [ + "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered." + ] + }, + "c_cpp.configuration.default.recursiveIncludes.requireHeaders.markdownDescription": { + "message": "The value to use in a configuration if `recursiveIncludes.requireHeaders` is either not specified or set to `${default}`.", "comment": [ "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered." ] }, "c_cpp.configuration.default.recursiveIncludes.reduce.markdownDescription": { - "message": "The value to use in a configuration if `recursiveIncludes.reduce` is not specified, or the value to insert if `${default}` is present in `recursiveIncludes.reduce`.", + "message": "The value to use in a configuration if `recursiveIncludes.reduce` is either not specified or set to `${default}`.", "comment": [ "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered." ] }, "c_cpp.configuration.default.recursiveIncludes.priority.markdownDescription": { - "message": "The value to use in a configuration if `recursiveIncludes.priority` is not specified, or the value to insert if `${default}` is present in `recursiveIncludes.priority`.", + "message": "The value to use in a configuration if `recursiveIncludes.priority` is either not specified or set to `${default}`.", "comment": [ "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered." ] }, "c_cpp.configuration.default.recursiveIncludes.order.markdownDescription": { - "message": "The value to use in a configuration if `recursiveIncludes.order` is not specified, or the value to insert if `${default}` is present in `recursiveIncludes.order`.", + "message": "The value to use in a configuration if `recursiveIncludes.order` is either not specified or set to `${default}`.", "comment": [ "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered." ] diff --git a/Extension/src/LanguageServer/configurations.ts b/Extension/src/LanguageServer/configurations.ts index bb6db77bf..f62dfa2d4 100644 --- a/Extension/src/LanguageServer/configurations.ts +++ b/Extension/src/LanguageServer/configurations.ts @@ -109,6 +109,7 @@ export interface Browse { } export interface RecursiveIncludes { + requireHeaders?: boolean | string; reduce?: boolean | string; priority?: string; order?: string; @@ -936,11 +937,13 @@ export class CppProperties { configuration.cStandardIsExplicit = configuration.cStandardIsExplicit || settings.defaultCStandard !== ""; configuration.cppStandardIsExplicit = configuration.cppStandardIsExplicit || settings.defaultCppStandard !== ""; configuration.mergeConfigurations = this.updateConfigurationBoolean(configuration.mergeConfigurations, settings.defaultMergeConfigurations); - if (configuration.recursiveIncludes) { - configuration.recursiveIncludes.reduce = this.updateConfigurationBoolean(configuration.recursiveIncludes.reduce, settings.defaultRecursiveIncludesReduce); - configuration.recursiveIncludes.priority = this.updateConfigurationString(configuration.recursiveIncludes.priority, settings.defaultRecursiveIncludesPriority); - configuration.recursiveIncludes.order = this.updateConfigurationString(configuration.recursiveIncludes.order, settings.defaultRecursiveIncludesOrder); + if (!configuration.recursiveIncludes) { + configuration.recursiveIncludes = {}; } + configuration.recursiveIncludes.requireHeaders = this.updateConfigurationBoolean(configuration.recursiveIncludes.requireHeaders, settings.defaultRecursiveIncludesRequireHeaders); + configuration.recursiveIncludes.reduce = this.updateConfigurationBoolean(configuration.recursiveIncludes.reduce, settings.defaultRecursiveIncludesReduce); + configuration.recursiveIncludes.priority = this.updateConfigurationString(configuration.recursiveIncludes.priority, settings.defaultRecursiveIncludesPriority); + configuration.recursiveIncludes.order = this.updateConfigurationString(configuration.recursiveIncludes.order, settings.defaultRecursiveIncludesOrder); if (!configuration.compileCommands) { // compile_commands.json already specifies a compiler. compilerPath overrides the compile_commands.json compiler so // don't set a default when compileCommands is in use. diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index 3654f2e30..74afa5404 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -445,6 +445,7 @@ export class CppSettings extends Settings { public get defaultBrowsePath(): string[] | undefined { return this.getArrayOfStringsWithUndefinedDefault("default.browse.path"); } public get defaultDatabaseFilename(): string | undefined { return changeBlankStringToUndefined(this.getAsStringOrUndefined("default.browse.databaseFilename")); } public get defaultLimitSymbolsToIncludedHeaders(): boolean { return this.getAsBoolean("default.browse.limitSymbolsToIncludedHeaders"); } + public get defaultRecursiveIncludesRequireHeaders(): boolean { return this.getAsBoolean("default.recursiveIncludes.requireHeaders"); } public get defaultRecursiveIncludesReduce(): boolean { return this.getAsBoolean("default.recursiveIncludes.reduce"); } public get defaultRecursiveIncludesPriority(): string { return this.getAsString("default.recursiveIncludes.priority"); } public get defaultRecursiveIncludesOrder(): string { return this.getAsString("default.recursiveIncludes.order"); } diff --git a/Extension/src/LanguageServer/settingsPanel.ts b/Extension/src/LanguageServer/settingsPanel.ts index 6352e428f..afde30ddf 100644 --- a/Extension/src/LanguageServer/settingsPanel.ts +++ b/Extension/src/LanguageServer/settingsPanel.ts @@ -52,6 +52,7 @@ const elementId: { [key: string]: string } = { mergeConfigurations: "mergeConfigurations", configurationProvider: "configurationProvider", forcedInclude: "forcedInclude", + recursiveIncludesRequireHeaders: "recursiveIncludes.requireHeaders", recursiveIncludesReduce: "recursiveIncludes.reduce", recursiveIncludesPriority: "recursiveIncludes.priority", recursiveIncludesOrder: "recursiveIncludes.order", @@ -354,6 +355,12 @@ export class SettingsPanel { case elementId.forcedInclude: this.configValues.forcedInclude = splitEntries(message.value); break; + case elementId.recursiveIncludesRequireHeaders: + if (!this.configValues.recursiveIncludes) { + this.configValues.recursiveIncludes = {}; + } + this.configValues.recursiveIncludes.requireHeaders = message.value; + break; case elementId.recursiveIncludesReduce: if (!this.configValues.recursiveIncludes) { this.configValues.recursiveIncludes = {}; diff --git a/Extension/ui/settings.html b/Extension/ui/settings.html index 5e346ccec..128120910 100644 --- a/Extension/ui/settings.html +++ b/Extension/ui/settings.html @@ -722,6 +722,13 @@ +
+
Recursive includes: require headers
+ + Set to true (or checked) to filter expanded recursive include directories to only those currently containing any headers. Set to false (or unchecked) to provide all recursive include paths to IntelliSense. Excluding recursive include directories that do not contain headers may improve IntelliSense performance when a very large number of recursive include paths are involved. However, performance may be impacted when headers are added or removed from directories, requiring re-expansion of the recursive include directories. + +
+
Recursive includes: reduce
diff --git a/Extension/ui/settings.ts b/Extension/ui/settings.ts index d28f2d3da..d9a132997 100644 --- a/Extension/ui/settings.ts +++ b/Extension/ui/settings.ts @@ -42,6 +42,7 @@ const elementId: { [key: string]: string } = { mergeConfigurations: "mergeConfigurations", dotConfig: "dotConfig", dotConfigInvalid: "dotConfigInvalid", + recursiveIncludesRequireHeaders: "recursiveIncludes.requireHeaders", recursiveIncludesReduce: "recursiveIncludes.reduce", recursiveIncludesPriority: "recursiveIncludes.priority", recursiveIncludesOrder: "recursiveIncludes.order", @@ -106,6 +107,7 @@ class SettingsApp { // Special case for checkbox elements document.getElementById(elementId.limitSymbolsToIncludedHeaders)?.addEventListener("change", this.onChangedCheckbox.bind(this, elementId.limitSymbolsToIncludedHeaders)); document.getElementById(elementId.mergeConfigurations)?.addEventListener("change", this.onChangedCheckbox.bind(this, elementId.mergeConfigurations)); + document.getElementById(elementId.recursiveIncludesRequireHeaders)?.addEventListener("change", this.onChangedCheckbox.bind(this, elementId.recursiveIncludesRequireHeaders)); document.getElementById(elementId.recursiveIncludesReduce)?.addEventListener("change", this.onChangedCheckbox.bind(this, elementId.recursiveIncludesReduce)); } @@ -305,6 +307,7 @@ class SettingsApp { (document.getElementById(elementId.forcedInclude)).value = joinEntries(config.forcedInclude); (document.getElementById(elementId.dotConfig)).value = config.dotConfig ? config.dotConfig : ""; if (config.recursiveIncludes) { + (document.getElementById(elementId.recursiveIncludesRequireHeaders)).checked = config.recursiveIncludes.requireHeaders; (document.getElementById(elementId.recursiveIncludesReduce)).checked = config.recursiveIncludes.reduce; (document.getElementById(elementId.recursiveIncludesPriority)).value = config.recursiveIncludes.priority; (document.getElementById(elementId.recursiveIncludesOrder)).value = config.recursiveIncludes.order; From 45fd8bcb4fa3d94edcd94178ec0cc64f76ab3906 Mon Sep 17 00:00:00 2001 From: Colen Garoutte-Carson Date: Mon, 17 Mar 2025 16:34:03 -0700 Subject: [PATCH 07/10] Remove 'requiredHeader', and change 'reduce' to be an enum type, to support future auto-reduce optimization --- Extension/c_cpp_properties.schema.json | 19 ++++++-------- Extension/package.json | 15 ++++++----- Extension/package.nls.json | 6 ----- .../src/LanguageServer/configurations.ts | 6 ++--- Extension/src/LanguageServer/settings.ts | 3 +-- Extension/src/LanguageServer/settingsPanel.ts | 7 ------ Extension/ui/settings.html | 25 ++++++++++--------- Extension/ui/settings.ts | 6 +---- 8 files changed, 31 insertions(+), 56 deletions(-) diff --git a/Extension/c_cpp_properties.schema.json b/Extension/c_cpp_properties.schema.json index dcbb59f3f..ca4627080 100644 --- a/Extension/c_cpp_properties.schema.json +++ b/Extension/c_cpp_properties.schema.json @@ -214,20 +214,15 @@ "recursiveIncludes": { "type": "object", "properties": { - "requireHeaders": { - "markdownDescription": "Set to `true` to filter expanded recursive include directories to only those currently containing any headers. Set to `false` to provide all recursive include paths to IntelliSense. Excluding recursive include directories that do not contain headers may improve IntelliSense performance when a very large number of recursive include paths are involved. However, performance may be impacted when headers are added or removed from directories, requiring re-expansion of the recursive include directories.", - "descriptionHint": "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered.", - "type": [ - "boolean", - "string" - ] - }, "reduce": { - "markdownDescription": "Set to `true` to reduce the number of recursive include paths provided to IntelliSense to only those paths currently referenced by #include statements. This requires first parsing files to determine which files are included. Set to `false` to provide all recursive include paths to IntelliSense. Reducing the number of recursive include paths may improve IntelliSense performance when a very large number of recursive include paths are involved. Not reducing the number of recursive include paths can improve IntelliSense performance by avoiding the need to parse files to determine which include paths to provide.", + "markdownDescription": "Set to `always` to always reduce the number of recursive include paths provided to IntelliSense to only those paths currently referenced by #include statements. This requires first parsing files to determine which files are included. Set to `never` to provide all recursive include paths to IntelliSense. Reducing the number of recursive include paths may improve IntelliSense performance when a very large number of recursive include paths are involved. Not reducing the number of recursive include paths can improve IntelliSense performance by avoiding the need to parse files to determine which include paths to provide.", "descriptionHint": "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered.", - "type": [ - "boolean", - "string" + "type": "string", + "enum": [ + "always", + "never", + "default", + "${default}" ] }, "priority": { diff --git a/Extension/package.json b/Extension/package.json index 450d0aa75..4053d434d 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -897,15 +897,14 @@ "markdownDescription": "%c_cpp.configuration.default.dotConfig.markdownDescription%", "scope": "resource" }, - "C_Cpp.default.recursiveIncludes.requireHeaders": { - "type": "boolean", - "default": true, - "markdownDescription": "%c_cpp.configuration.default.recursiveIncludes.requireHeaders.markdownDescription%", - "scope": "resource" - }, "C_Cpp.default.recursiveIncludes.reduce": { - "type": "boolean", - "default": false, + "type": "string", + "enum": [ + "always", + "never", + "default" + ], + "default": "default", "markdownDescription": "%c_cpp.configuration.default.recursiveIncludes.reduce.markdownDescription%", "scope": "resource" }, diff --git a/Extension/package.nls.json b/Extension/package.nls.json index db4dff484..3b6f29cb6 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -729,12 +729,6 @@ "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered." ] }, - "c_cpp.configuration.default.recursiveIncludes.requireHeaders.markdownDescription": { - "message": "The value to use in a configuration if `recursiveIncludes.requireHeaders` is either not specified or set to `${default}`.", - "comment": [ - "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered." - ] - }, "c_cpp.configuration.default.recursiveIncludes.reduce.markdownDescription": { "message": "The value to use in a configuration if `recursiveIncludes.reduce` is either not specified or set to `${default}`.", "comment": [ diff --git a/Extension/src/LanguageServer/configurations.ts b/Extension/src/LanguageServer/configurations.ts index f62dfa2d4..ccd7723f9 100644 --- a/Extension/src/LanguageServer/configurations.ts +++ b/Extension/src/LanguageServer/configurations.ts @@ -109,8 +109,7 @@ export interface Browse { } export interface RecursiveIncludes { - requireHeaders?: boolean | string; - reduce?: boolean | string; + reduce?: string; priority?: string; order?: string; } @@ -940,8 +939,7 @@ export class CppProperties { if (!configuration.recursiveIncludes) { configuration.recursiveIncludes = {}; } - configuration.recursiveIncludes.requireHeaders = this.updateConfigurationBoolean(configuration.recursiveIncludes.requireHeaders, settings.defaultRecursiveIncludesRequireHeaders); - configuration.recursiveIncludes.reduce = this.updateConfigurationBoolean(configuration.recursiveIncludes.reduce, settings.defaultRecursiveIncludesReduce); + configuration.recursiveIncludes.reduce = this.updateConfigurationString(configuration.recursiveIncludes.reduce, settings.defaultRecursiveIncludesReduce); configuration.recursiveIncludes.priority = this.updateConfigurationString(configuration.recursiveIncludes.priority, settings.defaultRecursiveIncludesPriority); configuration.recursiveIncludes.order = this.updateConfigurationString(configuration.recursiveIncludes.order, settings.defaultRecursiveIncludesOrder); if (!configuration.compileCommands) { diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index ac3f2b086..fb8b3c458 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -444,8 +444,7 @@ export class CppSettings extends Settings { public get defaultBrowsePath(): string[] | undefined { return this.getArrayOfStringsWithUndefinedDefault("default.browse.path"); } public get defaultDatabaseFilename(): string | undefined { return changeBlankStringToUndefined(this.getAsStringOrUndefined("default.browse.databaseFilename")); } public get defaultLimitSymbolsToIncludedHeaders(): boolean { return this.getAsBoolean("default.browse.limitSymbolsToIncludedHeaders"); } - public get defaultRecursiveIncludesRequireHeaders(): boolean { return this.getAsBoolean("default.recursiveIncludes.requireHeaders"); } - public get defaultRecursiveIncludesReduce(): boolean { return this.getAsBoolean("default.recursiveIncludes.reduce"); } + public get defaultRecursiveIncludesReduce(): string { return this.getAsString("default.recursiveIncludes.reduce"); } public get defaultRecursiveIncludesPriority(): string { return this.getAsString("default.recursiveIncludes.priority"); } public get defaultRecursiveIncludesOrder(): string { return this.getAsString("default.recursiveIncludes.order"); } public get defaultSystemIncludePath(): string[] | undefined { return this.getArrayOfStringsWithUndefinedDefault("default.systemIncludePath"); } diff --git a/Extension/src/LanguageServer/settingsPanel.ts b/Extension/src/LanguageServer/settingsPanel.ts index afde30ddf..6352e428f 100644 --- a/Extension/src/LanguageServer/settingsPanel.ts +++ b/Extension/src/LanguageServer/settingsPanel.ts @@ -52,7 +52,6 @@ const elementId: { [key: string]: string } = { mergeConfigurations: "mergeConfigurations", configurationProvider: "configurationProvider", forcedInclude: "forcedInclude", - recursiveIncludesRequireHeaders: "recursiveIncludes.requireHeaders", recursiveIncludesReduce: "recursiveIncludes.reduce", recursiveIncludesPriority: "recursiveIncludes.priority", recursiveIncludesOrder: "recursiveIncludes.order", @@ -355,12 +354,6 @@ export class SettingsPanel { case elementId.forcedInclude: this.configValues.forcedInclude = splitEntries(message.value); break; - case elementId.recursiveIncludesRequireHeaders: - if (!this.configValues.recursiveIncludes) { - this.configValues.recursiveIncludes = {}; - } - this.configValues.recursiveIncludes.requireHeaders = message.value; - break; case elementId.recursiveIncludesReduce: if (!this.configValues.recursiveIncludes) { this.configValues.recursiveIncludes = {}; diff --git a/Extension/ui/settings.html b/Extension/ui/settings.html index 128120910..86a8a239e 100644 --- a/Extension/ui/settings.html +++ b/Extension/ui/settings.html @@ -721,19 +721,20 @@
- +1
-
Recursive includes: require headers
- - Set to true (or checked) to filter expanded recursive include directories to only those currently containing any headers. Set to false (or unchecked) to provide all recursive include paths to IntelliSense. Excluding recursive include directories that do not contain headers may improve IntelliSense performance when a very large number of recursive include paths are involved. However, performance may be impacted when headers are added or removed from directories, requiring re-expansion of the recursive include directories. - -
- -
-
Recursive includes: reduce
- - Set to true (or checked) to reduce the number of recursive include paths provided to IntelliSense to only those paths currently referenced by #include statements. This requires first parsing files to determine which files are included. Set to false (or unchecked) to provide all recursive include paths to IntelliSense. Reducing the number of recursive include paths may improve IntelliSense performance when a very large number of recursive include paths are involved. Not reducing the number of recursive include paths can improve IntelliSense performance by avoiding the need to parse files to determine which include paths to provide. - +
Recursive includes: priority
+
+ Set to always to reduce the number of recursive include paths provided to IntelliSense to only those paths currently referenced by #include statements. This requires first parsing files to determine which files are included. Set to never to provide all recursive include paths to IntelliSense. Reducing the number of recursive include paths may improve IntelliSense performance when a very large number of recursive include paths are involved. Not reducing the number of recursive include paths can improve IntelliSense performance by avoiding the need to parse files to determine which include paths to provide. +
+
+ +
diff --git a/Extension/ui/settings.ts b/Extension/ui/settings.ts index d9a132997..ce5a23ab2 100644 --- a/Extension/ui/settings.ts +++ b/Extension/ui/settings.ts @@ -42,7 +42,6 @@ const elementId: { [key: string]: string } = { mergeConfigurations: "mergeConfigurations", dotConfig: "dotConfig", dotConfigInvalid: "dotConfigInvalid", - recursiveIncludesRequireHeaders: "recursiveIncludes.requireHeaders", recursiveIncludesReduce: "recursiveIncludes.reduce", recursiveIncludesPriority: "recursiveIncludes.priority", recursiveIncludesOrder: "recursiveIncludes.order", @@ -107,8 +106,6 @@ class SettingsApp { // Special case for checkbox elements document.getElementById(elementId.limitSymbolsToIncludedHeaders)?.addEventListener("change", this.onChangedCheckbox.bind(this, elementId.limitSymbolsToIncludedHeaders)); document.getElementById(elementId.mergeConfigurations)?.addEventListener("change", this.onChangedCheckbox.bind(this, elementId.mergeConfigurations)); - document.getElementById(elementId.recursiveIncludesRequireHeaders)?.addEventListener("change", this.onChangedCheckbox.bind(this, elementId.recursiveIncludesRequireHeaders)); - document.getElementById(elementId.recursiveIncludesReduce)?.addEventListener("change", this.onChangedCheckbox.bind(this, elementId.recursiveIncludesReduce)); } private addEventsToConfigNameChanges(): void { @@ -307,8 +304,7 @@ class SettingsApp { (document.getElementById(elementId.forcedInclude)).value = joinEntries(config.forcedInclude); (document.getElementById(elementId.dotConfig)).value = config.dotConfig ? config.dotConfig : ""; if (config.recursiveIncludes) { - (document.getElementById(elementId.recursiveIncludesRequireHeaders)).checked = config.recursiveIncludes.requireHeaders; - (document.getElementById(elementId.recursiveIncludesReduce)).checked = config.recursiveIncludes.reduce; + (document.getElementById(elementId.recursiveIncludesReduce)).value = config.recursiveIncludes.reduce; (document.getElementById(elementId.recursiveIncludesPriority)).value = config.recursiveIncludes.priority; (document.getElementById(elementId.recursiveIncludesOrder)).value = config.recursiveIncludes.order; } From 28ec9e63692e3d02f96d31a5c9943de8c2539384 Mon Sep 17 00:00:00 2001 From: Colen Garoutte-Carson Date: Tue, 18 Mar 2025 16:35:40 -0700 Subject: [PATCH 08/10] Address PR feedback --- Extension/c_cpp_properties.schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extension/c_cpp_properties.schema.json b/Extension/c_cpp_properties.schema.json index ca4627080..1589ce107 100644 --- a/Extension/c_cpp_properties.schema.json +++ b/Extension/c_cpp_properties.schema.json @@ -226,7 +226,7 @@ ] }, "priority": { - "markdownDescription": "The priority of recursive include paths. If set to `beforeSystemIncludes`, the recursive include paths will be searched before system include paths. If set to `afterSystemIncludes`, the recursive include paths will be searched after system include paths.", + "markdownDescription": "The priority of recursive include paths. If set to `beforeSystemIncludes`, the recursive include paths will be searched before system include paths. If set to `afterSystemIncludes`, the recursive include paths will be searched after system include paths. `beforeSystemIncludes` would more closely reflect the search order of a compiler, while `afterSystemIncludes` may result in improved performance.", "descriptionHint": "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered.", "type": "string", "enum": [ From 465dd67ed7292c8e524268c16bebbd361b2ff2f2 Mon Sep 17 00:00:00 2001 From: Colen Garoutte-Carson Date: Tue, 18 Mar 2025 16:38:34 -0700 Subject: [PATCH 09/10] Address PR feedback --- Extension/c_cpp_properties.schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extension/c_cpp_properties.schema.json b/Extension/c_cpp_properties.schema.json index 1589ce107..939cb8a34 100644 --- a/Extension/c_cpp_properties.schema.json +++ b/Extension/c_cpp_properties.schema.json @@ -215,7 +215,7 @@ "type": "object", "properties": { "reduce": { - "markdownDescription": "Set to `always` to always reduce the number of recursive include paths provided to IntelliSense to only those paths currently referenced by #include statements. This requires first parsing files to determine which files are included. Set to `never` to provide all recursive include paths to IntelliSense. Reducing the number of recursive include paths may improve IntelliSense performance when a very large number of recursive include paths are involved. Not reducing the number of recursive include paths can improve IntelliSense performance by avoiding the need to parse files to determine which include paths to provide.", + "markdownDescription": "Set to `always` to always reduce the number of recursive include paths provided to IntelliSense to only those paths currently referenced by #include statements. This requires first parsing files to determine which headers are included. Set to `never` to provide all recursive include paths to IntelliSense. Reducing the number of recursive include paths may improve IntelliSense performance when a very large number of recursive include paths are involved. Not reducing the number of recursive include paths can improve IntelliSense performance by avoiding the need to parse files to determine which include paths to provide. The `default` value is currently to reduce the number of recursive include paths provided to IntelliSense.", "descriptionHint": "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered.", "type": "string", "enum": [ From a02062ea26da764040abc8c2c139ad69897fae28 Mon Sep 17 00:00:00 2001 From: Colen Garoutte-Carson Date: Fri, 21 Mar 2025 11:38:34 -0700 Subject: [PATCH 10/10] Address PR feedback --- Extension/package.nls.json | 1 - Extension/ui/settings.html | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 3b6f29cb6..6d9d9d2b5 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -747,7 +747,6 @@ "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered." ] }, - "c_cpp.configuration.updateChannel.deprecationMessage": "This setting is deprecated. Pre-release extensions are now available via the Marketplace.", "c_cpp.configuration.experimentalFeatures.description": "Controls whether \"experimental\" features are usable.", "c_cpp.configuration.suggestSnippets.markdownDescription": { "message": "If `true`, snippets are provided by the language server.", diff --git a/Extension/ui/settings.html b/Extension/ui/settings.html index 86a8a239e..a8deeb3c3 100644 --- a/Extension/ui/settings.html +++ b/Extension/ui/settings.html @@ -721,7 +721,7 @@
-1 +
Recursive includes: priority