From 4f0dc75f0cc75f7f36d538722781dcea58a1f922 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20BOURREAU?= Date: Fri, 3 Mar 2023 16:56:13 +0100 Subject: [PATCH 1/2] add snippets --- schemas/rpgle.code-snippets | 39 ++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/schemas/rpgle.code-snippets b/schemas/rpgle.code-snippets index 08304049..764e014d 100644 --- a/schemas/rpgle.code-snippets +++ b/schemas/rpgle.code-snippets @@ -22,6 +22,17 @@ "endif;" ] }, + "ifelse": { + "prefix": "ifelse", + "description": "If else block", + "body": [ + "if (${1});", + " $0", + "else;", + " ", + "endif;" + ] + }, "dow": { "prefix": "dow", "description": "Do while", @@ -49,9 +60,18 @@ "endfor;" ] }, + "foreach": { + "prefix": "foreach", + "description": "The FOR-EACH operation begins a group of operations to process the items in the array, sub-array, or %LIST one at a time.", + "body": [ + "for-each ${1:variable} in %list('':'');", + " $0", + "endfor;" + ] + }, "select": { "prefix": "select", - "description": "Select block", + "description": "The select group conditionally processes one of several alternative sequences of operations.", "body": [ "select;", " when (${1});", @@ -111,6 +131,23 @@ ], "description": "Create prototype for external program" }, + "monitor": { + "prefix": "monitor", + "body": [ + "monitor;", + "on-excp '';", + "on-error;", + "endmon;" + ], + "description": "The monitor group performs conditional error handling based on the exception message or status code." + }, + "snd-msg": { + "prefix": "snd-msg", + "body": [ + "snd-msg ${1|*INFO,*ESCAPE|} ${2:%TARGET(${3|*SELF,*CALLER,program-or-procedure|})) };" + ], + "description": "The SND-MSG operation sends an informational message or an exception message. The message can be sent to any procedure on the call stack, including the current procedure. The message appears in the joblog after it is sent." + }, "%abs": { "prefix": "%abs", "body": [ From 896517d7990c4bd9c1d3344ba7d976e360810efd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20BOURREAU?= Date: Sat, 4 Mar 2023 13:56:57 +0100 Subject: [PATCH 2/2] add snippet --- schemas/rpgle.code-snippets | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/schemas/rpgle.code-snippets b/schemas/rpgle.code-snippets index 764e014d..f3251ac2 100644 --- a/schemas/rpgle.code-snippets +++ b/schemas/rpgle.code-snippets @@ -131,6 +131,15 @@ ], "description": "Create prototype for external program" }, + "subroutine": { + "prefix": "begsr", + "body": [ + "begsr $1;", + " $0", + "endsr;" + ], + "description": "Create subroutine." + }, "monitor": { "prefix": "monitor", "body": [