Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Config

Configuration data for the extension.

Hierarchy

  • WorkspaceConfiguration
    • Config

Indexable

[key: string]: any

Readable dictionary that backs this configuration.

Index

Properties

Optional open

One or more requests to open from files on startup.

Optional openNewOnStartup

openNewOnStartup: boolean

Opens a new request on startup or not.

Optional rejectUnauthorized

rejectUnauthorized: boolean

Reject unauthorized SSL certificates or not.

Methods

get

  • get<T>(section: string): T | undefined
  • get<T>(section: string, defaultValue: T): T
  • Return a value from this configuration.

    Type parameters

    • T

    Parameters

    • section: string

      Configuration name, supports dotted names.

    Returns T | undefined

    The value section denotes or undefined.

  • Return a value from this configuration.

    Type parameters

    • T

    Parameters

    • section: string

      Configuration name, supports dotted names.

    • defaultValue: T

      A value should be returned when no value could be found, is undefined.

    Returns T

    The value section denotes or the default.

has

  • has(section: string): boolean
  • Check if this configuration has a certain value.

    Parameters

    • section: string

      Configuration name, supports dotted names.

    Returns boolean

    true if the section doesn't resolve to undefined.

inspect

  • inspect<T>(section: string): object | undefined
  • Retrieve all information about a configuration setting. A configuration value often consists of a default value, a global or installation-wide value, a workspace-specific value and a folder-specific value.

    The effective value (returned by get) is computed like this: defaultValue overwritten by globalValue, globalValue overwritten by workspaceValue. workspaceValue overwritten by workspaceFolderValue. Refer to Settings Inheritence for more information.

    Note: The configuration name must denote a leaf in the configuration tree (editor.fontSize vs editor) otherwise no result is returned.

    Type parameters

    • T

    Parameters

    • section: string

      Configuration name, supports dotted names.

    Returns object | undefined

    Information about a configuration setting or undefined.

update

  • update(section: string, value: any, configurationTarget?: ConfigurationTarget | boolean): Thenable<void>
  • Update a configuration value. The updated configuration values are persisted.

    A value can be changed in

    Note 1: Setting a global value in the presence of a more specific workspace value has no observable effect in that workspace, but in others. Setting a workspace value in the presence of a more specific folder value has no observable effect for the resources under respective folder, but in others. Refer to Settings Inheritence for more information.

    Note 2: To remove a configuration value use undefined, like so: config.update('somekey', undefined)

    Will throw error when

    • Writing a configuration which is not registered.
    • Writing a configuration to workspace or folder target when no workspace is opened
    • Writing a configuration to folder target when there is no folder settings
    • Writing to folder target without passing a resource when getting the configuration (workspace.getConfiguration(section, resource))
    • Writing a window configuration to folder target

    Parameters

    • section: string

      Configuration name, supports dotted names.

    • value: any

      The new value.

    • Optional configurationTarget: ConfigurationTarget | boolean

      The configuration target or a boolean value.

      - If `true` configuration target is `ConfigurationTarget.Global`.
      - If `false` configuration target is `ConfigurationTarget.Workspace`.
      - If `undefined` or `null` configuration target is
      `ConfigurationTarget.WorkspaceFolder` when configuration is resource specific
      `ConfigurationTarget.Workspace` otherwise.
      

    Returns Thenable<void>

Generated using TypeDoc