Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MockPreferenceProvider

Hierarchy

Index

Constructors

Properties

_ready: Deferred<void> = ...
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.

onDidPreferencesChanged: Event<PreferenceProviderDataChanges> = ...
onDidPreferencesChangedEmitter: Emitter<PreferenceProviderDataChanges> = ...
preferenceOverrideService: PreferenceLanguageOverrideService
prefs: {} = {}

Type declaration

  • [p: string]: any
toDispose: DisposableCollection = ...

Accessors

  • get ready(): Promise<void>

Methods

  • dispose(): 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
  • getContainingConfigUri(resourceUri?: string, sectionName?: string): undefined | URI
  • getDomain(): undefined | string[]
  • getParsedContent(jsonData: any): {}
  • getPreferences(): {}
  • markReady(): 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(preferenceName: string, newValue: any, resourceUri?: string): Promise<boolean>
  • deepEqual(a: undefined | JSONValue, b: undefined | JSONValue): boolean
  • merge(source: undefined | JSONValue, target: JSONValue): JSONValue