Skip to content

Instantly share code, notes, and snippets.

@worksofliam
Last active February 16, 2022 18:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save worksofliam/66b8eb7904eefbd31c26e9ab9ca6ca1d to your computer and use it in GitHub Desktop.
Save worksofliam/66b8eb7904eefbd31c26e9ab9ca6ca1d to your computer and use it in GitHub Desktop.

Code for IBM i and RPGLE language tools has come a long way! I am excited to share some of the language tools improvements. They are absolutely worth talking about. Language tools is what makes writing code fun and exciting, and we can be better developers with them.

I am using:

  • Code for IBM i: this is used to connect to the IBM i, write and compile code (plus much more!)
  • RPGLE language tools: the part that adds all of these neat language features to VS Code.

Outline view

Shows all definitions, including file definitions. A very simply concept. Clicking on the item will take the user to the line of code where it is defined. Read more about the outline view in the VS Code documentation.

image

Works for:

  • Fixed format RPGLE
  • Mixed fixed/free RPGLE
  • Total free format RPGLE

Content assist

Provides content assist for all definitions (including. data structure subfields). As you type code, you may not remember what variable you need, or perhaps you want a glance at how a variable is defined: the content assist can help you do that.

image

Works for:

  • Fixed format RPGLE
  • Mixed fixed/free RPGLE
  • Total free format RPGLE

Peek & go to definition

Peek and go to definition is my favourite feature of all time (especially peek!). It can quickly show you, or take you, to where the chosen variables, struct, etc, is defined. I love peek because it opens the file up in line (like in the image below).

image

Works for:

  • Fixed format RPGLE
  • Mixed fixed/free RPGLE
  • Total free format RPGLE

Peek references

A simple and effective feautre that shows where instances of a variable are used.

image

Works for total free-format RPGLE.

Linter

The linter can do so much to make sure your developers are writing clean code. In the screenshot below, you can see the linter is showing that I've used the same string literal many times over. It also provides a quick fix, and can easily refactor them into a constant. You can read more about the linter on a previous post about it.

image

Works for total free-format RPGLE.

Final words

There are so many things you can do with VS Code to make writing RPGLE an absolute breeze. While this is the end of this post, it's not the end of functionality. I also recommend you try and find the fixed-format outline view in the RPGLE language tools settings, as well as checking out the RPGLE Free extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment