diff --git a/package.json b/package.json index c4b5089..b3f60c0 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,10 @@ { "command": "widgetbook-generator.generate.widget", "title": "Create widgetbook entry for this widget" + }, + { + "command": "widgetbook-generator.generate.directory", + "title": "Widgetbook: generate entry for each file in the directory" } ], "configuration": [ @@ -69,7 +73,16 @@ } } } - ] + ], + "menus": { + "explorer/context": [ + { + "command": "widgetbook-generator.generate.directory", + "group": "widgetbookGroup@1", + "when": "explorerResourceIsFolder" + } + ] + } }, "scripts": { "esbuild": "npm run esbuild-base -- --sourcemap", diff --git a/src/code_actions/widgetbook_entries.ts b/src/code_actions/widgetbook_entries.ts index 5326765..4ff4c7a 100644 --- a/src/code_actions/widgetbook_entries.ts +++ b/src/code_actions/widgetbook_entries.ts @@ -11,6 +11,10 @@ class WidgetbookEntriesCodeActions implements vscode.CodeActionProvider { command: "widgetbook-generator.generate.widget", title: "Create widgetbook entry for this widget", }, + { + command: "widgetbook-generator.generate.directory", + title: "Widgetbook: generate entry for each file in the directory", + }, ]; return commands.map((c) => {