Skip to content

Commit 02091a8

Browse files
authored
Merge pull request #336 from metafacture/302-addExtensionSnippets
Add extension snippets for all do binds
2 parents 6250389 + 8fb3ebc commit 02091a8

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

metafix-vsc/fix.snippets.json

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
11
{
2-
"do bind": {
3-
"prefix": ["do"],
4-
"body": ["do ${1:collector}(${2:args})", "\t${0:body}", "end"],
5-
"description": "A do bind changes the execution context of the body functions. They are executed for each element in the list."
2+
"do list": {
3+
"prefix": ["do list"],
4+
"body": ["do list(path: \"${1:<sourceField>}\", \"var\": \"${4:<variableName>}\")", "\t${0:body}", "end"],
5+
"description": "Iterates over each element of an array. In contrast to Catmandu, it can also iterate over a single object or string."
6+
},
7+
"do list_as": {
8+
"prefix": ["do list_as"],
9+
"body": ["do list_as(\"${1:<variableName_1>}\": \"${2:<sourceField_1>}\")", "\t${0:body}", "end"],
10+
"description": "Iterates over each named element of an array (like do list with a variable name). If multiple arrays are given, iterates over the corresponding elements from each array (i.e., all elements with the same array index, skipping elements whose arrays have already been exhausted)."
11+
},
12+
"do once": {
13+
"prefix": ["do once"],
14+
"body": ["do once(\"${1:<blockName>}\")", "\t${0:body}", "end"],
15+
"description": "Executes the statements only once (when the bind is first encountered), not repeatedly for each record."
16+
},
17+
"do put_macro": {
18+
"prefix": ["do put_macro"],
19+
"body": ["do put_macro(\"${1:<macroName>}\")", "\t${0:body}", "end"],
20+
"description": "Defines a named macro, i.e. a list of statements that can be executed later with the call_macro function."
621
}
722
}

metafix-vsc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "fix",
33
"displayName": "fix",
44
"description": "Language Support for Metafacture Fix (Xtext Language Server for Metafacture Fix). For more information, visit https://metafacture.org",
5-
"version": "0.2.1",
5+
"version": "0.3.0",
66
"publisher": "metafacture",
77
"license": "Apache-2.0",
88
"engines": {

0 commit comments

Comments
 (0)