@@ -61,6 +61,18 @@ class Settings {
6161 }
6262 return result ;
6363 }
64+
65+ protected getWithUndefinedDefault < T > ( section : string ) : T | undefined {
66+ const info : any = this . settings . inspect < T > ( section ) ;
67+ if ( info . workspaceFolderValue !== undefined ) {
68+ return info . workspaceFolderValue ;
69+ } else if ( info . workspaceValue !== undefined ) {
70+ return info . workspaceValue ;
71+ } else if ( info . globalValue !== undefined ) {
72+ return info . globalValue ;
73+ }
74+ return undefined ;
75+ }
6476}
6577
6678export class CppSettings extends Settings {
@@ -148,23 +160,23 @@ export class CppSettings extends Settings {
148160 public get addNodeAddonIncludePaths ( ) : boolean | undefined { return super . Section . get < boolean > ( "addNodeAddonIncludePaths" ) ; }
149161 public get renameRequiresIdentifier ( ) : boolean | undefined { return super . Section . get < boolean > ( "renameRequiresIdentifier" ) ; }
150162 public get filesExclude ( ) : vscode . WorkspaceConfiguration | undefined { return super . Section . get < vscode . WorkspaceConfiguration > ( "files.exclude" ) ; }
151- public get defaultIncludePath ( ) : string [ ] | undefined { return super . Section . get < string [ ] > ( "default.includePath" ) ; }
152- public get defaultDefines ( ) : string [ ] | undefined { return super . Section . get < string [ ] > ( "default.defines" ) ; }
153- public get defaultMacFrameworkPath ( ) : string [ ] | undefined { return super . Section . get < string [ ] > ( "default.macFrameworkPath" ) ; }
163+ public get defaultIncludePath ( ) : string [ ] | undefined { return super . getWithUndefinedDefault < string [ ] > ( "default.includePath" ) ; }
164+ public get defaultDefines ( ) : string [ ] | undefined { return super . getWithUndefinedDefault < string [ ] > ( "default.defines" ) ; }
165+ public get defaultMacFrameworkPath ( ) : string [ ] | undefined { return super . getWithUndefinedDefault < string [ ] > ( "default.macFrameworkPath" ) ; }
154166 public get defaultWindowsSdkVersion ( ) : string | undefined { return super . Section . get < string > ( "default.windowsSdkVersion" ) ; }
155167 public get defaultCompileCommands ( ) : string | undefined { return super . Section . get < string > ( "default.compileCommands" ) ; }
156- public get defaultForcedInclude ( ) : string [ ] | undefined { return super . Section . get < string [ ] > ( "default.forcedInclude" ) ; }
168+ public get defaultForcedInclude ( ) : string [ ] | undefined { return super . getWithUndefinedDefault < string [ ] > ( "default.forcedInclude" ) ; }
157169 public get defaultIntelliSenseMode ( ) : string | undefined { return super . Section . get < string > ( "default.intelliSenseMode" ) ; }
158170 public get defaultCompilerPath ( ) : string | undefined { return super . Section . get < string | null > ( "default.compilerPath" ) ?? undefined ; }
159- public get defaultCompilerArgs ( ) : string [ ] | undefined { return super . Section . get < string [ ] > ( "default.compilerArgs" ) ; }
171+ public get defaultCompilerArgs ( ) : string [ ] | undefined { return super . getWithUndefinedDefault < string [ ] > ( "default.compilerArgs" ) ; }
160172 public get defaultCStandard ( ) : string | undefined { return super . Section . get < string > ( "default.cStandard" ) ; }
161173 public get defaultCppStandard ( ) : string | undefined { return super . Section . get < string > ( "default.cppStandard" ) ; }
162174 public get defaultConfigurationProvider ( ) : string | undefined { return super . Section . get < string > ( "default.configurationProvider" ) ; }
163175 public get defaultMergeConfigurations ( ) : boolean | undefined { return super . Section . get < boolean > ( "default.mergeConfigurations" ) ; }
164- public get defaultBrowsePath ( ) : string [ ] | undefined { return super . Section . get < string [ ] | null > ( "default.browse.path" ) ?? undefined ; }
176+ public get defaultBrowsePath ( ) : string [ ] | undefined { return super . getWithUndefinedDefault < string [ ] | null > ( "default.browse.path" ) ?? undefined ; }
165177 public get defaultDatabaseFilename ( ) : string | undefined { return super . Section . get < string > ( "default.browse.databaseFilename" ) ; }
166178 public get defaultLimitSymbolsToIncludedHeaders ( ) : boolean | undefined { return super . Section . get < boolean > ( "default.browse.limitSymbolsToIncludedHeaders" ) ; }
167- public get defaultSystemIncludePath ( ) : string [ ] | undefined { return super . Section . get < string [ ] > ( "default.systemIncludePath" ) ; }
179+ public get defaultSystemIncludePath ( ) : string [ ] | undefined { return super . getWithUndefinedDefault < string [ ] > ( "default.systemIncludePath" ) ; }
168180 public get defaultEnableConfigurationSquiggles ( ) : boolean | undefined { return super . Section . get < boolean > ( "default.enableConfigurationSquiggles" ) ; }
169181 public get defaultCustomConfigurationVariables ( ) : { [ key : string ] : string } | undefined { return super . Section . get < { [ key : string ] : string } > ( "default.customConfigurationVariables" ) ; }
170182 public get useBacktickCommandSubstitution ( ) : boolean | undefined { return super . Section . get < boolean > ( "debugger.useBacktickCommandSubstitution" ) ; }
0 commit comments