Skip to content

Commit cd91567

Browse files
authored
Merge pull request #737 from da-ar/new-fact
(GH-732) Add additional PDK 2.0 functions: fact and function
2 parents e9e3005 + 09f4a71 commit cd91567

File tree

3 files changed

+44
-4
lines changed

3 files changed

+44
-4
lines changed

package.json

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,16 @@
165165
"category": "Puppet",
166166
"title": "PDK New Defined type"
167167
},
168+
{
169+
"command": "extension.pdkNewFact",
170+
"category": "Puppet",
171+
"title": "PDK New Fact"
172+
},
173+
{
174+
"command": "extension.pdkNewFunction",
175+
"category": "Puppet",
176+
"title": "PDK New Function"
177+
},
168178
{
169179
"command": "extension.puppetResource",
170180
"category": "Puppet",
@@ -262,6 +272,12 @@
262272
{
263273
"command": "extension.pdkNewDefinedType"
264274
},
275+
{
276+
"command": "extension.pdkNewFact"
277+
},
278+
{
279+
"command": "extension.pdkNewFunction"
280+
},
265281
{
266282
"command": "extension.puppetResource",
267283
"when": "editorLangId == 'puppet'"
@@ -292,15 +308,25 @@
292308
"command": "extension.pdkNewDefinedType",
293309
"group": "pdk@4"
294310
},
311+
{
312+
"when": "editorLangId == 'puppet'",
313+
"command": "extension.pdkNewFact",
314+
"group": "pdk@5"
315+
},
316+
{
317+
"when": "editorLangId == 'puppet'",
318+
"command": "extension.pdkNewFunction",
319+
"group": "pdk@6"
320+
},
295321
{
296322
"when": "editorLangId == 'puppet' ",
297323
"command": "extension.pdkValidate",
298-
"group": "pdk@5"
324+
"group": "pdk@7"
299325
},
300326
{
301327
"when": "editorLangId == 'puppet'",
302328
"command": "extension.pdkTestUnit",
303-
"group": "pdk@6"
329+
"group": "pdk@8"
304330
},
305331
{
306332
"when": "editorLangId == 'puppet'",
@@ -331,14 +357,24 @@
331357
},
332358
{
333359
"when": "editorLangId == 'puppet'",
334-
"command": "extension.pdkValidate",
360+
"command": "extension.pdkNewFact",
335361
"group": "pdk@4"
336362
},
337363
{
338364
"when": "editorLangId == 'puppet'",
339-
"command": "extension.pdkTestUnit",
365+
"command": "extension.pdkNewFunction",
340366
"group": "pdk@5"
341367
},
368+
{
369+
"when": "editorLangId == 'puppet'",
370+
"command": "extension.pdkValidate",
371+
"group": "pdk@6"
372+
},
373+
{
374+
"when": "editorLangId == 'puppet'",
375+
"command": "extension.pdkTestUnit",
376+
"group": "pdk@7"
377+
},
342378
{
343379
"when": "editorLangId == 'puppet'",
344380
"command": "puppet.puppetShowNodeGraphToSide",

src/feature/PDKFeature.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ export class PDKFeature implements IFeature {
4747
{ id: 'extension.pdkNewClass', request: 'pdk new class', type: 'Puppet class' },
4848
{ id: 'extension.pdkNewTask', request: 'pdk new task', type: 'Bolt task' },
4949
{ id: 'extension.pdkNewDefinedType', request: 'pdk new defined_type', type: 'Puppet defined_type' },
50+
{ id: 'extension.pdkNewFact', request: 'pdk new fact', type: 'Puppet Fact' },
51+
{ id: 'extension.pdkNewFunction', request: 'pdk new function', type: 'Puppet Function' },
5052
].forEach((command) => {
5153
context.subscriptions.push(
5254
vscode.commands.registerCommand(command.id, async () => {

src/messages.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ export class PDKCommandStrings {
7979
static PdkNewModuleCommandId = 'extension.pdkNewModule';
8080
static PdkNewClassCommandId = 'extension.pdkNewClass';
8181
static PdkNewTaskCommandId = 'extension.pdkNewTask';
82+
static PdkNewFactCommandId = 'extension.pdkNewFact';
83+
static PdkNewFunctionCommandId = 'extension.pdkNewFunction';
8284
static PdkNewDefinedTypeCommandId = 'extension.pdkNewDefinedType';
8385
static PdkValidateCommandId = 'extension.pdkValidate';
8486
static PdkTestUnitCommandId = 'extension.pdkTestUnit';

0 commit comments

Comments
 (0)