Cannot remove 'files.associations' preferences #12008
-
Bug Description:when remove - FileSystemFrontendContribution
protected updateAssociations(): void {
const fileAssociations = this.preferences['files.associations'];
const mimeAssociations = Object.keys(fileAssociations).map(filepattern => ({ id: fileAssociations[filepattern], filepattern }));
this.mimeService.setAssociations(mimeAssociations);
}
here is my code: function removePreferences(rebind: interfaces.Rebind, contrib: interfaces.ServiceIdentifier<unknown>, sch: PreferenceSchema): void {
rebind(contrib).toConstantValue({
schema: (() => {
const s = sch;
const schemaKeys = Object.keys(s.properties);
schemaKeys.forEach(key => {
delete s.properties[key];
});
return s;
})()
});
removePreferences(rebind, FileSystemPreferenceContribution, filesystemPreferenceSchema); c5a7d71#diff-f36fb1a0e913ea06a31998757f31c1f5a1841dd8ee33352257c9beb89771b818 I know file extension is necessary for checking language type, but that error annoys me. sorry Steps to Reproduce:
Additional Information
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@saltylassi thank you for reporting the issue, I'm not entirely convinced it is a bug but if you're not interested in |
Beta Was this translation helpful? Give feedback.
@saltylassi thank you for reporting the issue, I'm not entirely convinced it is a bug but if you're not interested in
files.associtations
(where you completely remove the preference) you can always overrideupdateAssociations
in your application.