vscode-create-file-folder icon indicating copy to clipboard operation
vscode-create-file-folder copied to clipboard

Does not work with a multi project workspace

Open jbreckel opened this issue 7 years ago • 2 comments

it always creates the folder/files in the first project.

Also selecting a folder to create the files there, creates them in the first project under the specified path.

jbreckel avatar Jan 26 '18 14:01 jbreckel

Also experiencing this issue. Please, do you mind looking into this?

Here is a simple code snippet that asks a user to select the workspace they want to execute the command in. You simply provide the text a user should see in the drop-down as a placeHolder param.

 
import { workspace, WorkspaceFolder, window } from "vscode";

export async function selectWorkspaceFolder(
  placeHolder: string
): Promise<WorkspaceFolder | null> {
  const workspaceFolders = workspace.workspaceFolders;
  if (!workspaceFolders) return null;
  if (workspaceFolders.length === 1) return workspaceFolders[0];

  const items = workspaceFolders.map(w => w.name);
  const choice = await window.showQuickPick(items, { placeHolder });
  return workspaceFolders.find(w => w.name === choice) || null;
}

toksdotdev avatar Nov 22 '19 11:11 toksdotdev

This problem is why I've slowly stopped using this extension, despite it being an amazing extension. @ritwickdey is there any hope of this being fixed or does it need to be assigned to someone else just so we can get this fixed?

EDIT: As soon as I posted this I realized that this repo seems dead... There have been no updates in the last 4 years :/ If I manage to get some spare time I'll try and fix it up and submit a PR. If I get no traction on the PR I'm likely going to fork this extension and publish my own version.

4lch4 avatar Dec 21 '21 19:12 4lch4