Skip to content
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

add _workbench.enterWorkspace #54129

Merged
merged 1 commit into from
Jul 13, 2018
Merged

add _workbench.enterWorkspace #54129

merged 1 commit into from
Jul 13, 2018

Conversation

bpasero
Copy link
Member

@bpasero bpasero commented Jul 12, 2018

Related to #35109 (but not a full fix for it). Fixes #54335

This enables LiveShare to enter a workspace without window reload:

vscode.commands.executeCommand('_workbench.enterWorkspace', vscode.Uri.file('<path to workspace file'));

This is not a general mechanism for switching without window reload, it only works best if the target workspace was never opened before, because:

  • untitled files in the target workspace will not be merged with the current windows untitled files (they will end up as new untitled files in an empty window)
  • the UI state is overwritten from the current workspace into the target workspace
  • no UI state from the target workspace is restored

As a result of calling this command, the extension host will still restart.

/cc @egamma

@bpasero bpasero added this to the July 2018 milestone Jul 12, 2018
@bpasero bpasero requested a review from sandy081 July 12, 2018 06:43
@@ -144,6 +144,10 @@ export class WorkspaceEditingService implements IWorkspaceEditingService {
return false;
}

enterWorkspace(path: string): TPromise<void> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be we should move entering workspace API to IWorkspaceContextService? Because I think having these APIs in IWorkspaceEditingService does not fit good to me.

If agreed, I will tackle it in the next debt week

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sandy081 yeah, but there are more methods like createAndEnterWorkspace and saveAndEnterWorkspace which then should also move. I am all up for not having that in the editing service if possible.

@sandy081
Copy link
Member

LGTM

@bpasero bpasero merged commit f729419 into master Jul 13, 2018
@bpasero bpasero deleted the ben/workspace branch July 13, 2018 09:31
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a command to enter a workspace without window reload
2 participants