Skip to content

Commit

Permalink
feat: support multiselect in 'Add to Workspace'
Browse files Browse the repository at this point in the history
Signed-off-by: Trae Yelovich <[email protected]>
  • Loading branch information
traeok committed Nov 18, 2024
1 parent 7143336 commit 3e5a605
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/zowe-explorer/src/trees/shared/SharedUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,10 @@ export class SharedUtils {
): void {
const workspaceFolders = vscode.workspace.workspaceFolders;
const selectedNodes = SharedUtils.getSelectedNodeList(node, nodeList);
const urisToAdd: {
name: string;
uri: vscode.Uri;
}[] = [];
for (const item of selectedNodes) {
let resourceUri = item.resourceUri;
const isSession = SharedContext.isSession(item);
Expand All @@ -327,10 +331,12 @@ export class SharedUtils {
continue;
}

vscode.workspace.updateWorkspaceFolders(workspaceFolders?.length ?? 0, null, {
uri: resourceUri,
urisToAdd.push({
name: `[${item.getProfileName()}] ${SharedContext.isDatasetNode(item) ? (item.label as string) : item.fullPath}`,
uri: resourceUri,
});
}

vscode.workspace.updateWorkspaceFolders(workspaceFolders?.length ?? 0, null, ...urisToAdd);
}
}

0 comments on commit 3e5a605

Please sign in to comment.