Class PreferenceSchemaProvider

The PreferenceSchemaProvider collects all PreferenceContributions and combines the preference schema provided by these contributions into one collective schema. The preferences which are provided by this PreferenceProvider are derived from this combined schema.

Hierarchy (view full)

Constructors

Properties

_ready: Deferred<void> = ...
combinedSchema: PreferenceDataSchema = ...
configurations: PreferenceConfigurations
deferredChanges: undefined | PreferenceProviderDataChanges
fireDidPreferencesChanged: ((...arguments) => Promise<boolean>) = ...

Type declaration

    • (...arguments): Promise<boolean>
    • Parameters

      • Rest ...arguments: []

      Returns Promise<boolean>

folderSchema: PreferenceDataSchema = ...
onDidPreferenceSchemaChanged: Event<void> = ...
onDidPreferenceSchemaChangedEmitter: Emitter<void> = ...
onDidPreferencesChanged: Event<PreferenceProviderDataChanges> = ...
onDidPreferencesChangedEmitter: Emitter<PreferenceProviderDataChanges> = ...
overridePatternProperties: Required<Pick<PreferenceDataProperty, "properties" | "additionalProperties">> & PreferenceDataProperty = ...
overridePatternPropertiesKey: undefined | string
preferenceOverrideService: PreferenceLanguageOverrideService
preferences: {
    [name: string]: any;
} = {}

Type declaration

  • [name: string]: any
toDispose: DisposableCollection = ...
workspaceSchema: PreferenceDataSchema = ...

Accessors

Methods

  • Retrieve the stored value for the given preference and resource URI.

    Type Parameters

    • T

    Parameters

    • preferenceName: string

      the preference identifier.

    • Optional resourceUri: string

      the uri of the resource for which the preference is stored. This is used to retrieve a potentially different value for the same preference for different resources, for example files.encoding.

    Returns undefined | T

    the value stored for the given preference and resourceUri if it exists, otherwise undefined.

  • Retrieve the configuration URI for the given resource URI.

    Parameters

    • Optional resourceUri: string

      the uri of the resource or undefined.

    • Optional sectionName: string

      the section to return the URI for, e.g. tasks or launch. Defaults to settings.

    Returns undefined | URI

    the corresponding resource URI or undefined if there is no valid URI.

  • Register a new overrideIdentifier. Existing identifiers are not replaced.

    Allows overriding existing values while keeping both values in store. For example to store different editor settings, e.g. "[markdown].editor.autoIndent", "[json].editor.autoIndent" and "editor.autoIndent"

    Parameters

    • overrideIdentifier: string

      the new overrideIdentifier

    Returns void

  • Resolve the value for the given preference and resource URI.

    Type Parameters

    • T

    Parameters

    • preferenceName: string

      the preference identifier.

    • Optional resourceUri: string

      the URI of the resource for which this provider should resolve the preference. This is used to retrieve a potentially different value for the same preference for different resources, for example files.encoding.

    Returns PreferenceResolveResult<T>

    an object containing the value stored for the given preference and resourceUri if it exists, otherwise undefined.