Support multiselection in 'Add Folder to Workspace...' dialog#9684
Merged
colin-grant-work merged 1 commit intomasterfrom Jul 14, 2021
Merged
Support multiselection in 'Add Folder to Workspace...' dialog#9684colin-grant-work merged 1 commit intomasterfrom
colin-grant-work merged 1 commit intomasterfrom
Conversation
msujew
reviewed
Jul 1, 2021
msujew
approved these changes
Jul 1, 2021
Member
msujew
left a comment
There was a problem hiding this comment.
Looks good to me. I can confirm that the changes allow to select multiple folders in the browser and Electron (Ubuntu) environment.
48efa1b to
80f6db0
Compare
vince-fugnitto
approved these changes
Jul 5, 2021
Member
vince-fugnitto
left a comment
There was a problem hiding this comment.
I confirmed that the behavior works as intended:
- verified without a
*.theia-workspacefile present and adding multiple roots - verified with a previous
*.theia-workspacefile present and adding multiple roots - adding a single workspace root works as before
Signed-off-by: Colin Grant <colin.grant@ericsson.com>
80f6db0 to
abc51a9
Compare
vince-fugnitto
approved these changes
Jul 13, 2021
Member
vince-fugnitto
left a comment
There was a problem hiding this comment.
The changes work for me 👍
Comment on lines
+372
to
375
| async addRoot(uris: URI[] | URI): Promise<void> { | ||
| const toAdd = Array.isArray(uris) ? uris : [uris]; | ||
| await this.spliceRoots(this._roots.length, 0, ...toAdd); | ||
| } |
Member
There was a problem hiding this comment.
I believe it can be simplified to:
async addRoot(...uris: URI[]): Promise<void> {
await this.spliceRoots(this._roots.length, 0, ...uris);
}Calls like the following are allowed:
await this.workspaceService.addRoot(...workspaceFolders);
await this.workspaceService.addRoot(uri);But I won't nitpick :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Colin Grant colin.grant@ericsson.com
What it does
Fixes #9665 by allowing multiple selection in the workspace dialog and ensuring that the public methods 'addRoot' and 'removeRoots' (and new method
addRoots) don't return before the._rootsfield of theWorkspaceServicehas been updated. Previously, changes to the workspace would emit an event that would trigger anupdateWorkspacecycle, but since that method is also asynchronous, it was guaranteed not to have finished its work in the tick afteraddRootandremoveRootsresolved, meaning that evenawaiting those methods didn't guarantee that theWorkspaceServicewas ready for another call.How to test
...context menu in the explorer).Review checklist
Reminder for reviewers