@@ -98,11 +98,11 @@ export class ConfigurationMigrationWorkbenchContribution extends Disposable impl
98
98
const inspectData = this . configurationService . inspect ( migration . key , { resource } ) ;
99
99
100
100
const targetPairs : [ keyof IConfigurationValue < any > , ConfigurationTarget ] [ ] = [
101
- [ 'userValue ' , ConfigurationTarget . USER ] ,
102
- [ 'userLocalValue ' , ConfigurationTarget . USER_LOCAL ] ,
103
- [ 'userRemoteValue ' , ConfigurationTarget . USER_REMOTE ] ,
104
- [ 'workspaceValue ' , ConfigurationTarget . WORKSPACE ] ,
105
- [ 'workspaceFolderValue ' , ConfigurationTarget . WORKSPACE_FOLDER ] ,
101
+ [ 'user ' , ConfigurationTarget . USER ] ,
102
+ [ 'userLocal ' , ConfigurationTarget . USER_LOCAL ] ,
103
+ [ 'userRemote ' , ConfigurationTarget . USER_REMOTE ] ,
104
+ [ 'workspace ' , ConfigurationTarget . WORKSPACE ] ,
105
+ [ 'workspaceFolder ' , ConfigurationTarget . WORKSPACE_FOLDER ] ,
106
106
] ;
107
107
for ( const [ dataKey , target ] of targetPairs ) {
108
108
const migrationValues : [ [ string , ConfigurationValue ] , string [ ] ] [ ] = [ ] ;
@@ -134,11 +134,15 @@ export class ConfigurationMigrationWorkbenchContribution extends Disposable impl
134
134
}
135
135
136
136
private async runMigration ( migration : ConfigurationMigration , overrides : IConfigurationOverrides , dataKey : keyof IConfigurationValue < any > , data ?: IConfigurationValue < any > ) : Promise < ConfigurationKeyValuePairs | undefined > {
137
- const value = ( data ?? this . configurationService . inspect ( migration . key , overrides ) ) [ dataKey ] ;
137
+ const valueAccessor = ( key : string ) => getInspectValue ( this . configurationService . inspect ( key , overrides ) ) ;
138
+ const getInspectValue = ( data : IConfigurationValue < any > ) => {
139
+ const inspectValue : { value ?: any ; override ?: any } | undefined = data [ dataKey ] ;
140
+ return overrides . overrideIdentifier ? inspectValue ?. override : inspectValue ?. value ;
141
+ } ;
142
+ const value = data ? getInspectValue ( data ) : valueAccessor ( migration . key ) ;
138
143
if ( value === undefined ) {
139
144
return undefined ;
140
145
}
141
- const valueAccessor = ( key : string ) => this . configurationService . inspect ( key , overrides ) [ dataKey ] ;
142
146
const result = await migration . migrateFn ( value , valueAccessor ) ;
143
147
return Array . isArray ( result ) ? result : [ [ migration . key , result ] ] ;
144
148
}
0 commit comments