visual-studio-code - 如何获取用户从 VSCode 扩展打开的 ViewColumns 的数量?
问题描述
我正在开发一个 VSCode 扩展,并使用以下命令打开一个 webview:
const panel = vscode.window.createWebviewPanel(
'webviewName', // Identifies the type of the webview. Used internally
'Webview Title', // Title of the panel displayed to the user
vscode.ViewColumn.Two, // Editor column to show the new webview panel in.
{} // Webview options.
);
请注意ViewColumn.Two
传递给它的参数。这会影响 webview 成为哪个视图列的一部分。
我的预期行为是让 webview 始终向一侧敞开。这意味着如果用户打开了一个文件,那么我可以在 ViewColumn 2 中打开它。但是,如果他们并排打开两个文件,我需要在 ViewColumn 3 中打开它,依此类推。
如何从 VSCode API 获取当前窗口中 ViewColumns 的数量?
另请注意:visual-studio-code-extensions 标签不存在。我想创建它,但我没有足够的代表。
解决方案
也许您正在寻找vscode.ViewColumn.Beside
:
一个符号编辑器列,表示活动列旁边的列。
推荐阅读
- c++ - 开放式简历。detectMultiScale() 函数返回错误
- c# - 枚举序列化为不带字符串引号的字符串
- nuget - 由于 api.nuget.org/v3/index.json 导致 Dotnet 还原失败
- php - 如何在保留 PHP 标记的情况下将 HTML 拆分为 N 个部分?
- sql - 查询中的差异过滤器
- docker - 使用我的 docker 映像显示注册表信息
- django - 使用redis作为会话后端时,django docker容器无法访问redis容器
- list - 需要在商品列表中显示 sku
- laravel - 为什么对连接的约束有效,但内部连接表的 whereRaw 子句不起作用?
- asp.net - .Net Core 2.1太慢网络下载文件失败问题