Code Completion

Context-aware autocomplete for the dw.* API, require paths, hooks, routes, templates, resource keys, and more

The language server offers completion that understands both the SFCC API and your project. Beyond ordinary member completion, it knows what belongs inside a require() string, a HookMgr.callHook() call, a URLUtils.url() route, a Resource.msg() key, and more - because it indexes those artifacts from your cartridges

Typing after product. lists the Product members from the bundled dw types; the highlighted item is resolved on demand and the details pane shows its signature and JSDoc

API & Member Completion

Full completion for the entire dw.* API surface and for anything the engine can type - local variables, imported modules, custom attributes, and standard JavaScript

var ProductMgr = require('dw/catalog/ProductMgr');
var product = ProductMgr.getProduct('p1');
product.        // ← Product methods, properties, and custom attributes

Completion items are resolved on demand: when you highlight an item, the server fills in its type signature and JSDoc documentation (including @param, @returns, and @deprecated tags) in the details pane

require() Path Completion

Start typing inside a require('…') string and the path is completed against the cartridge overlay

require('dw/')          // ← dw/catalog, dw/order, dw/system, …
require('dw/catalog/')  // ← ProductMgr, CatalogMgr, Category, …
require('*/cartridge/scripts/')   // ← files from every cartridge in the path
require('~/cartridge/scripts/')   // ← files from the current cartridge
require('./')     // ← files beside the current file
require('../')    // ← files one level up

Top-level cartridge names are completed too - start typing a cartridge name (e.g. app_) and matching cartridges are suggested. The same path completion is offered inside importScript('…')

Project-Aware Completion

These completion types are powered by the project indexes. They become available once the workspace has been indexed

Inside URLUtils.url('') the indexed routes complete by name; the detail tells whether a route is backed by a pipeline, an SFRA controller or a SiteGenesis controller

JSDoc Type Completion

Inside a JSDoc type expression, dw.* namespaces and common types complete - so typed JSDoc stays fast to write

/**
 * @param {dw.catalog.Product} product
 * @returns {dw.value.Money}
 */
function getPrice(product) { /* ... */ }
//        ^ inside { } you get dw.* namespace completion

ISML Expression Completion

Inside .isml templates, ${ … } expressions and <isscript> blocks get the same script completion described above, including pdict, Resource, URLUtils, variables from <isscript> blocks, and variables from <isset>. Loop variables from <isloop> are declared but untyped, so their members do not complete

<isscript>
    var ProductMgr = require('dw/catalog/ProductMgr');
    var product = ProductMgr.getProduct(pdict.pid);
</isscript>
<isprint value="${product.        }" />  <!-- ← Product member completion -->

See ISML LSP for the full ISML language support, and Scripting in ISML for how expressions and <isscript> blocks get this completion

Forms, dictionaries, and generated members

Completion also follows the project types behind these values:

ExpressionSource of members
product.customMetadata attribute definitions
site.getCustomPreferenceValue(…)Locally declared site-preference IDs and overloads
server.forms.getForm(…) and its resultForm XML and generated SFRA form types
args in a pipeline execute functionInput/output annotations
base assigned from module.superModuleThe next matching cartridge implementation

Pipeline XML also completes script resources, static templates, pipeline targets, types, and groups in recognized attribute contexts. See Pipeline scripts & XML

Trigger Characters

Completion is offered automatically as you type, and is re-triggered on the characters that matter for SFCC: " ' . / ~ @ - _ $ < : {. You can always force it with Ctrl+Space

Customizing Completion Contexts

The provider's context rules (which method calls trigger route, hook, template, and resource completion) are configurable via intellij-sfcc.completions.* settings - useful if your project wraps the standard APIs in helpers. See Configuration & troubleshooting for the full setting list and a wrapper example

On this page