@@ -296,14 +296,17 @@ export class SettingsPanel {
296296 }
297297
298298 private updateConfig ( message : any ) : void {
299- const splitEntries : ( input : any ) => string [ ] = ( input : any ) => input . split ( "\n" ) . filter ( ( e : string ) => e ) ;
299+ const splitEntries : ( input : any ) => string [ ] | undefined = ( input : any ) => {
300+ const result = input . split ( "\n" ) . filter ( ( e : string ) => e ) ;
301+ return result . length === 0 ? undefined : result ;
302+ } ;
300303
301304 switch ( message . key ) {
302305 case elementId . configName :
303306 this . configValues . name = message . value ;
304307 break ;
305308 case elementId . compilerPath :
306- this . configValues . compilerPath = message . value ;
309+ this . configValues . compilerPath = message . value || undefined ;
307310 break ;
308311 case elementId . compilerArgs :
309312 this . configValues . compilerArgs = splitEntries ( message . value ) ;
@@ -328,22 +331,22 @@ export class SettingsPanel {
328331 this . configValues . cppStandard = message . value ;
329332 break ;
330333 case elementId . windowsSdkVersion :
331- this . configValues . windowsSdkVersion = message . value ;
334+ this . configValues . windowsSdkVersion = message . value || undefined ;
332335 break ;
333336 case elementId . macFrameworkPath :
334337 this . configValues . macFrameworkPath = splitEntries ( message . value ) ;
335338 break ;
336339 case elementId . compileCommands :
337- this . configValues . compileCommands = message . value ;
340+ this . configValues . compileCommands = message . value || undefined ;
338341 break ;
339342 case elementId . dotConfig :
340- this . configValues . dotConfig = message . value ;
343+ this . configValues . dotConfig = message . value || undefined ;
341344 break ;
342345 case elementId . mergeConfigurations :
343346 this . configValues . mergeConfigurations = message . value ;
344347 break ;
345348 case elementId . configurationProvider :
346- this . configValues . configurationProvider = message . value ;
349+ this . configValues . configurationProvider = message . value || undefined ;
347350 break ;
348351 case elementId . forcedInclude :
349352 this . configValues . forcedInclude = splitEntries ( message . value ) ;
@@ -364,7 +367,7 @@ export class SettingsPanel {
364367 if ( ! this . configValues . browse ) {
365368 this . configValues . browse = { } ;
366369 }
367- this . configValues . browse . databaseFilename = message . value ;
370+ this . configValues . browse . databaseFilename = message . value || undefined ;
368371 break ;
369372 }
370373
0 commit comments