From f603689dec37215359087d2a4096c1cefc29445d Mon Sep 17 00:00:00 2001 From: Colen Garoutte-Carson Date: Fri, 21 Feb 2025 18:46:08 -0800 Subject: [PATCH] Add `reduceRecursiveIncludes` setting --- Extension/package.json | 6 ++++++ Extension/package.nls.json | 1 + Extension/src/LanguageServer/client.ts | 1 + Extension/src/LanguageServer/settings.ts | 2 ++ 4 files changed, 10 insertions(+) diff --git a/Extension/package.json b/Extension/package.json index 3dc76870d..b4d0aa442 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -973,6 +973,12 @@ ] }, "scope": "resource" + }, + "C_Cpp.reduceRecursiveIncludes": { + "type": "boolean", + "default": true, + "markdownDescription": "%c_cpp.configuration.reduceRecursiveIncludes.markdownDescription%", + "scope": "window" } } }, diff --git a/Extension/package.nls.json b/Extension/package.nls.json index 67a3bcb3d..0f48c5151 100644 --- a/Extension/package.nls.json +++ b/Extension/package.nls.json @@ -809,6 +809,7 @@ "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.reduceRecursiveIncludes.markdownDescription": "Indicates whether recursive include paths should be reduced to only those currently referenced by the translation unit. If enabled, performance is impacted if the database needs to be populated to determine headers used. If disabled, performance may be impacted due to passing a large number of include paths to the IntelliSense process.", "c_cpp.configuration.debugger.useBacktickCommandSubstitution.markdownDescription": { "message": "If `true`, debugger shell command substitution will use obsolete backtick ``(`)``.", "comment": [ diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 786963fce..c65facc49 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -1574,6 +1574,7 @@ export class DefaultClient implements Client { enhancedColorization: workspaceSettings.isEnhancedColorizationEnabled, intellisenseMaxCachedProcesses: workspaceSettings.intelliSenseMaxCachedProcesses, intellisenseMaxMemory: workspaceSettings.intelliSenseMaxMemory, + reduceRecursiveIncludes: workspaceSettings.reduceRecursiveIncludes, referencesMaxConcurrentThreads: workspaceSettings.referencesMaxConcurrentThreads, referencesMaxCachedProcesses: workspaceSettings.referencesMaxCachedProcesses, referencesMaxMemory: workspaceSettings.referencesMaxMemory, diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index 9a164bda0..fec4d6d8d 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -156,6 +156,7 @@ export interface SettingsParams { enhancedColorization: boolean; intellisenseMaxCachedProcesses: number | null; intellisenseMaxMemory: number | null; + reduceRecursiveIncludes: boolean; referencesMaxConcurrentThreads: number | null; referencesMaxCachedProcesses: number | null; referencesMaxMemory: number | null; @@ -481,6 +482,7 @@ export class CppSettings extends Settings { return super.Section.get("cppCodeSnippetsFeatureNames"); } public get formattingEngine(): string { return this.getAsString("formatting"); } + public get reduceRecursiveIncludes(): boolean { return this.getAsBoolean("reduceRecursiveIncludes"); } public get vcFormatIndentBraces(): boolean { return this.getAsBoolean("vcFormat.indent.braces"); } public get vcFormatIndentMultiLineRelativeTo(): string { return this.getAsString("vcFormat.indent.multiLineRelativeTo"); } public get vcFormatIndentWithinParentheses(): string { return this.getAsString("vcFormat.indent.withinParentheses"); }