Update: Code for IBM i Language Tools

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

For this article I am using:

New support for fixed format RPGLE

As an IBM i developer, you will probably need to work with older, fixed format RPG at some point. When you do, you’ll want to do it from within Code for i, so we started adding fixed format support about a month ago. For each feature discussed below, I’ve indicated if it currently handles fixed format.

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.

VS Code for i Outline View

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.

VS Code for i Content Assist

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 (as in the image below.)

VS Code for i Peek & Go

Works for:

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

Peek references

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

VS Code for i Peek References

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.

VS Code for i Linter

The linter 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 that you try the fixed-format outline view found in the RPGLE language tools settings, as well as checking out the RPGLE Free extension.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.