iModernize - IBM i Modernization and Development Blog by Profound Logic Software

Profound Pro Tips: Profound.js API Intellisense in Visual Studio Code

Written by Tim Losee | Jun 11, 2018 10:56:28 PM

Profound Pro Tips is a blog series focused on issues that our support team receives and questions our Profound Logic customers have. Don't see your question/concern in Profound Pro Tips? Please feel free to contact our team or leave us a comment below. 

Today’s Topic: How to access the Profound.js API via Intellisense with Visual Studio Code.

Keep reading to learn more....

As of Profound.js 4.2.8, when you are developing with Visual Studio Code you will now have access to the Profound.js API via the Intellisense. If you are unsure what the Intellisense is, it is a tool used to help you understand references in your code. For example, when you are writing JavaScript, it can list available functions, variables, and many other things. Intellisense is also known as a content-assist. 

Step one to utilizing Intellisense and to find all references to your APIs when writing in your Profound.js module, you must require the 'profoundjs' module in your script like in the example below:


(figure 1)

After that, any time you reference the 'pjs' namespace VSCode will prompt you with a list of Profound.js methods available for you to use (See figure 2). VSCode will also show you their parameters and a short description of the API.

(figure 2)

VSCode is especially helpful when working with the Profound.js SQL API's. The 'pjs.prepare()' API returns an object which has more functions and in an object-orientated world, you could compare the 'prepare' function to a constructor and the return object being a new class with methods. 


(figure 3)

When you reference the object (class), you will get a list of methods available from within that object. As you start to type the list of parameters, VSCode will tell you what the parameter type is and also give you a detailed description of that parameter type.

                     (figure 4)

Hopefully this easy-to-use tool can help you when developing your code in Visual Studio Code.

*NOTE: To be able to use the Profound.js API through Intellisense with Visual Studio Code, you must have Version 6 of Profound UI downloaded. *

Click the link to get started with Visual Studio Code.

Learn how to Make Modern Applications That You Will Love With IBM i RPG and Node.js with Profound UI and Profound.js! Watch the replay of this webinar hosted by Alex Roytman and Liam Allan TODAY!