-
Install the RPG extension by Niels Liisberg
-
Install the Code Runner extension by Jun Han
-
Create an executable jar for executing MUTE tests (
rpgJavaInterpreter-core-mute-all.jar
) and put it in a directory of your choice -
Configure the Code Runner extension to execute this utility. The relevant portion of
settings.json
for that purpose is:
"code-runner.executorMap": {
"rpg": "cd $dir && java -DshowSourceAbsolutePath=true -jar /my/path/to/rpgJavaInterpreter-core-mute-all.jar $fileName",
},
"code-runner.clearPreviousOutput": true,
"code-runner.enableAppInsights": false,
"code-runner.saveAllFilesBeforeRun": true,
"code-runner.showExecutionMessage": false,
"code-runner.runInTerminal": true
(Note that the -DshowSourceAbsolutePath=true
option is for enable links to source file and line numbers.)
- Optionally configure some snippets to ease the editing of rpgle tests.
For example:
"MUTE equal": {
"prefix": "mue",
"body": [
"MU* VAL1($1) VAL2($2) COMP(EQ)"
],
"description": "MUTE annotation for equality"
}
Here you can find a rpg.json file, in order to configure the snippets for the RPG language in Visual Studio Code.
-
Run the code with one of these methods:
- use shortcut Ctrl+Alt+N
- or press F1 and then select/type Run Code,
- or right click the Text Editor and then click Run Code in editor context menu
- or click Run Code button in editor title menu
- or click Run Code button in context menu of file explorer
-
In order to ease fixed format typing, install Overtype by Adam Maras
Here is a screenshot on how the Visual Studio Code environment could work this way.
- To find more easily the right position of keywords in fixed format RPG files, you can add rulers to the editor. For example, in order to have a ruler at column 5, you could edit your
settings.json
this way:
At the end of this configuration, you should be able to execute the FizzBuzz TDD Kata in RPGLE with MUTEs.