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, code completion uses JSDoc annotation tags for modules you add when creating the file. If you add modules later, or create the file without modules, you must add the corresponding JSDoc annotation tags manually to enable code completion.

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.1 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