@@ -66,12 +66,7 @@ export class EditorOverrideService extends Disposable implements IEditorOverride
66
66
// Read in the cache on statup
67
67
this . cache = new Set < string > ( JSON . parse ( this . storageService . get ( EditorOverrideService . overrideCacheStorageID , StorageScope . GLOBAL , JSON . stringify ( [ ] ) ) ) ) ;
68
68
this . storageService . remove ( EditorOverrideService . overrideCacheStorageID , StorageScope . GLOBAL ) ;
69
- this . hostService . hadLastFocus ( ) . then ( hadLastFocus => {
70
- if ( ! hadLastFocus ) {
71
- return ;
72
- }
73
- this . convertOldAssociationFormat ( ) ;
74
- } ) ;
69
+ this . convertOldAssociationFormat ( ) ;
75
70
76
71
this . _register ( this . storageService . onWillSaveState ( ( ) => {
77
72
// We want to store the glob patterns we would activate on, this allows us to know if we need to await the ext host on startup for opening a resource
@@ -188,20 +183,25 @@ export class EditorOverrideService extends Disposable implements IEditorOverride
188
183
}
189
184
190
185
private convertOldAssociationFormat ( ) : void {
191
- const rawAssociations = this . configurationService . getValue < EditorAssociations | { [ fileNamePattern : string ] : string } > ( editorsAssociationsSettingId ) || { } ;
192
- // If it's not an array, then it's the new format
193
- if ( ! Array . isArray ( rawAssociations ) ) {
194
- return ;
195
- }
196
- let newSettingObject = Object . create ( null ) ;
197
- // Make the correctly formatted object from the array and then set that object
198
- for ( const association of rawAssociations ) {
199
- if ( association . filenamePattern ) {
200
- newSettingObject [ association . filenamePattern ] = association . viewType ;
186
+ this . hostService . hadLastFocus ( ) . then ( hadLastFocus => {
187
+ if ( ! hadLastFocus ) {
188
+ return ;
201
189
}
202
- }
203
- this . logService . info ( `Migrating ${ editorsAssociationsSettingId } ` ) ;
204
- this . configurationService . updateValue ( editorsAssociationsSettingId , newSettingObject ) ;
190
+ const rawAssociations = this . configurationService . getValue < EditorAssociations | { [ fileNamePattern : string ] : string } > ( editorsAssociationsSettingId ) || { } ;
191
+ // If it's not an array, then it's the new format
192
+ if ( ! Array . isArray ( rawAssociations ) ) {
193
+ return ;
194
+ }
195
+ let newSettingObject = Object . create ( null ) ;
196
+ // Make the correctly formatted object from the array and then set that object
197
+ for ( const association of rawAssociations ) {
198
+ if ( association . filenamePattern ) {
199
+ newSettingObject [ association . filenamePattern ] = association . viewType ;
200
+ }
201
+ }
202
+ this . logService . info ( `Migrating ${ editorsAssociationsSettingId } ` ) ;
203
+ this . configurationService . updateValue ( editorsAssociationsSettingId , newSettingObject ) ;
204
+ } ) ;
205
205
}
206
206
207
207
private getAllUserAssociations ( ) : EditorAssociations {
0 commit comments