@@ -466,7 +466,8 @@ export class Configuration {
466466 compareAndUpdateDefaultConfiguration ( defaults : ConfigurationModel , keys : string [ ] ) : IConfigurationChange {
467467 const overrides : [ string , string [ ] ] [ ] = keys
468468 . filter ( key => OVERRIDE_PROPERTY_PATTERN . test ( key ) )
469- . map ( overrideIdentifier => {
469+ . map ( key => {
470+ const overrideIdentifier = overrideIdentifierFromKey ( key ) ;
470471 const fromKeys = this . _defaultConfiguration . getKeysForOverrideIdentifier ( overrideIdentifier ) ;
471472 const toKeys = defaults . getKeysForOverrideIdentifier ( overrideIdentifier ) ;
472473 const keys = [
@@ -489,6 +490,44 @@ export class Configuration {
489490 return { keys, overrides } ;
490491 }
491492
493+ compareAndUpdateRemoteUserConfiguration ( user : ConfigurationModel ) : IConfigurationChange {
494+ const { added, updated, removed, overrides } = compare ( this . remoteUserConfiguration , user ) ;
495+ let keys = [ ...added , ...updated , ...removed ] ;
496+ if ( keys . length ) {
497+ this . updateRemoteUserConfiguration ( user ) ;
498+ }
499+ return { keys, overrides } ;
500+ }
501+
502+ compareAndUpdateWorkspaceConfiguration ( workspaceConfiguration : ConfigurationModel ) : IConfigurationChange {
503+ const { added, updated, removed, overrides } = compare ( this . workspaceConfiguration , workspaceConfiguration ) ;
504+ let keys = [ ...added , ...updated , ...removed ] ;
505+ if ( keys . length ) {
506+ this . updateWorkspaceConfiguration ( workspaceConfiguration ) ;
507+ }
508+ return { keys, overrides } ;
509+ }
510+
511+ compareAndUpdateFolderConfiguration ( resource : URI , folderConfiguration : ConfigurationModel ) : IConfigurationChange {
512+ const currentFolderConfiguration = this . folderConfigurations . get ( resource ) ;
513+ const { added, updated, removed, overrides } = compare ( currentFolderConfiguration , folderConfiguration ) ;
514+ let keys = [ ...added , ...updated , ...removed ] ;
515+ if ( keys . length ) {
516+ this . updateFolderConfiguration ( resource , folderConfiguration ) ;
517+ }
518+ return { keys, overrides } ;
519+ }
520+
521+ compareAndDeleteFolderConfiguration ( folder : URI ) : IConfigurationChange {
522+ const folderConfig = this . folderConfigurations . get ( folder ) ;
523+ if ( ! folderConfig ) {
524+ throw new Error ( 'Unknown folder' ) ;
525+ }
526+ this . deleteFolderConfiguration ( folder ) ;
527+ const { added, updated, removed, overrides } = compare ( folderConfig , undefined ) ;
528+ return { keys : [ ...added , ...updated , ...removed ] , overrides } ;
529+ }
530+
492531 get defaults ( ) : ConfigurationModel {
493532 return this . _defaultConfiguration ;
494533 }
@@ -675,7 +714,7 @@ export class ConfigurationChangeEvent implements IConfigurationChangeEvent {
675714 this . affectedKeys = values ( keysSet ) ;
676715
677716 const configurationModel = new ConfigurationModel ( ) ;
678- this . affectedKeys . forEach ( key => this . affectedKeysTree . setValue ( key , { } ) ) ;
717+ this . affectedKeys . forEach ( key => configurationModel . setValue ( key , { } ) ) ;
679718 this . affectedKeysTree = configurationModel . contents ;
680719 }
681720
0 commit comments