如何以编程方式重新加载 Visual Studio Code 窗口? [英] How to programmatically reload Visual Studio Code window?

查看:52
本文介绍了如何以编程方式重新加载 Visual Studio Code 窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用户可以通过编辑器的命令面板"运行重新加载窗口"来实现这一点.然而,从扩展创作的角度来看,这并不像立即提示用户那样直接.

期望的结果是在

[屏幕截图]

.

解决方案

使用vscode.window.showInformationMessage(...)提示用户确认后,可以运行vscode.commands.executeCommand("workbench.action.reloadWindow") 重新加载窗口.

User can achieve this by running 'Reload Window' available via editor's 'Command Palette'. That however from an extension authoring point of view is not as straight forward as prompting the user right away.

Desired outcome is to take current implementation in this pull request from [screenshot]

to [screenshot]

.

解决方案

Once you prompt the user to confirm using vscode.window.showInformationMessage(...) to confirm, you can run vscode.commands.executeCommand("workbench.action.reloadWindow") to reload the window.

这篇关于如何以编程方式重新加载 Visual Studio Code 窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆