Theia API Documentation v1.65.0
    Preparing search index...

    The PreferenceProvider is used to store and retrieve preference values. A PreferenceProvider does not operate in a global scope but is configured for one or more PreferenceScopes. The (default implementation for the) PreferenceService aggregates all PreferenceProviders and serves as a common facade for manipulating preference values.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _ready: Deferred<void>
    configurations: PreferenceConfigurations
    deferredChanges: undefined | PreferenceProviderDataChanges
    fireDidPreferencesChanged: () => Promise<boolean>
    folderPreferenceProviderFactory: FolderPreferenceProviderFactory
    onDidPreferencesChanged: Event<PreferenceProviderDataChanges>
    onDidPreferencesChangedEmitter: Emitter<PreferenceProviderDataChanges>
    providers: Map<string, FolderPreferenceProvider> = ...
    workspaceService: WorkspaceService

    Accessors

    • get ready(): Promise<void>

      Resolved when the preference provider is ready to provide preferences It should be resolved by subclasses.

      Returns Promise<void>

    Methods

    • Dispose this object.

      Returns void

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

      Type Parameters

      • T

      Parameters

      • preferenceName: string

        the preference identifier.

      • OptionalresourceUri: 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.

    • Parameters

      • jsonData: unknown

      Returns { [key: string]: unknown }

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

      Type Parameters

      • T

      Parameters

      • preferenceName: string

        the preference identifier.

      • OptionalresourceUri: 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.

    • Stores a new value for the given preference key in the provider.

      Parameters

      • preferenceName: string

        the preference key (typically the name).

      • value: any

        the new preference value.

      • OptionalresourceUri: string

        the URI of the resource for which the preference is stored.

      Returns Promise<boolean>

      a promise that only resolves if all changes were delivered. If changes were made then implementation must either await on this.emitPreferencesChangedEvent(...) or this.pendingChanges if changes are fired indirectly.