Using SuiteScript Code Completion in SuiteCloud IDE Plug-in for WebStorm

Code completion works by checking the source code around the cursor in the editor. Depending on where the caret is, a popup shows SuiteScript (and JavaScript) text options you can insert at the cursor.

When you create a new SuiteCloud project, both 1.0 and 2.x versions of SuiteScript APIs are added as external libraries to your project. The IDE plug-in reads the SuiteScript 1.0 and 2.x External Libraries to help check SuiteScript syntax and assist with entering functions, methods, SDF custom objects, and references.

For SuiteScript 1.0, code completion works natively. For SuiteScript 2.x, when you create a SuiteScript file and add SuiteScript modules, code completion is available for those modules through JSDoc annotation tags. If you don't add any SuiteScript modules when you create the file, code completion isn't available automatically. And if you add more SuiteScript modules after the file's been created, code completion won't work for those either.

Note:

Code completion of parameters, like record types, isn't supported.

A code completion example.

If you want code completion for modules you add after creating a SuiteScript file, you need to add JSDoc annotation tags manually and include the module names in the file.

To enable code completion for SuiteScript 2.x:

  1. In the define function of your SuiteScript file, add a dependency such as ['N/config'].

    An example of a dependency added in the define function.
    Note:

    To ensure you use the right name of the modules, see SuiteScript 2.x Modules.

  2. In the define function, add the module name as a JSDoc annotation tag. Use the same module name as before, but without the N/ prefix.

    An example of a module name added in the define funcion.
  3. In the function argument, add the module name without the N/ prefix.

    An example of a module name added in the function argument.

For more information, see the following topics:

Related Topics

General Notices