vscode-get-config
v0.4.0
Published
A simple wrapper for `vscode.workspace.getConfiguration()` provided by the Visual Studio Code API
Downloads
17
Maintainers
Readme
vscode-get-config
A simple wrapper for vscode.workspace.getConfiguration()
provided by the Visual Studio Code API
Features:
- supports dot notation
- supports variable substitution
Note: By default, variable substitution is supported only by a handful of settings (see details)
Installation
npm install vscode-get-config -S
Usage
getConfig(section?: string)
Example:
import { getConfig } from 'vscode-get-config';
const { fontFamily, fontSize } = await getConfig('editor');
const fontConfig = await getConfig('editor.fontFamily', 'editor.fontSize');
Variable Substitution
Most of Visual Studio Code's variables will be substituted used in a configuration value
all predefined variables
${workspaceFolder}
${workspaceFolderBasename}
${file}
${relativeFile}
${relativeFileDirname}
${fileBasename}
${fileBasenameNoExtension}
${fileDirname}
${fileExtname}
${cwd}
${lineNumber}
${selectedText}
${execPath}
${pathSeparator}
${defaultBuildTask}
environment variables, e.g.
${env:USERNAME}
configuration variables, e.g.
${config:editor.fontSize}
License
This work is licensed under The MIT License