本文整理汇总了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);
}
示例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);
});
});
});
});
}
示例3:
.then(function (item) {
if (!item) return;
vscode.commands.executeCommand('workbench.action.reloadWindow');
});
示例4:
.then(editor =>
vscode.commands.executeCommand('revealLine', { lineNumber: Math.floor(line), at: 'center' })
.then(() => editor))
示例5: closeAllFiles
export async function closeAllFiles() {
return (window.visibleTextEditors.length === 0)
? Promise.resolve()
: commands.executeCommand('workbench.action.closeAllEditors');
}
示例6: function
docFXPreviewProcessor.startPreview(resource, function (tempPreviewFilePath) {
let thenable = commands.executeCommand("vscode.previewHtml",
tempPreviewFilePath,
getViewColumn(sideBySide),
`DocFXPreview "${path.basename(resource.fsPath)}"`);
});
示例7:
.then(() => vscode.commands.executeCommand('workbench.files.action.closeAllFiles'))
示例8: toVisualLine
@PrototypeReflect.metadata(SymbolMetadata.Action.shouldSkipOnRepeat, true)
static toVisualLine(): Thenable<boolean> {
return commands.executeCommand(`amVim.mode.${ModeID.VISUAL_LINE}`);
}
示例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}`);
}
示例10:
.then(() => vscode.commands.executeCommand('vscode.open', resource))