Skip to content

Latest commit

 

History

History
64 lines (45 loc) · 2.67 KB

visual_studio_code.md

File metadata and controls

64 lines (45 loc) · 2.67 KB

Configuring Visual Studio Code for running rpgle tests

  1. Install the RPG extension by Niels Liisberg

  2. Install the Code Runner extension by Jun Han

  3. Create an executable jar for executing MUTE tests (rpgJavaInterpreter-core-mute-all.jar) and put it in a directory of your choice

  4. 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.)

  1. 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.

  1. 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
  2. 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.

Visual Studio Code for RPG

  1. 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.jsonthis way:

"[rpg]": { "editor.rulers": [5] },

At the end of this configuration, you should be able to execute the FizzBuzz TDD Kata in RPGLE with MUTEs.