Automatic Extension Host Reload When Workspace Trust Is Revoked
0 reputation · 09 Apr 2023, 09:09 UTC
Goal: Make VS Code automatically unload the extension host and enforce untrusted-workspace restrictions when trust is revoked for a folder that is already open, without requiring a manual window reload.
Revoking trust through the workspace trust badge does not terminate the extension host that started while the workspace was trusted, nor does it undo extension state created during that trusted session. Extensions may also have written data outside the workspace before revocation, so revocation is not a complete data rollback. Exact enforcement can vary between VS Code Stable, Insiders, and platform builds, and enterprise policies may override user-controlled trust settings.
Should VS Code reload the window automatically when workspace trust is revoked for an open folder? Which extension host state should be invalidated immediately versus deferred to the next reload? What is the expected interaction between managed trust policies and an automatic reload?