Adapt VS Code’s Workspace state restoration feature to Che world #148
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.
What does this PR do?
As I described in eclipse-che/che#21813 (comment), VS Code's Workspace state restoration feature doesn't work exactly as the Che user would expect. In short: VS Code manages the Workspaces states by the Workspace internal ID (actually URI) ignoring the fact that different DevWorkspaces can host the VS Code Workspaces with the same internal ID. That leads to such problems as described in eclipse-che/che#21813.
This PR adapts VS Code’s Workspace state restoration feature to Che in such a way that VS Code manages its Workspaces states by
DevWorkspace ID + VS Code Workspace's internal ID
.More technical details
With this patch, Che-Code will start including the DevWorkspace ID in VS Code's Workspace ID. As the VS Code Workspace's internal ID is used as a corresponding Database's name suffix in the browser's IndexedDB Storage, these change leads to VS Code Workspace Storage save data not only per VS Code Workspace internal ID, but per a combination of
DevWorkspace ID + VS Code Workspace's internal ID
What issues does this PR fix?
eclipse-che/che#21813
How to test this PR?
quay.io/che-incubator-pull-requests/che-code:pr-148-amd64
or use my test project https://github.com/azatsarynnyy/java-spring-petclinic/tree/ws-storage.