Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Index

Constructors

Properties

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

Type declaration

    • (...arguments: []): Promise<boolean>
    • Debounce promise-returning & async functions.

      example
      import pDebounce = require('p-debounce');

      const expensiveCall = async input => input;

      const debouncedFn = pDebounce(expensiveCall, 200);

      for (const i of [1, 2, 3]) {
      debouncedFn(i).then(console.log);
      }
      //=> 3
      //=> 3
      //=> 3

      Parameters

      • Rest ...arguments: []

      Returns Promise<boolean>

      A function that delays calling fn until after wait milliseconds have elapsed since the last time it was called.

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: {} = {}

Type declaration

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

Accessors

  • get ready(): Promise<void>

Methods

  • dispose(): void
  • fireDidPreferenceSchemaChanged(): void
  • get<T>(preferenceName: string, resourceUri?: string): undefined | T
  • 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.

  • getConfigUri(resourceUri?: string, sectionName?: string): undefined | URI
  • getConfiguredDefault(preferenceName: string): any
  • getContainingConfigUri(resourceUri?: string, sectionName?: string): undefined | URI
  • getDomain(): undefined | string[]
  • getOverridePreferenceNames(preferenceName: string): IterableIterator<string>
  • getParsedContent(jsonData: any): {}
  • getPreferenceNames(): IterableIterator<string>
  • getPreferences(): {}
  • init(): void
  • readConfiguredPreferences(): void
  • registerOverrideIdentifier(overrideIdentifier: string): void
  • 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

  • removePropFromSchemas(key: string): 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.

  • setPreference(): Promise<boolean>
  • updateOverridePatternPropertiesKey(): void
  • deepEqual(a: undefined | JSONValue, b: undefined | JSONValue): boolean
  • merge(source: undefined | JSONValue, target: JSONValue): JSONValue