当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript vscode.WorkspaceConfiguration类代码示例

本文整理汇总了TypeScript中vscode.WorkspaceConfiguration的典型用法代码示例。如果您正苦于以下问题:TypeScript WorkspaceConfiguration类的具体用法?TypeScript WorkspaceConfiguration怎么用?TypeScript WorkspaceConfiguration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了WorkspaceConfiguration类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: computeConfiguration

 // Convert VS Code specific settings to a format acceptable by the server. Since
 // both client and server do use JSON the conversion is trivial.
 computeConfiguration(params: ConfigurationParams, _token: CancellationToken, _next: Function): any[] {
   if (!params.items) {
     return [];
   }
   let result: (IArgdownSettings | null)[] = [];
   for (let item of params.items) {
     // The server asks the client for configuration settings without a section
     // If a section is present we return null to indicate that the configuration
     // is not supported.
     if (item.section) {
       result.push(null);
       continue;
     }
     let config: WorkspaceConfiguration;
     if (item.scopeUri && this.client) {
       config = workspace.getConfiguration("argdown", this.client.protocol2CodeConverter.asUri(item.scopeUri));
     } else {
       config = workspace.getConfiguration("argdown");
     }
     result.push({
       configFile: config.get("configFile")
     });
   }
   return result;
 }
开发者ID:christianvoigt,项目名称:argdown,代码行数:27,代码来源:LanguageServerConfiguration.ts

示例2: loadConfig

    /*-------------------------------------------------------------------------
     * Private Method
     *-----------------------------------------------------------------------*/
    private loadConfig() {
        const confDocomment: WorkspaceConfiguration = workspace.getConfiguration(Configuration.KEY_DOCOMMENT);
        const confEditor: WorkspaceConfiguration = workspace.getConfiguration(Configuration.KEY_EDITOR);

        this._config = new Configuration();
        this._config.activateOnEnter = confDocomment.get<boolean>(Configuration.ACTIVATE_ON_ENTER, false);
        this._config.insertSpaces = confEditor.get<boolean>(Configuration.INSERT_SPACES, false);
        this._config.tabSize = confEditor.get<number>(Configuration.TAB_SIZE, 4);
    }
开发者ID:ivanz,项目名称:vscode-docomment,代码行数:12,代码来源:DocommentController.ts

示例3: updateConfiguration

	public updateConfiguration(config: WorkspaceConfiguration): void {
		let newConfig = config.get('format', Configuration.def());

		if (!Configuration.equals(this.config, newConfig)) {
			this.config = newConfig;
			this.formatOptions = Object.create(null);
		}
	}
开发者ID:m-khosravi,项目名称:vscode,代码行数:8,代码来源:formattingProvider.ts

示例4: getConfigNoDefault

export function getConfigNoDefault(config: WorkspaceConfiguration, key: string): any {
    let x = config.inspect(key);
    var value = x.workspaceFolderValue;
    if (value === undefined)
        value = x.workspaceValue;
    if (value === undefined)
        value = x.globalValue;
    return value;
}
开发者ID:harikrishnan94,项目名称:vscode-lldb,代码行数:9,代码来源:util.ts

示例5: getConfig

const isWindowsCompatible = (): boolean => {
  let config: WorkspaceConfiguration = getConfig();

  if (platform() === 'win32' || config.useWineToRun === true) {
    return true;
  }

  return false;
};
开发者ID:idleberg,项目名称:vscode-nsis,代码行数:9,代码来源:util.ts

示例6: readChannel

    /**
     * Tries to fetch the `rust-client.channel` configuration value. If missing,
     * falls back on active toolchain specified by rustup (at `rustupPath`),
     * finally defaulting to `nightly` if all fails.
     */
    private static readChannel(rustupPath: string, configuration: WorkspaceConfiguration, wsPath: string): string {
        const channel = configuration.get<string | null>('rust-client.channel', null);
        if (channel !== null) {
            return channel;
        } else {
            try {
                return getActiveChannel(rustupPath, wsPath);
            }
            // rustup might not be installed at the time the configuration is
            // initially loaded, so silently ignore the error and return a default value
            catch (e) {
                return 'nightly';
            }

        }
    }
开发者ID:digitaltoad,项目名称:dotfiles,代码行数:21,代码来源:configuration.ts

示例7: readRevealOutputChannelOn

 private static readRevealOutputChannelOn(configuration: WorkspaceConfiguration) {
     const setting = configuration.get<string>('rust-client.revealOutputChannelOn', 'never');
     return fromStringToRevealOutputChannelOn(setting);
 }
开发者ID:digitaltoad,项目名称:dotfiles,代码行数:4,代码来源:configuration.ts

示例8: Promise

  return new Promise((resolve, reject) => {
    let pathToMakensis: string = getConfig().pathToMakensis;

    if (typeof pathToMakensis !== 'undefined' && pathToMakensis !== null) {
      console.log('Using makensis path found in user settings: ' + pathToMakensis);
      return resolve(pathToMakensis);
    }

    let which = spawn(this.which(), ['makensis']);

    which.stdout.on('data', (data) => {
      console.log('Using makensis path detected on file system: ' + data);
      return resolve(data);
    });

    which.on('close', (code) => {
      if (code !== 0) {
        return reject(code);
      }
    });
  });
开发者ID:idleberg,项目名称:vscode-nsis,代码行数:21,代码来源:util.ts

示例9: runPubGetOnPubspecChangesIsConfiguredExplicitly

	get runPubGetOnPubspecChangesIsConfiguredExplicitly() {
		const runPubGet = this.config.inspect("runPubGetOnPubspecChanges");
		// Return whether any of them are explicitly set, in which case we'll then read normally from the settings.
		return runPubGet && (runPubGet.globalValue !== undefined || runPubGet.workspaceValue !== undefined || runPubGet.workspaceFolderValue !== undefined);
	}
开发者ID:DanTup,项目名称:Dart-Code,代码行数:5,代码来源:config.ts


注:本文中的vscode.WorkspaceConfiguration类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。