A manager for a specific plugin's settings.

Hierarchy

Implements

Constructors

Properties

_changed: any
_isDisposed: any
_onPluginChanged: any

Handle plugin changes in the setting registry.

id: string

The plugin name.

The setting registry instance used as a back-end for these settings.

Accessors

  • get changed(): ISignal<this, void>
  • A signal that emits when the plugin's settings have changed.

    Returns ISignal<this, void>

  • get isDisposed(): boolean
  • Test whether the plugin settings manager disposed.

    Returns boolean

  • get isModified(): boolean
  • Whether the settings have been modified by the user or not.

    Returns boolean

  • get raw(): string
  • The plugin settings raw text value.

    Returns string

  • get schema(): T
  • The plugin's schema.

    Returns T

  • get version(): string
  • The published version of the NPM package containing these settings.

    Returns string

Methods

  • Return the defaults in a commented JSON format.

    Returns string

  • Calculate the default value of a setting by iterating through the schema.

    Parameters

    • Optional key: string

      The name of the setting whose default value is calculated.

    Returns PartialJSONValue

    A calculated default JSON value for a specific setting.

  • Dispose of the plugin settings resources.

    Returns void

  • Get an individual setting.

    Parameters

    • key: string

      The name of the setting being retrieved.

    Returns {
        composite: ReadonlyPartialJSONValue;
        user: ReadonlyPartialJSONValue;
    }

    The setting value.

    Notes

    This method returns synchronously because it uses a cached copy of the plugin settings that is synchronized with the registry.

    • composite: ReadonlyPartialJSONValue
    • user: ReadonlyPartialJSONValue
  • Checks if any fields are different from the default value.

    Parameters

    Returns boolean

  • Remove a single setting.

    Parameters

    • key: string

      The name of the setting being removed.

    Returns Promise<void>

    A promise that resolves when the setting is removed.

    Notes

    This function is asynchronous because it writes to the setting registry.

  • Save all of the plugin's user settings at once.

    Parameters

    • raw: string

    Returns Promise<void>

  • Set a single setting.

    Parameters

    • key: string

      The name of the setting being set.

    • value: JSONValue

      The value of the setting.

    Returns Promise<void>

    A promise that resolves when the setting has been saved.

    Notes

    This function is asynchronous because it writes to the setting registry.

  • Validates raw settings with comments.

    Parameters

    • raw: string

      The JSON with comments string being validated.

    Returns ISchemaValidator.IError[]

    A list of errors or null if valid.

Generated using TypeDoc