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


TypeScript commands.executeCommand方法代码示例

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


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

示例1: CallEditorCommand

 public CallEditorCommand(argument: string) {
     vscode.commands.executeCommand(argument, null);
 }
开发者ID:mswift42,项目名称:vscode-vim,代码行数:3,代码来源:VSCodeEditor.ts

示例2: quickCompileAndDebugWorkspaceFolder

async function quickCompileAndDebugWorkspaceFolder(workspaceFolder, debug: boolean)
{
	if(!workspaceFolder)
	{
		//it's possible for no folder to be chosen when using
		//showWorkspaceFolderPick()
		return;
	}
	//before running a task, VSCode saves all files. we should do the same
	//before running a quick compile, since it's like a task.
	await vscode.commands.executeCommand("workbench.action.files.saveAll");
	let workspaceFolderUri = workspaceFolder.uri.toString();
	vscode.window.withProgress({location: vscode.ProgressLocation.Window}, (progress) =>
	{
		progress.report({message: QUICK_COMPILE_MESSAGE});
		return new Promise((resolve, reject) =>
		{
			return vscode.commands.executeCommand("workbench.action.debug.stop").then(() =>
			{
				let animateFile = getAnimateFile(workspaceFolder);
				if(animateFile)
				{
					let animatePath = findAnimate();
			
					let extension = vscode.extensions.getExtension("bowlerhatllc.vscode-nextgenas");
					let fileName = debug ? "debug-movie.jsfl" : "test-movie.jsfl";
					let jsflPath = path.resolve(extension.extensionPath, "jsfl", fileName);
			
					if(process.platform === "win32")
					{
						child_process.spawn(animatePath, [animateFile, jsflPath]);
					}
					else if(process.platform === "darwin") //macOS
					{
						child_process.spawn("open", ["-a", animatePath, animateFile, jsflPath]);
					}
					else
					{
						reject();
						return;
					}

					resolve();
					return;
				}
				return vscode.commands.executeCommand("as3mxml.quickCompile", workspaceFolderUri, debug).then((result) =>
				{
					resolve();
	
					if(result === true)
					{
						if(debug)
						{
							vscode.commands.executeCommand("workbench.action.debug.start");
						}
						else
						{
							vscode.commands.executeCommand("workbench.action.debug.run");
						}
					}
					else
					{
						vscode.window.showErrorMessage(CANNOT_LAUNCH_QUICK_COMPILE_FAILED_ERROR);
					}
				}, 
				() =>
				{
					resolve();
	
					//if the build failed, notify the user that we're not starting
					//a debug session
					vscode.window.showErrorMessage(CANNOT_LAUNCH_QUICK_COMPILE_FAILED_ERROR);
				});
			});
		});
	});
}
开发者ID:BowlerHatLLC,项目名称:vscode-nextgenas,代码行数:77,代码来源:quickCompileAndLaunch.ts

示例3:

 .then(function (item) {
     if (!item) return;
     vscode.commands.executeCommand('workbench.action.reloadWindow');
 });
开发者ID:shalldie,项目名称:vscode-background,代码行数:4,代码来源:vsHelp.ts

示例4:

			.then(editor =>
				vscode.commands.executeCommand('revealLine', { lineNumber: Math.floor(line), at: 'center' })
					.then(() => editor))
开发者ID:pavelfeldman,项目名称:vscode,代码行数:3,代码来源:extension.ts

示例5: closeAllFiles

export async function closeAllFiles() {
	return (window.visibleTextEditors.length === 0)
		? Promise.resolve()
		: commands.executeCommand('workbench.action.closeAllEditors');
}
开发者ID:jedmao,项目名称:vscode-test-utils,代码行数:5,代码来源:index.ts

示例6: function

 docFXPreviewProcessor.startPreview(resource, function (tempPreviewFilePath) {
     let thenable = commands.executeCommand("vscode.previewHtml",
         tempPreviewFilePath,
         getViewColumn(sideBySide),
         `DocFXPreview "${path.basename(resource.fsPath)}"`);
 });
开发者ID:DuncanmaMSFT,项目名称:docfx,代码行数:6,代码来源:extension.ts

示例7:

			.then(() => vscode.commands.executeCommand('workbench.files.action.closeAllFiles'))
开发者ID:13572293130,项目名称:vscode,代码行数:1,代码来源:utils.ts

示例8: toVisualLine

 @PrototypeReflect.metadata(SymbolMetadata.Action.shouldSkipOnRepeat, true)
 static toVisualLine(): Thenable<boolean> {
     return commands.executeCommand(`amVim.mode.${ModeID.VISUAL_LINE}`);
 }
开发者ID:Alcan-Phoenix,项目名称:amVim-for-VSCode,代码行数:4,代码来源:Mode.ts

示例9: toInsert

 @PrototypeReflect.metadata(SymbolMetadata.Action.isChange, true)
 @PrototypeReflect.metadata(SymbolMetadata.Action.shouldSkipOnRepeat, true)
 static toInsert(): Thenable<boolean> {
     return commands.executeCommand(`amVim.mode.${ModeID.INSERT}`);
 }
开发者ID:Alcan-Phoenix,项目名称:amVim-for-VSCode,代码行数:5,代码来源:Mode.ts

示例10:

				.then(() => vscode.commands.executeCommand('vscode.open', resource))
开发者ID:SeanKilleen,项目名称:vscode,代码行数:1,代码来源:extension.ts


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