-
Notifications
You must be signed in to change notification settings - Fork 12
Fix issues surrounding persisted workspaces. #18
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
Conversation
c149443
to
f97ca76
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
woohoo! 🎉 (thanks for letting me pair on this and see how you figured it out!)
src/vs/workbench/browser/web.main.ts
Outdated
const folder = toWorkspaceFolder(recent.folderUri); | ||
workspace.folders = [folder]; | ||
|
||
window.history.replaceState(null, '', `?folder=${encodePath(folder.uri.path)}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ Does this mean that if you open localhost:8080
(without passing a folder via the CLI), it will check for a recent folder and then append that as a query param to the URL?
(followup: what's the reason for doing this? Is this so the open folder is always in the URL or something else)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. This ensures the user gets a URL which matches the format generated by VS Code when they explicitly open a new folder. It also lets them share a link to a specific folder which is especially useful now that this state is stored in the browser.
- Moved URI helper.
f97ca76
to
5b733b1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woohoo!
👏 Thanks for leaving detailed comments like this and explaining the why behind our changes.
This PR addresses coder/code-server#4487, specifically extending VS Code’s existing desktop workspace behaviors to the browser. This may also address
—ignore-last-opened
by making the new tab behavior match the user’s initial path arguments.https://github.com/cdr/vscode/blob/c1494438479e8382794576f2c621081d52b4fdc1/src/vs/workbench/browser/web.main.ts#L223-L243