-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adopt StorageScope.WORKSPACE
and StorageTarget.USER
#183449
Comments
So in this scenario, environment B might be already open, and that's why we should listen to |
You need to listen for We had to do this kind of adoption for global state already back when settings sync got introduced. |
Can this be a June item? I will not get to it today. |
I suggest that we add a |
@connor4312 can you clarify what you mean, I am not sure I follow that reasoning. Why would you ever not want to react to storage changes? This issue is about workspace scoped storage. So far, it never changed unless through the component itself in the current window. With settings sync roaming workspace scope, it may now change when the synced data is applied. |
With the addition of a listener, I get events both for sync and as a result of the component itself making changes to the stored values. In the latter case, I now need to deal with deduplicating these events to avoid doing extra work. In some cases, doing this is simple, but in others it's a little more complex. For example, for breakpoint changes, we need to diff the array of breakpoints (or replace it) and trigger rendering as needed. The requisite diffing for every component and prone to error since it's not easy to locally test "continue working on" (as far as I know) If there was a |
I see the problem but I would argue that its good to deduplicate even when state comes in from a roamed session because it may not be any different from what is already there. |
Perhaps, but I would tend to replace for simplicity if I had that |
@rebornix I think that the search/replace text history and the findInput history both use |
@andreamah yes let's meet, I wonder if it can be handled by Update With that said, I wonder if it makes sense to transfer the find history though. It will increase the roaming data size but I'm not sure if we are adding enough value. |
That's true, perhaps if find isn't transferred, it makes sense for search to also not be transferred (and vice versa)? |
Currently, how much history do we store? |
@connor4312 is the addition of a |
It would definitely make adopting it way easier |
@joyceerhl, looked into tackling this for SCM history and need some guidance. Today, we store SCM history in
I believe we have to drop the repo history preserves across workspaces feature under this new model. Is this a fair assumption? I don't mind if so, I suspect most users won't either. Also, looking at this from the desired state perspective, and considering that we need to use type SCMHistory = { repositoryRoot: URI, history: string[] }[]; If that's the case, will those Thanks for your help! |
Yes this is all correct @joaomoreno and the |
SCM commit history done: #193142 Most work was in figuring out what the storage format would end up being and then writing the migration code. |
For microsoft#183449 Also adds the leak detector to debug tests and fixes some usages of it (microsoft#190503)
We now support transferring additional workspace-specific state beyond uncommitted changes in a Continue Working On transition, e.g. from web to a local clone but for the same repository like
microsoft/vscode
(ref #179898). This allows us to provide continuity when a user needs to work on the same repo while transitioning across different development environments.Ask: We generally want to transfer any state that is user-generated and ephemeral, such as user queries and drafted changes. Not all state needs to be transferred, and I've compiled an initial list that could make sense to adopt this for below. If I missed any or if you have any questions, please reach out.
Area owners:
Details: Your component can opt into this by using the
IStorageService
under theStorageScope.WORKSPACE
andStorageTarget.USER
combination to store and retrieve state based ononWillSaveState
andonDidChangeValue
, e.g.Any URIs in your stored object values that originated in another instance of VS Code but for the same workspace, e.g.
vscode-vfs
tofile
, will be automatically converted for you (if a conversion is possible) beforeonDidChangeValue
is emitted.Note: The key that you use to retrieve your state should not include non-portable data like URI paths or serialized URIs, since keys will not be automatically converted.
If you have any state already in the workspace and the restored state might step on it, as much as possible your component should try to merge that state (e.g. append new history to existing history) without showing the user a confirmation UI, since the goal is to provide a seamless transition. Again please reach out if this is infeasible.
The text was updated successfully, but these errors were encountered: