Microsoft/vscode

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

Open

#149 041 ouverte le 8 mai 2022

Voir sur GitHub
 (1 commentaire) (2 réactions) (1 assigné)TypeScript (10 221 forks)batch import
bughelp wantedwebview-views

Métriques du dépôt

Stars
 (74 848 stars)
Métriques de merge PR
 (Merge moyen 11h 43m) (1 000 PRs mergées en 30 j)

Description

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?

Guide contributeur