ritwickdey / vscode-create-file-folder

A small vscode extension that help you to create files & folder in Atom Style.
https://marketplace.visualstudio.com/items?itemName=ritwickdey.create-file-folder
MIT License
35 stars 17 forks source link

Does not work with a multi project workspace #2

Open jbreckel opened 6 years ago

jbreckel commented 6 years ago

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.

toksdotdev commented 4 years ago

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;
}
4lch4 commented 2 years ago

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.