Skip to content

Commit f64358e

Browse files
authored
Merge pull request #269 from chrjorgensen/feature/upgrade-snippets-to-fall-2023-level
Upgrade snippets to Fall 2023 level
2 parents 09e0df5 + d0cca15 commit f64358e

File tree

1 file changed

+54
-1
lines changed

1 file changed

+54
-1
lines changed

schemas/rpgle.code-snippets

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
},
7272
"select": {
7373
"prefix": "select",
74-
"description": "The select group conditionally processes one of several alternative sequences of operations.",
74+
"description": "The SELECT group conditionally processes one of several alternative sequences of operations.",
7575
"body": [
7676
"select;",
7777
" when (${1});",
@@ -81,6 +81,20 @@
8181
"endsl;"
8282
]
8383
},
84+
"select-operand": {
85+
"prefix": "select-operand",
86+
"description": "The SELECT with operand group conditionally processes one of several alternative sequences of operations according to the value of the operand.",
87+
"body": [
88+
"select ${1:operand};",
89+
" when-is (${2:value});",
90+
" ${3:// handle first condition};",
91+
" when-in %list('${4:list-element 1}':'${5:list-element 2}');",
92+
" ${6:// handle second condition};",
93+
" other;",
94+
" ${7:// handle other conditions};",
95+
"endsl;"
96+
]
97+
},
8498
"variable": {
8599
"prefix": "dcl-s",
86100
"description": "Declare variable",
@@ -109,6 +123,17 @@
109123
"$0"
110124
]
111125
},
126+
"enumeration": {
127+
"prefix": "dcl-enum",
128+
"description": "Declare enumeration",
129+
"body": [
130+
"dcl-enum ${1:name} ${2:qualified};",
131+
" ${3:CONSTANT1} ${4:value1};",
132+
" ${5:CONSTANT2} ${6:value2};",
133+
"end-enum;",
134+
"$0",
135+
]
136+
},
112137
"prototype": {
113138
"prefix": "dcl-pr",
114139
"body": [
@@ -557,6 +582,13 @@
557582
],
558583
"description": "%KDS is allowed as the search argument for any keyed Input/Output operation (CHAIN, DELETE, READE, READPE, SETGT, SETLL) coded in a free-form group."
559584
},
585+
"%left": {
586+
"prefix": "%left",
587+
"body": [
588+
"%left(${1:string} : ${2:length})$0"
589+
],
590+
"description": "%LEFT returns the leftmost characters of a string."
591+
},
560592
"%len": {
561593
"prefix": "%len",
562594
"body": [
@@ -690,6 +722,13 @@
690722
],
691723
"description": "%OCCUR gets or sets the current position of a multiple-occurrence data structure."
692724
},
725+
"%omitted": {
726+
"prefix": "%omitted",
727+
"body": [
728+
"%omitted(${1:parameter_name})"
729+
],
730+
"description": "%OMITTED(parameter_name) returns *ON when *OMIT was passed. When %OMITTED(parameter_name) is true, the parameter must not be used."
731+
},
693732
"%open": {
694733
"prefix": "%open",
695734
"body": [
@@ -725,6 +764,13 @@
725764
],
726765
"description": "%PARSER is used as the third operand of the DATA-INTO operation code to specify the program or procedure to do the parsing, and any options supported by the parser."
727766
},
767+
"%passed": {
768+
"prefix": "%passed",
769+
"body": [
770+
"%passed(${1:parameter_name})"
771+
],
772+
"description": "%PASSED(parameter_name) returns *ON when the parameter was passed and not omitted. When %PASSED(parameter_name) is true, the parameter is available to be used."
773+
},
728774
"%proc": {
729775
"prefix": "%proc",
730776
"body": [
@@ -760,6 +806,13 @@
760806
],
761807
"description": "%REPLACE returns the character string produced by inserting a replacement string into the source string, starting at the start position and replacing the specified number of characters."
762808
},
809+
"%right": {
810+
"prefix": "%right",
811+
"body": [
812+
"%right(${1:string} : ${2:length})$0"
813+
],
814+
"description": "%RIGHT returns the rightmost characters of a string."
815+
},
763816
"%scan": {
764817
"prefix": "%scan",
765818
"body": [

0 commit comments

Comments
 (0)