October 27

9 comments

How to install Visual Studio Code for IBM i

By NickLitten

October 27, 2021

IBM i on Power, IDE, studio, visual, vs-code

What is VISUAL STUDIO CODE?

Microsoft Visual Studio Code, “a free-editor that helps the programmer write code, helps in debugging and corrects the code using the intelli-sense method”:

Visual Studio Code is a lightweight but powerful source code editor which runs on your desktop and is available for Windows, macOS and Linux. It comes with built-in support for JavaScript, TypeScript and Node.js and has a rich ecosystem of extensions for other languages (such as C++, C#, Java, Python, PHP, Go) and runtimes (such as .NET and Unity).

The propeller heads at Microsoft
Code for ibm i

In normal terms, Visual Studio Code helps programmers to write program code in a free, open source code development environment.

Out of the box, Visual Studio Code supports almost every major programming language, for example, JavaScript, TypeScript, CSS, and HTML but more rich language extensions can be found in the VS Code Marketplace

Extend Visual Studio Code with Extensions

Extensions enable additional languages, themes, debuggers, commands, and more.

How to install visual studio code for ibm i 1

CS Code’s extension marketplace is growing vibrant community where developers share their secret sauce to improve source code development workflow.

What is the VISUAL STUDIO CODE extension for IBM i?

The IBM i Code extension adds support for IBM i Languages to the VS Code application.

Code for ibm i

For us IBM i Software Developers we can install Visual Studio Code and then download and install the IBM i extension from the VS Code Marketplace to add full DDS, CL and RPG support for this excellent code editor.

Once installed, Visual Studio Code now using the IBM i extension, enhances and improves the code editing experience in the style of full commercial tools like Rational Developer for IBM i.

Quite deliciously, it offers many of the commercial RDi advantages without the painful IBM price tag.

Install CODE for IBM i

(1) Install Microsoft Visual Studio Code

Grab the latest version from Visual Studio Code – Code Editing. Redefined

How to install visual studio code for ibm i 2

Installing Visual Studio Code is easy and straightforward:

How to install visual studio code for ibm i 3

Once you have it installed, setup the environment in your preferred layout with colour schemes and environment.

You can now use VS Code for writing your program source code with all the main languages.

How to install visual studio code for ibm i 4

But, we now want to add the ability to write code on our IBM i System, so let’s browse the language extensions.

(2) Install Code for IBM i from the Visual Studio Marketplace

Select your extension – starting with “CODE FOR IBM i” and dive straight in:

Install code for ibm i from the visual studio marketplace

After installing, note the instructions are all on the right hand side.

These show you how to connect to your IBM i system, open your first source file and edit your source code.

Make sure you setup your library list correctly the you can compile code too.

For example – connect to your IBM i like this:

Get connected

To connect to an IBM i:

  • The IP address or the hostname of the system
  • Your user profile name
  • Either a password or a SSH key

Code for IBM i connects to the system over SSH, so the SSH Daemon must be started on your IBM i:

STRTCPSVR SERVER(*SSHD)

After you install the Code for IBM i extension click the IBM i icon in the side bar, tThen click the “Connect to an IBM i” button:

Connect code for ibm i to your system

Complete the IBM i Login dialog (you need either a password or a private key). Next time you click on the IBM i icon you will see one or more IBM i servers:

Click your system name to connect and you will see your jobs *LIBL, a selected range of libraries to work with source files (default is QSYSINC) and an Integrated File System (IFS) browser if you wish to access source code that is stored in the IFS:

Connect success for code for ibm i to your system

Most sites store source code in Source File, even if more and more are moving to the IFS for future developments.

To access your your source code, add the library and source file that you want to edit on the left hand side. When you click on the file name it will show all the source members and you can easily jump to the source members that you want to edit by typing in the subset:

Select ibm i source file

Edit your source and dive into a clean modern code edit experience!

From old fashioned SEU

How to install visual studio code for ibm i 5

to a modern IDE:

Using visual studio code for ibm i to edit rpg

What would you prefer?

Great stuff!

    • From the CODE website — “Code for IBM i adds a new shortcut to compile the source code you’re currently working with. To show what compile options you have, you can use the Control + E shortcut (or Command + E on Mac). This will show a dropdown with the available Actions…” 🙂

  • Very thanks Nick! I use Visual Studio Code, but now i still prefer Rdi. I’ve a problem with Visual Studio Code, when I open my member that have a CCSSID *65535. In other case, all it’s perfect. What can i do for member in CCSID *65535?

    • Hello,

      had the same Problem,
      created a new PFSRC with CCSID 273 in my case and copied the Members into the new File.
      Now it works.

  • Is there a way to preserve the dates on the source lines? I notice it clears them out after each time getting in and making changes.

  • MIght u know why I don’t have any “library list” options of any type of browsers into my iseries. I did start the TCP server…I was able to connect..but nothing is available on the explorer to the right side.

  • I use Code for IBM I also but for one client the plugin doesn’t show me the members in QSYS. It does shows me the libraries. IFS is no problem at all.
    Anybody an idea what the problem could be?

  • {"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

    Join the IBM i Community for FREE Presentations, Lessons, Hints and Tips

    >