Microsoft/vscode

`retainContextWhenHidden` does not work with `when` clauses for Webview Views

开放

#149,041 创建于 2022年5月8日

 (1 条评论) (2 个反应) (1 位负责人)TypeScript (39,847 个派生)batch import
bughelp wantedwebview-views

仓库指标

星标
 (184,936 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

Does this issue occur when all extensions are disabled?: (This scenario only applies to extensions)

  • VS Code Version: 1.67.0-insider
  • OS Version: Windows 10

Steps to Reproduce:

  1. Register a custom view provider with vscode.window.registerWebviewViewProvider and the option retainContextWhenHidden: true
  2. Add a when clause for the view in package.json
  3. Observe that when the panel is hidden due to the view context, the context is not retained and the panel needs to reload

I noticed also that manually hiding the panel (e.g. right clicking in a panel and deselecting the view) will retain the context. Would it be possible to do something similar or at least providing an API/command to programmatically trigger the same hiding mechanism?

贡献者指南