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 folder to workspace... dialog should support multiselection #9665

Closed
colin-grant-work opened this issue Jun 29, 2021 · 0 comments · Fixed by #9684
Closed

Add folder to workspace... dialog should support multiselection #9665

colin-grant-work opened this issue Jun 29, 2021 · 0 comments · Fixed by #9684
Assignees
Labels
multi-root issues related to multi-root support workspace issues related to the workspace

Comments

@colin-grant-work
Copy link
Contributor

The dialog that opens when you select the 'Add folder to workspace...' menu item should support multi-selection to facilitate adding multiple folders to a workspace simultaneously. The corresponding VSCode dialog does support multiple selection.

Feature Description:

The command is registered here:

registry.registerCommand(WorkspaceCommands.ADD_FOLDER, {
isEnabled: () => this.workspaceService.isMultiRootWorkspaceEnabled,
isVisible: () => this.workspaceService.isMultiRootWorkspaceEnabled,
execute: async () => {
const uri = await this.fileDialogService.showOpenDialog({
title: WorkspaceCommands.ADD_FOLDER.label!,
canSelectFiles: false,
canSelectFolders: true
});
if (!uri) {
return;
}
const workspaceSavedBeforeAdding = this.workspaceService.saved;
await this.addFolderToWorkspace(uri);
if (!workspaceSavedBeforeAdding) {
const saveCommand = registry.getCommand(WorkspaceCommands.SAVE_WORKSPACE_AS.id);
if (saveCommand && await new ConfirmDialog({
title: 'Folder added to Workspace',
msg: 'A workspace with multiple roots was created. Do you want to save your workspace configuration as a file?',
ok: 'Yes',
cancel: 'No'
}).open()) {
registry.executeCommand(saveCommand.id);
}
}
}
});

I tried a naive implementation just setting canSelectMany to true and setting up a loop over the selected URI's, but that didn't work immediately, so some additional modification of the workspace adding code is likely necessary.

@colin-grant-work colin-grant-work added multi-root issues related to multi-root support workspace issues related to the workspace labels Jun 29, 2021
@colin-grant-work colin-grant-work self-assigned this Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
multi-root issues related to multi-root support workspace issues related to the workspace
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant