Reconnect orphaned webviews after extension host restart/crash #226069
+74
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Basically when the extension re-registers the webview provider and we detect an open webview editor that isn't registered in
MainThreadWebviewPanels
and is not dirty, we "reconnect" to it, by reinitialized it. Handling a dirty one is left for later consideration, as in that case, reinitializing it will likely lead to data loss AFAIK? Though maybe not, depending on if the state is saved on VS Code's renderer side in the model or elsewhere and if this is enough to restore it correctly.Part of #225410 #84142 and likely other duplicates or other PR proposing a solution, continues from #225985, so you will also see the commits from it until it is merged or I rebase this branch.