-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Implement multiroot Open Folder command #10357
Conversation
0811a1b
to
4aecba6
Compare
Looks great, though I found a case where I'm getting some odd behavior
I believe that VSCode doesn't actually launch a second instance. You're first prompted to save your untitled workspace then it just swaps out the first workspace for the second |
Thanks for checking it out. I have pushed a patch that should handle this better. |
f457f2c
to
c11b8fc
Compare
@vince-fugnitto, @paul-marechal, to fix #10366 I've added an implementation of Alternatively, we could follow VSCode and just include the NodeJS Let me know what you think. |
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.
Thanks for checking it out. I have pushed a patch that should handle this better.
I just retested it but was still able to reproduce the issue in another configuration:
- Open a multi-root workspace
- Open a new window
- Open another multi-root workspace using
Open Folder
in that new window - The old window now uses the new multi-root workspace as well
Fair enough. The problem is that we always generate the same untitled workspace. VSCode uses a time-stamped system so that every new untitled workspace is distinct, presumably with some cleanup when you leave the workspace behind. I will implement something similar. |
3e25ea9
to
bea3dd0
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.
The changes look good to me:
- Enables selecting multiple folders when running
Open Folder
- Automatically creates an untitled workspace
- Displays a dialog asking to save untitled workspaces
The untitled workspace always containing a suffix (in the file explorer) isn't optimal, but I don't see a better way around that right now to prevent overwriting other untitled workspaces. I do have one suggestion, but that doesn't prevent this from getting merged.
9d87e39
to
cfe3ee9
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.
@colin-grant-work I noticed something:
- if no workspace is present, and we perform the
open folder...
with multiple folders, the dialog appears (which occurs on unload), selectingdon't save
will close the dialog and restart the application without a workspace present. In vscode this same use-case will open the untitled workspace which was my expectation as a user.
no-workspace.mp4
cfe3ee9
to
908aed9
Compare
@vince-fugnitto, thanks for the review and good catch. I've updated the code not to delete an untitled workspace file on exit, and instead added code to the backend WorkspaceServer that deletes untitled workspaces files that aren't in the top 10 most recent workspaces used. It's not foolproof: if you've kept an untitled workspace open while you've opened a bunch of other workspaces, and then your backend goes down and you have to restart, then the logic would delete that file even though it's still in use. If you have any suggestions for how to perform some cleanup without the risk of deleting a file in use, I'm happy to hear them. |
What it does
Fixes #10334 by adding handling for multiselection to the
Open Folder...
command.Fixes #10366 by implementing
resolveToAbsolute
for URI's.How to test
Review checklist
Reminder for reviewers
Signed-off-by: Colin Grant [email protected]