Skip to content

Commit 09f4a71

Browse files
committed
(GH-732) Add PDK new function to the command palette
1 parent 3097c41 commit 09f4a71

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

package.json

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,11 @@
170170
"category": "Puppet",
171171
"title": "PDK New Fact"
172172
},
173+
{
174+
"command": "extension.pdkNewFunction",
175+
"category": "Puppet",
176+
"title": "PDK New Function"
177+
},
173178
{
174179
"command": "extension.puppetResource",
175180
"category": "Puppet",
@@ -270,6 +275,9 @@
270275
{
271276
"command": "extension.pdkNewFact"
272277
},
278+
{
279+
"command": "extension.pdkNewFunction"
280+
},
273281
{
274282
"command": "extension.puppetResource",
275283
"when": "editorLangId == 'puppet'"
@@ -305,15 +313,20 @@
305313
"command": "extension.pdkNewFact",
306314
"group": "pdk@5"
307315
},
316+
{
317+
"when": "editorLangId == 'puppet'",
318+
"command": "extension.pdkNewFunction",
319+
"group": "pdk@6"
320+
},
308321
{
309322
"when": "editorLangId == 'puppet' ",
310323
"command": "extension.pdkValidate",
311-
"group": "pdk@6"
324+
"group": "pdk@7"
312325
},
313326
{
314327
"when": "editorLangId == 'puppet'",
315328
"command": "extension.pdkTestUnit",
316-
"group": "pdk@7"
329+
"group": "pdk@8"
317330
},
318331
{
319332
"when": "editorLangId == 'puppet'",
@@ -349,14 +362,19 @@
349362
},
350363
{
351364
"when": "editorLangId == 'puppet'",
352-
"command": "extension.pdkValidate",
365+
"command": "extension.pdkNewFunction",
353366
"group": "pdk@5"
354367
},
355368
{
356369
"when": "editorLangId == 'puppet'",
357-
"command": "extension.pdkTestUnit",
370+
"command": "extension.pdkValidate",
358371
"group": "pdk@6"
359372
},
373+
{
374+
"when": "editorLangId == 'puppet'",
375+
"command": "extension.pdkTestUnit",
376+
"group": "pdk@7"
377+
},
360378
{
361379
"when": "editorLangId == 'puppet'",
362380
"command": "puppet.puppetShowNodeGraphToSide",

src/feature/PDKFeature.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export class PDKFeature implements IFeature {
4848
{ id: 'extension.pdkNewTask', request: 'pdk new task', type: 'Bolt task' },
4949
{ id: 'extension.pdkNewDefinedType', request: 'pdk new defined_type', type: 'Puppet defined_type' },
5050
{ id: 'extension.pdkNewFact', request: 'pdk new fact', type: 'Puppet Fact' },
51+
{ id: 'extension.pdkNewFunction', request: 'pdk new function', type: 'Puppet Function' },
5152
].forEach((command) => {
5253
context.subscriptions.push(
5354
vscode.commands.registerCommand(command.id, async () => {

src/messages.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export class PDKCommandStrings {
8080
static PdkNewClassCommandId = 'extension.pdkNewClass';
8181
static PdkNewTaskCommandId = 'extension.pdkNewTask';
8282
static PdkNewFactCommandId = 'extension.pdkNewFact';
83+
static PdkNewFunctionCommandId = 'extension.pdkNewFunction';
8384
static PdkNewDefinedTypeCommandId = 'extension.pdkNewDefinedType';
8485
static PdkValidateCommandId = 'extension.pdkValidate';
8586
static PdkTestUnitCommandId = 'extension.pdkTestUnit';

0 commit comments

Comments
 (0)