Coming from a Microsoft background, I chose VSCode instead of Eclipse as my IDE for SuiteScript development. I have another article on using VSCode + NetSuite-Sync to publish SuiteScript to the cloud. In that article, I failed to mention how to make VSCode aware of the SuiteScript API methods.
First, I’ll point out that when I started NetSuite-Sync was my only option for direct publishing of SuiteScript to the cloud. However, a second option exists today, NetSuite Upload. As of this post, there were only 735 installs of NetSuite Upload, but the limited number of reviews looked very positive.
Personally, I’m happy with NetSuite-Sync. It was quirky to install (see my other post for instructions) but it works great.
What I failed to mention in my previous post was how to make VSCode aware of the SuiteScript APIs. If you don’t do this step, you are forced to refer to the developer guides every time you write an API call.
Here are the 2 things to remember when hooking up VSCode and NetSuite APIs:
- Download the API definitions
- Add a jsconfig.json file to your workspace
First, the API definitions.
Documents >> Files >> SuiteScripts
Notice the links in the upper right of the screen.
Pick your flavor of choice and then save that .js file to your VSCode workspace.
Second, create a jsconfig.js file in the same root directory of your VSCode workspace. Mine is super simple.
That’s it! Now when you start typing an API method call, VSCode will help with auto-complete. And when you select a method, VSCode is aware of the parameters and can present some documentation on the fly.
Here is a SuiteAnswers Article that discusses non-Eclipse IDEs.
Working with IDEs Other Than SuiteCloud IDE Plug-ins
4 thoughts on “VSCode Intellisense for SuiteScript”
Suitescript 1.0 is working but not for SuiteScript 2.0
for SuiteScript 2.0 the modules are in separate files/folders
Unlike SuiteScript 1.0 API which is just one file SuiteScript 2.0 API are included in one folder. @Kevin, do I need to update the jsconfig.json file to add the path to the API files?
LikeLiked by 1 person
For anyone still looking for a solution to the 2.0 API issue, please check out SuiteSnippets in VS Codes Extension marketplace. It’s an extension I built to solve this issue specifically.