@@ -697,6 +697,18 @@ export class CppProperties {
697697 return result ;
698698 }
699699
700+ private resolve ( entries : string [ ] | undefined , defaultValue : string [ ] | undefined , env : Environment ) : string [ ] {
701+ let result : string [ ] = [ ] ;
702+ if ( entries ) {
703+ entries = this . resolveDefaults ( entries , defaultValue ) ;
704+ entries . forEach ( entry => {
705+ const entryResolved : string = util . resolveVariables ( entry , env ) ;
706+ result = result . concat ( entryResolved ) ;
707+ } ) ;
708+ }
709+ return result ;
710+ }
711+
700712 private resolveAndSplit ( paths : string [ ] | undefined , defaultValue : string [ ] | undefined , env : Environment ) : string [ ] {
701713 let result : string [ ] = [ ] ;
702714 if ( paths ) {
@@ -721,14 +733,24 @@ export class CppProperties {
721733
722734 private updateConfigurationStringArray ( property : string [ ] | undefined , defaultValue : string [ ] | undefined , env : Environment ) : string [ ] | undefined {
723735 if ( property ) {
724- return this . resolveAndSplit ( property , defaultValue , env ) ;
736+ return this . resolve ( property , defaultValue , env ) ;
725737 }
726738 if ( ! property && defaultValue ) {
727- return this . resolveAndSplit ( defaultValue , [ ] , env ) ;
739+ return this . resolve ( defaultValue , [ ] , env ) ;
728740 }
729741 return property ;
730742 }
731743
744+ private updateConfigurationPathsArray ( paths : string [ ] | undefined , defaultValue : string [ ] | undefined , env : Environment ) : string [ ] | undefined {
745+ if ( paths ) {
746+ return this . resolveAndSplit ( paths , defaultValue , env ) ;
747+ }
748+ if ( ! paths && defaultValue ) {
749+ return this . resolveAndSplit ( defaultValue , [ ] , env ) ;
750+ }
751+ return paths ;
752+ }
753+
732754 private updateConfigurationStringOrBoolean ( property : string | boolean | undefined | null , defaultValue : boolean | undefined | null , env : Environment ) : string | boolean | undefined {
733755 if ( ! property || property === "${default}" ) {
734756 property = defaultValue ;
@@ -774,17 +796,17 @@ export class CppProperties {
774796 for ( let i : number = 0 ; i < this . configurationJson . configurations . length ; i ++ ) {
775797 const configuration : Configuration = this . configurationJson . configurations [ i ] ;
776798
777- configuration . includePath = this . updateConfigurationStringArray ( configuration . includePath , settings . defaultIncludePath , env ) ;
799+ configuration . includePath = this . updateConfigurationPathsArray ( configuration . includePath , settings . defaultIncludePath , env ) ;
778800 // in case includePath is reset below
779801 const origIncludePath : string [ ] | undefined = configuration . includePath ;
780802 if ( userSettings . addNodeAddonIncludePaths ) {
781803 const includePath : string [ ] = origIncludePath || [ ] ;
782804 configuration . includePath = includePath . concat ( this . nodeAddonIncludes . filter ( i => includePath . indexOf ( i ) < 0 ) ) ;
783805 }
784806 configuration . defines = this . updateConfigurationStringArray ( configuration . defines , settings . defaultDefines , env ) ;
785- configuration . macFrameworkPath = this . updateConfigurationStringArray ( configuration . macFrameworkPath , settings . defaultMacFrameworkPath , env ) ;
807+ configuration . macFrameworkPath = this . updateConfigurationPathsArray ( configuration . macFrameworkPath , settings . defaultMacFrameworkPath , env ) ;
786808 configuration . windowsSdkVersion = this . updateConfigurationString ( configuration . windowsSdkVersion , settings . defaultWindowsSdkVersion , env ) ;
787- configuration . forcedInclude = this . updateConfigurationStringArray ( configuration . forcedInclude , settings . defaultForcedInclude , env ) ;
809+ configuration . forcedInclude = this . updateConfigurationPathsArray ( configuration . forcedInclude , settings . defaultForcedInclude , env ) ;
788810 configuration . compileCommands = this . updateConfigurationString ( configuration . compileCommands , settings . defaultCompileCommands , env ) ;
789811 configuration . compilerArgs = this . updateConfigurationStringArray ( configuration . compilerArgs , settings . defaultCompilerArgs , env ) ;
790812 configuration . cStandard = this . updateConfigurationString ( configuration . cStandard , settings . defaultCStandard , env ) ;
@@ -863,7 +885,7 @@ export class CppProperties {
863885 }
864886 }
865887 } else {
866- configuration . browse . path = this . updateConfigurationStringArray ( configuration . browse . path , settings . defaultBrowsePath , env ) ;
888+ configuration . browse . path = this . updateConfigurationPathsArray ( configuration . browse . path , settings . defaultBrowsePath , env ) ;
867889 }
868890
869891 configuration . browse . limitSymbolsToIncludedHeaders = this . updateConfigurationStringOrBoolean ( configuration . browse . limitSymbolsToIncludedHeaders , settings . defaultLimitSymbolsToIncludedHeaders , env ) ;
0 commit comments