From 3b8b986b01f16f44c68428fd2eee2d3d68c25981 Mon Sep 17 00:00:00 2001 From: Christian Jorgensen Date: Thu, 19 Oct 2023 23:44:45 +0200 Subject: [PATCH 1/4] Add snippets for %passed and %omitted --- schemas/rpgle.code-snippets | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/schemas/rpgle.code-snippets b/schemas/rpgle.code-snippets index 121f0cfa..9add16ef 100644 --- a/schemas/rpgle.code-snippets +++ b/schemas/rpgle.code-snippets @@ -690,6 +690,13 @@ ], "description": "%OCCUR gets or sets the current position of a multiple-occurrence data structure." }, + "%omitted": { + "prefix": "%omitted", + "body": [ + "%omitted(${1:parameter_name})" + ], + "description": "%OMITTED(parameter_name) returns *ON when *OMIT was passed. When %OMITTED(parameter_name) is true, the parameter must not be used." + }, "%open": { "prefix": "%open", "body": [ @@ -725,6 +732,13 @@ ], "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." }, + "%passed": { + "prefix": "%passed", + "body": [ + "%passed(${1:parameter_name})" + ], + "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." + }, "%proc": { "prefix": "%proc", "body": [ From 94ef96cd29cae05b7fed14356c9b948bc0562629 Mon Sep 17 00:00:00 2001 From: Christian Jorgensen Date: Fri, 20 Oct 2023 00:03:43 +0200 Subject: [PATCH 2/4] Add snippet for SELECT with operand --- schemas/rpgle.code-snippets | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/schemas/rpgle.code-snippets b/schemas/rpgle.code-snippets index 9add16ef..d35af6c8 100644 --- a/schemas/rpgle.code-snippets +++ b/schemas/rpgle.code-snippets @@ -71,7 +71,7 @@ }, "select": { "prefix": "select", - "description": "The select group conditionally processes one of several alternative sequences of operations.", + "description": "The SELECT group conditionally processes one of several alternative sequences of operations.", "body": [ "select;", " when (${1});", @@ -81,6 +81,20 @@ "endsl;" ] }, + "select-operand": { + "prefix": "select-operand", + "description": "The SELECT with operand group conditionally processes one of several alternative sequences of operations according to the value of the operand.", + "body": [ + "select ${1:operand};", + " when-is (${2:value});", + " ${3:// handle first condition};", + " when-in %list('${4:list-element 1}':'${5:list-element 2}');", + " ${6:// handle second condition};", + " other;", + " ${7:// handle other conditions};", + "endsl;" + ] + }, "variable": { "prefix": "dcl-s", "description": "Declare variable", From a85152bcc8d8b00a4743f0d2b2b7bb24e6831ec1 Mon Sep 17 00:00:00 2001 From: Christian Jorgensen Date: Fri, 20 Oct 2023 00:17:34 +0200 Subject: [PATCH 3/4] Add snippets for %left and %right --- schemas/rpgle.code-snippets | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/schemas/rpgle.code-snippets b/schemas/rpgle.code-snippets index d35af6c8..574fd890 100644 --- a/schemas/rpgle.code-snippets +++ b/schemas/rpgle.code-snippets @@ -571,6 +571,13 @@ ], "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." }, + "%left": { + "prefix": "%left", + "body": [ + "%left(${1:string} : ${2:length})$0" + ], + "description": "%LEFT returns the leftmost characters of a string." + }, "%len": { "prefix": "%len", "body": [ @@ -788,6 +795,13 @@ ], "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." }, + "%right": { + "prefix": "%right", + "body": [ + "%right(${1:string} : ${2:length})$0" + ], + "description": "%RIGHT returns the rightmost characters of a string." + }, "%scan": { "prefix": "%scan", "body": [ From d0cca152d32591d26b79991e4c43f1510fe96619 Mon Sep 17 00:00:00 2001 From: Christian Jorgensen Date: Fri, 20 Oct 2023 00:31:37 +0200 Subject: [PATCH 4/4] Add snippet for enumeration --- schemas/rpgle.code-snippets | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/schemas/rpgle.code-snippets b/schemas/rpgle.code-snippets index 574fd890..d03d17e1 100644 --- a/schemas/rpgle.code-snippets +++ b/schemas/rpgle.code-snippets @@ -123,6 +123,17 @@ "$0" ] }, + "enumeration": { + "prefix": "dcl-enum", + "description": "Declare enumeration", + "body": [ + "dcl-enum ${1:name} ${2:qualified};", + " ${3:CONSTANT1} ${4:value1};", + " ${5:CONSTANT2} ${6:value2};", + "end-enum;", + "$0", + ] + }, "prototype": { "prefix": "dcl-pr", "body": [