vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Preserve workspace UI state when duplicating workspace

Open featherfly opened this issue 2 years ago • 7 comments

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.61.0
  • OS Version: windows 7

Steps to Reproduce:

  1. create a worksapce
  2. enable or disable some extensions for this workspace
  3. save workspace as or duplicate workspace to a new workspace
  4. open the new workspace
  5. extensions enabled state and disabled state is not synchronized

featherfly avatar Nov 07 '21 06:11 featherfly

We have code to migrate over workspace settings when entering a workspace and the current workspace is a folder:

https://github.com/microsoft/vscode/blob/4ed0329e9c5e12e2c7c59697facc96020b0768ab/src/vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService.ts#L332-L335

We also have code to migrate workspace storage:

https://github.com/microsoft/vscode/blob/4ed0329e9c5e12e2c7c59697facc96020b0768ab/src/vs/workbench/services/workspaces/electron-sandbox/workspaceEditingService.ts#L167

Not sure why this would not work then, @sandy081 please chime in.

bpasero avatar Nov 07 '21 07:11 bpasero

Hm, I see, we probably do not trigger this when you are in a workspace and you save it or duplicate it. Since the workspace file contains the settings, they are properly duplicated. But the UI state is not. Maybe we can migrate those over too...

bpasero avatar Nov 07 '21 07:11 bpasero

Actually I cannot reproduce the issue at least when using "File > Save Workspace As..." and we do migrate settings and state in that case:

https://github.com/microsoft/vscode/blob/4ed0329e9c5e12e2c7c59697facc96020b0768ab/src/vs/workbench/services/workspaces/electron-sandbox/workspaceEditingService.ts#L167

@featherfly can you provide exact steps for the scenario where you save a workspace as?

bpasero avatar Nov 08 '21 06:11 bpasero

my vscode version is update to 1.62.0 i try it again save workspace as it work ok duplicate workspace the ui state is not sync (click duplicate workspace , extensions panel in the auto opend vscode is not sync the ui state)

featherfly avatar Nov 08 '21 08:11 featherfly

Ok thanks, yeah that is expected the way it is implemented.

bpasero avatar Nov 08 '21 08:11 bpasero

@bpasero Can I take a look at this? I've been searching for opportunities to collaborate in Open Source

AlenDavid avatar Jun 02 '22 13:06 AlenDavid

Please see https://github.com/microsoft/vscode/wiki/How-to-Contribute. Specifically this item is not open for help as I think the implementation would be a bit more complex then I am willing to review.

bpasero avatar Jun 03 '22 05:06 bpasero

We closed this issue because we don't plan to address it in the foreseeable future. If you disagree and feel that this issue is crucial: we are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding, and happy coding!

VSCodeTriageBot avatar Dec 06 '22 13:12 VSCodeTriageBot