A PreferenceContribution allows adding additional custom preferences. For this, the PreferenceContribution has to provide a valid PrefernceSchema specifying which preferences are available including their types and description.
PrefernceSchema
const MyPreferencesSchema: PreferenceSchema = { 'scope': PreferenceScope.Folder, 'properties': { 'myext.decorations.enabled': { 'type': 'boolean', 'description': 'Show file status', 'default': true }, // [...] }}@injectable()export class MyPreferenceContribution implements PreferenceContribution{ schema= MyPreferencesSchema;} Copy
const MyPreferencesSchema: PreferenceSchema = { 'scope': PreferenceScope.Folder, 'properties': { 'myext.decorations.enabled': { 'type': 'boolean', 'description': 'Show file status', 'default': true }, // [...] }}@injectable()export class MyPreferenceContribution implements PreferenceContribution{ schema= MyPreferencesSchema;}
Optional
Readonly
Allows to do additional intialisation of the preference schema, for example registering overrides
the preference schema service
A PreferenceContribution allows adding additional custom preferences. For this, the PreferenceContribution has to provide a valid
PrefernceSchema
specifying which preferences are available including their types and description.Example usage