How to use the vscode.workspace.getConfiguration function in vscode

To help you get started, we’ve selected a few vscode examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github JohnstonCode / svn-scm / src / model.ts View on Github external
constructor(private svn: Svn) {
    const config = workspace.getConfiguration("svn");
    this.enabled = config.get("enabled") === true;

    svn
      .isSvnAvailable()
      .then(() => {
        if (this.enabled && svn.isSvnAvailable()) {
          this.init();
        } else {
          this.disable();
        }
      })
      .catch(() => {});
  }
github microsoft / vscode / extensions / typescript / src / features / configuration.ts View on Github external
export function load(myPluginId: string): IConfiguration {
	let configuration = workspace.getConfiguration(myPluginId);

	let useCodeSnippetsOnMethodSuggest = configuration.get('useCodeSnippetsOnMethodSuggest', defaultConfiguration.useCodeSnippetsOnMethodSuggest);

	return {
		useCodeSnippetsOnMethodSuggest
	};
}
github arthwang / vsc-prolog / src / features / formattingEditProvider.ts View on Github external
constructor() {
    this._section = workspace.getConfiguration("prolog");
    this._tabSize = this._section.get("format.tabSize", 4);
    this._insertSpaces = this._section.get("format.insertSpaces", true);
    this._tabDistance = this._insertSpaces ? 0 : this._tabSize;
    this._executable = this._section.get("executablePath", "swipl");
    this._args = ["--nodebug", "-q"];
    this._outputChannel = window.createOutputChannel("PrologFormatter");
  }
  private validRange(doc: TextDocument, initRange: Range): Range {
github microsoft / vscode / extensions / git / src / autofetch.ts View on Github external
private onConfiguration(): void {
		const gitConfig = workspace.getConfiguration('git');

		if (gitConfig.get('autofetch') === false) {
			this.disable();
		} else {
			this.enable();
		}
	}
github owensd / vscode-swift / src / extension.ts View on Github external
export function activate(context: ExtensionContext) {
	extensionPath = context.extensionPath;
	let config = workspace.getConfiguration(languageServerId);

	let enableBugLinks = config.get('enableSwiftBugLinks', true);
	if (enableBugLinks) { registerSwiftBugLinkProvider(context); }

	let enableLanguageServer = config.get('enableLanguageServer', true);
	if (enableLanguageServer) { registerSwiftLanguageServer(context); }
}

vscode

## ⚠️ Deprecated, use @types/vscode and vscode-test instead ⚠️

MIT
Latest version published 5 years ago

Package Health Score

47 / 100
Full package analysis