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


TypeScript workspace.saveAll方法代码示例

本文整理汇总了TypeScript中vscode.workspace.saveAll方法的典型用法代码示例。如果您正苦于以下问题:TypeScript workspace.saveAll方法的具体用法?TypeScript workspace.saveAll怎么用?TypeScript workspace.saveAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vscode.workspace的用法示例。


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

示例1: startProc

	startProc(cmd) {
		if (!this.child) {
			this.output.show(vscode.ViewColumn.Three);
			this.output.clear();
			vscode.workspace.saveAll(false);
			this.buildButton.hide();
			this.startButton.hide();
			Promise.all([this.workspaced.getConfiguration(), this.workspaced.getBuildType()]).then(values => {
				let args = [cmd, "--config=" + values[0], "--build=" + values[1]];
				this.output.appendLine("> dub " + args.join(" "));
				this.child = ChildProcess.spawn("dub", args, { cwd: vscode.workspace.rootPath, detached: true });
				this.child.stderr.on("data", this.handleData.bind(this));
				this.child.stdout.on("data", this.handleData.bind(this));
				this.child.once("close", (code) => {
					code = (code || 0);
					if (code === 0)
						this.output.appendLine(cmd + " succeeded");
					else
						this.output.appendLine("dub stopped with error code " + code);
					this.handleStop();
				});
				this.child.once("error", (err) => {
					this.output.appendLine("dub crashed:");
					this.output.appendLine(err.toString());
					this.handleStop();
				});

				this.stopButton.show();
			});
		}
	}
开发者ID:claudiug,项目名称:code-d,代码行数:31,代码来源:compile-buttons.ts

示例2:

	/* internal */ populateService(): void {
		this.currentDiagnostics.clear();
		this.syntaxDiagnostics = Object.create(null);
		// See https://github.com/Microsoft/TypeScript/issues/5530
		workspace.saveAll(false).then((value) => {
			this.bufferSyncSupports.forEach(support => {
				support.reOpenDocuments();
				support.requestAllDiagnostics();
			});
		});
	}
开发者ID:1424667164,项目名称:vscode,代码行数:11,代码来源:typescriptMain.ts

示例3: runCommandInIntegratedTerminal

 const runSbtCommand = (args: string[], cwd?: string) => {
   workspace.saveAll().then(() => {
     if (!cwd) {
       // tslint:disable-next-line:no-parameter-reassignment
       cwd = workspace.rootPath;
     }
     if (typeof window.createTerminal === 'function') {
       runCommandInIntegratedTerminal(args, cwd);
     }
   });
 };
开发者ID:dragos,项目名称:dragos-vscode-scala,代码行数:11,代码来源:sbt.ts

示例4: runNpmCommand

function runNpmCommand(args: string[], cwd?: string): void {
	workspace.saveAll().then(() => {
		if (!cwd) {
			cwd = workspace.rootPath;
		}

		if (useTerminal()) {
			runCommandInTerminal(args, cwd);
		} else {
			runCommandInOutputWindow(args, cwd);
		}
	});
}
开发者ID:Gigitsu,项目名称:vscode-npm-scripts,代码行数:13,代码来源:main.ts

示例5: runNpmCommand

function runNpmCommand(args: string[], cwd?: string, alwaysRunInputWindow = false): void {
	if (runSilent()) {
		args.push('--silent');
	}
	workspace.saveAll().then(() => {
		if (!cwd) {
			cwd = workspace.rootPath;
		}

		if (useTerminal() && !alwaysRunInputWindow) {
			if (typeof window.createTerminal === 'function') {
				runCommandInIntegratedTerminal(args, cwd);
			} else {
				runCommandInTerminal(args, cwd);
			}
		} else {
			outputChannel.clear();
			runCommandInOutputWindow(args, cwd);
		}
	});
}
开发者ID:scytalezero,项目名称:vscode-npm-scripts,代码行数:21,代码来源:main.ts

示例6: exec

    let disposable = vscode.commands.registerCommand('lรถvelauncher.launch', () => {
        if(currentInstances.length < maxInstances || overWrite){
            var path : string = vscode.workspace.getConfiguration('lรถvelauncher').get('path').toString();
            var useConsoleSubsystem = vscode.workspace.getConfiguration('lรถvelauncher').get('useConsoleSubsystem');
            var saveAllonLaunch = vscode.workspace.getConfiguration('lรถvelauncher').get('saveAllonLaunch');

            if (saveAllonLaunch){
                vscode.workspace.saveAll();
            }

            if (overWrite){
                currentInstances.forEach(function(instance){
                    if (instance != undefined){
                        instance.kill();
                    }
                });
            }

            if(!useConsoleSubsystem){
                var process = exec(path, [vscode.workspace.rootPath], function(err, data) {

                });
                process.on('exit', on_exit.bind(null,process));
                currentInstances[process.pid] = process;
            }else{
                var process = exec(path, [vscode.workspace.rootPath, "--console"], function (err, data) {

                });
                process.on('exit', on_exit.bind(null,process));
                currentInstances[process.pid] = process;
            }
        }else{
            vscode.window.showErrorMessage("You have reached your max concurrent Lรถve instances. You can change this setting in your config.");
        }

    });
开发者ID:JanWerder,项目名称:vscode-love-launcher,代码行数:36,代码来源:extension.ts

示例7:

	/* internal */ populateService(): void {
		// See https://github.com/Microsoft/TypeScript/issues/5530
		workspace.saveAll(false).then((value) => {
			Object.keys(this.languagePerId).forEach(key => this.languagePerId[key].reInitialize());
		});
	}
开发者ID:fs814,项目名称:vscode,代码行数:6,代码来源:typescriptMain.ts

示例8: execute

 async execute(): Promise<void> {
   // TODO : overwrite readonly files when bang? == true
   await vscode.workspace.saveAll(false);
 }
开发者ID:DanEEStar,项目名称:Vim,代码行数:4,代码来源:wall.ts

示例9: provideRenameEdits

 public provideRenameEdits(document: vscode.TextDocument, position: vscode.Position, newName: string, token: vscode.CancellationToken): Thenable<vscode.WorkspaceEdit> {
     return vscode.workspace.saveAll(false).then(() => {
         return this.doRename(document, position, newName, token);
     });
 }
开发者ID:maiamatheus,项目名称:pythonVSCode,代码行数:5,代码来源:renameProvider.ts

示例10: activate

export function activate(context: vscode.ExtensionContext) {

    let riolog = new RioLog();
    context.subscriptions.push(riolog);

    let preferences: Preferences[] = [];

    let workspaces = vscode.workspace.workspaceFolders;

    if (workspaces === undefined) {
        vscode.window.showErrorMessage('WPILib does not support single file');
        return;
    }

    for (let w of workspaces) {
        preferences.push(new Preferences(w));
    }

    context.subscriptions.push(vscode.workspace.onDidChangeWorkspaceFolders(() => {
        // Nuke and restart
        for (let p of preferences) {
            p.dispose();
        }
        let wp = vscode.workspace.workspaceFolders;

        if (wp === undefined) {
            return;
        }

        for (let w of wp) {
            preferences.push(new Preferences(w));
        }
    }));

    context.subscriptions.push(...preferences);

    let extensionResourceLocation = path.join(context.extensionPath, 'resources');

    let tools = new Array<IToolRunner>();
    let codeDeployers = new Array<ICodeDeployer>();
    let codeDebuggers = new Array<ICodeDeployer>();
    let languageChoices = new Array<string>();

    let api : IExternalAPI = {
        async startRioLog(teamNumber: number) : Promise<void> {
            riolog.connect(teamNumber, path.join(extensionResourceLocation, 'riolog'));
        },
        async startTool(): Promise<void> {
            if (tools.length <= 0) {
                vscode.window.showErrorMessage('No tools found. Please install some');
                return;
            }

            let toolNames = new Array<string>();
            for (let t of tools) {
                toolNames.push(t.getDisplayName());
            }

            let result = await vscode.window.showQuickPick(toolNames, { placeHolder: 'Pick a tool'});

            if (result === undefined) {
                vscode.window.showInformationMessage('Tool run canceled');
                return;
            }

            for (let t of tools) {
                if (t.getDisplayName() === result) {
                    await t.runTool();
                    return;
                }
            }

            vscode.window.showErrorMessage('Invalid tool entered');
            return;
        },
        addTool(tool: IToolRunner): void {
            tools.push(tool);
        },
        async deployCode(workspace: vscode.WorkspaceFolder): Promise<boolean> {
            if (codeDeployers.length <= 0) {
                vscode.window.showErrorMessage('No registered deployers');
                return false;
            }

            let prefs = await this.getPreferences(workspace);

            let availableDeployers = new Array<ICodeDeployer>();
            for (let d of codeDeployers) {
                if (await d.getIsCurrentlyValid(workspace)) {
                    availableDeployers.push(d);
                }
            }

            if (availableDeployers.length <= 0) {
                vscode.window.showErrorMessage('No registered deployers');
                return false;
            } else if (availableDeployers.length === 1) {
                if (prefs.getAutoSaveOnDeploy()) {
                    vscode.workspace.saveAll();
                }
//.........这里部分代码省略.........
开发者ID:ThadHouse,项目名称:vscode-wpilib-core,代码行数:101,代码来源:extension.ts


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