Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AbstractResourcePreferenceProvider

Hierarchy

Index

Constructors

constructor

Properties

Protected _pendingChanges

_pendingChanges: Promise<boolean>

Protected Readonly _ready

_ready: Deferred<void>

Protected Readonly configurations

configurations: PreferenceConfigurations

Protected deferredChanges

deferredChanges: undefined | PreferenceProviderDataChanges

Protected Readonly fileService

fileService: FileService

Protected fireDidPreferencesChanged

fireDidPreferencesChanged: () => Promise<boolean>

Type declaration

    • (): Promise<boolean>
    • Returns Promise<boolean>

Protected Readonly loading

loading: Deferred<void> = ...

Protected Readonly messageService

messageService: MessageService

Protected model

model: undefined | MonacoEditorModel

Protected modelInitialized

modelInitialized: boolean = false

Readonly onDidPreferencesChanged

onDidPreferencesChanged: Event<PreferenceProviderDataChanges>

Protected Readonly onDidPreferencesChangedEmitter

onDidPreferencesChangedEmitter: Emitter<PreferenceProviderDataChanges>

Protected Readonly preferenceOverrideService

preferenceOverrideService: PreferenceLanguageOverrideService

Protected preferences

preferences: {} = {}

Type declaration

  • [key: string]: any

Protected Readonly schemaProvider

schemaProvider: PreferenceSchemaProvider

Protected Readonly textModelService

textModelService: MonacoTextModelService

Protected Readonly toDispose

toDispose: DisposableCollection

Protected Readonly workspace

workspace: MonacoWorkspace

Accessors

pendingChanges

  • get pendingChanges(): Promise<boolean>
  • Returns Promise<boolean>

ready

  • get ready(): Promise<void>
  • Resolved when the preference provider is ready to provide preferences It should be resolved by subclasses.

    Returns Promise<void>

Protected valid

  • get valid(): boolean

Methods

contains

  • contains(resourceUri: undefined | string): boolean

dispose

  • dispose(): void
  • Returns void

Protected emitPreferencesChangedEvent

get

  • 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

  • getConfigUri(): default
  • getConfigUri(resourceUri: undefined | string): undefined | default

Optional getContainingConfigUri

  • getContainingConfigUri(resourceUri?: string, sectionName?: string): undefined | default
  • Retrieves the first valid configuration URI contained by the given resource.

    Parameters

    • Optional resourceUri: string

      the uri of the container resource or undefined.

    • Optional sectionName: string

    Returns undefined | default

    the first valid configuration URI contained by the given resource undefined if there is no valid configuration URI at all.

getDomain

  • getDomain(): undefined | string[]
  • Retrieve the domain for this provider.

    Returns undefined | string[]

    the domain or undefined if this provider is suitable for all domains.

Protected getParsedContent

  • getParsedContent(jsonData: any): {}
  • Parameters

    • jsonData: any

    Returns {}

    • [key: string]: any

Protected getPath

  • getPath(preferenceName: string): undefined | string[]

getPreferences

  • getPreferences(resourceUri?: string): {}

Protected Abstract getScope

Protected Abstract getUri

  • getUri(): default

Protected handlePreferenceChanges

  • handlePreferenceChanges(newPrefs: {}): void

Protected init

  • init(): Promise<void>

Protected mergePreferenceProviderDataChange

Protected parse

  • parse(content: string): any

Protected readPreferences

  • readPreferences(): void

Protected readPreferencesFromContent

  • readPreferencesFromContent(content: string): void

Protected readPreferencesFromFile

  • readPreferencesFromFile(): Promise<void>

Protected reset

  • reset(): void

resolve

  • 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

  • setPreference(key: string, value: any, resourceUri?: string): Promise<boolean>

Static deepEqual

  • deepEqual(a: undefined | null | string | number | boolean | JSONObject | JSONArray, b: undefined | null | string | number | boolean | JSONObject | JSONArray): boolean
  • Handles deep equality with the possibility of undefined

    Parameters

    • a: undefined | null | string | number | boolean | JSONObject | JSONArray
    • b: undefined | null | string | number | boolean | JSONObject | JSONArray

    Returns boolean

Static merge

  • merge(source: undefined | null | string | number | boolean | JSONObject | JSONArray, target: JSONValue): JSONValue
  • Parameters

    • source: undefined | null | string | number | boolean | JSONObject | JSONArray
    • target: JSONValue

    Returns JSONValue