@@ -61,6 +61,18 @@ class Settings {
61
61
}
62
62
return result ;
63
63
}
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
+ }
64
76
}
65
77
66
78
export class CppSettings extends Settings {
@@ -148,23 +160,23 @@ export class CppSettings extends Settings {
148
160
public get addNodeAddonIncludePaths ( ) : boolean | undefined { return super . Section . get < boolean > ( "addNodeAddonIncludePaths" ) ; }
149
161
public get renameRequiresIdentifier ( ) : boolean | undefined { return super . Section . get < boolean > ( "renameRequiresIdentifier" ) ; }
150
162
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" ) ; }
154
166
public get defaultWindowsSdkVersion ( ) : string | undefined { return super . Section . get < string > ( "default.windowsSdkVersion" ) ; }
155
167
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" ) ; }
157
169
public get defaultIntelliSenseMode ( ) : string | undefined { return super . Section . get < string > ( "default.intelliSenseMode" ) ; }
158
170
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" ) ; }
160
172
public get defaultCStandard ( ) : string | undefined { return super . Section . get < string > ( "default.cStandard" ) ; }
161
173
public get defaultCppStandard ( ) : string | undefined { return super . Section . get < string > ( "default.cppStandard" ) ; }
162
174
public get defaultConfigurationProvider ( ) : string | undefined { return super . Section . get < string > ( "default.configurationProvider" ) ; }
163
175
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 ; }
165
177
public get defaultDatabaseFilename ( ) : string | undefined { return super . Section . get < string > ( "default.browse.databaseFilename" ) ; }
166
178
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" ) ; }
168
180
public get defaultEnableConfigurationSquiggles ( ) : boolean | undefined { return super . Section . get < boolean > ( "default.enableConfigurationSquiggles" ) ; }
169
181
public get defaultCustomConfigurationVariables ( ) : { [ key : string ] : string } | undefined { return super . Section . get < { [ key : string ] : string } > ( "default.customConfigurationVariables" ) ; }
170
182
public get useBacktickCommandSubstitution ( ) : boolean | undefined { return super . Section . get < boolean > ( "debugger.useBacktickCommandSubstitution" ) ; }
0 commit comments