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

Implements

Index

Constructors

constructor

Properties

Protected _pendingChanges

_pendingChanges: Promise<boolean> = Promise.resolve(false)

Protected Readonly _ready

_ready: Deferred<void> = new Deferred<void>()

Protected Readonly configurations

configurations: PreferenceConfigurations

Protected deferredChanges

deferredChanges: PreferenceProviderDataChanges | undefined

Protected fireDidPreferencesChanged

fireDidPreferencesChanged: (...arguments: ArgumentsType) => Promise<ReturnType> = debounce(() => {const changes = this.deferredChanges;this.deferredChanges = undefined;if (changes && Object.keys(changes).length) {this.onDidPreferencesChangedEmitter.fire(changes);return true;}return false;}, 0)

Type declaration

    • (...arguments: ArgumentsType): Promise<ReturnType>
    • Parameters

      • Rest ...arguments: ArgumentsType

      Returns Promise<ReturnType>

Readonly onDidPreferenceSchemaChanged

onDidPreferenceSchemaChanged: Event<void> = this.onDidPreferenceSchemaChangedEmitter.event

Protected Readonly onDidPreferenceSchemaChangedEmitter

onDidPreferenceSchemaChangedEmitter: Emitter<void> = new Emitter<void>()

Readonly onDidPreferencesChanged

onDidPreferencesChanged: Event<PreferenceProviderDataChanges> = this.onDidPreferencesChangedEmitter.event

Protected Readonly onDidPreferencesChangedEmitter

onDidPreferencesChangedEmitter: Emitter<PreferenceProviderDataChanges> = new Emitter<PreferenceProviderDataChanges>()

Protected Readonly overrideIdentifiers

overrideIdentifiers: Set<string> = new Set<string>()

Protected overridePatternPropertiesKey

overridePatternPropertiesKey: string | undefined

Protected Readonly preferenceContributions

Protected Readonly preferences

preferences: {}

Type declaration

  • [name: string]: any

Protected Readonly toDispose

toDispose: DisposableCollection = new DisposableCollection()

Accessors

pendingChanges

  • get pendingChanges(): Promise<boolean>

ready

  • get ready(): Promise<void>

Methods

Protected computeOverridePatternPropertiesKey

  • computeOverridePatternPropertiesKey(): string | undefined

dispose

  • dispose(): void

Protected doSetPreferenceValue

Protected doSetSchema

Protected doUnsetSchema

Protected emitPreferencesChangedEvent

Protected fireDidPreferenceSchemaChanged

  • fireDidPreferenceSchemaChanged(): void

get

  • get<T>(preferenceName: string, resourceUri?: undefined | string): T | undefined
  • Retrieve the stored value for the given preference and resource URI.

    Type parameters

    • T

    Parameters

    • preferenceName: string

      the preference identifier.

    • Optional resourceUri: undefined | 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 T | undefined

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

getCombinedSchema

getConfigUri

  • getConfigUri(resourceUri?: undefined | string, sectionName?: undefined | string): URI | undefined
  • Retrieve the configuration URI for the given resource URI.

    Parameters

    • Optional resourceUri: undefined | string

      the uri of the resource or undefined.

    • Optional sectionName: undefined | string

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

    Returns URI | undefined

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

Optional getContainingConfigUri

  • getContainingConfigUri(resourceUri?: undefined | string, sectionName?: undefined | string): URI | undefined

Protected getDefaultValue

getDomain

  • getDomain(): string[] | undefined

getOverridePreferenceNames

  • getOverridePreferenceNames(preferenceName: string): IterableIterator<string>

getPreferenceNames

  • getPreferenceNames(): IterableIterator<string>

getPreferences

  • getPreferences(): {}

getSchema

Protected init

  • init(): void

isValidInScope

Protected mergePreferenceProviderDataChange

overriddenPreferenceName

overridePreferenceName

  • overridePreferenceName(__namedParameters: { overrideIdentifier: string; preferenceName: string }): string

registerOverrideIdentifier

  • 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

Protected removePropFromSchemas

  • removePropFromSchemas(key: string): void

resolve

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

    Type parameters

    • T

    Parameters

    • preferenceName: string

      the preference identifier.

    • Optional resourceUri: undefined | 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

  • setPreference(): Promise<boolean>

setSchema

testOverrideValue

  • testOverrideValue(name: string, value: any): value is PreferenceSchemaProperties

Protected updateOverridePatternPropertiesKey

  • updateOverridePatternPropertiesKey(): void

Protected updateSchemaProps

Static merge

  • merge(source: JSONValue | undefined, target: JSONValue): JSONValue

Object literals

Protected Readonly combinedSchema

combinedSchema: object

patternProperties

patternProperties: {}

Type declaration

properties

properties: {}

Type declaration

Protected Readonly folderSchema

folderSchema: object

patternProperties

patternProperties: {}

Type declaration

properties

properties: {}

Type declaration

Protected Readonly overridePatternProperties

overridePatternProperties: object

additionalProperties

additionalProperties: false = false

description

description: string = "Configure editor settings to be overridden for a language."

errorMessage

errorMessage: string = "Unknown Identifier. Use language identifiers"

properties

properties: {}

Type declaration

type

type: "object" = "object"

Protected Readonly workspaceSchema

workspaceSchema: object

patternProperties

patternProperties: {}

Type declaration

properties

properties: {}

Type declaration