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.
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.
Works for:
- Fixed format RPGLE
- Mixed fixed/free RPGLE
- Total free format RPGLE
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.
Works for:
- Fixed format RPGLE
- Mixed fixed/free RPGLE
- Total free format RPGLE
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).
Works for:
- Fixed format RPGLE
- Mixed fixed/free RPGLE
- Total free format RPGLE
A simple and effective feautre that shows where instances of a variable are used.
Works for total free-format RPGLE.
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.
Works for total free-format RPGLE.
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.