Digital Script is the server script language of Salesforce B2C Commerce: JavaScript that Rhino runs, with importPackage, importClass and importScript, for each loops, E4X and type annotations. Intellij SFCC makes it a native IDE language, so .ds files and the server .js files of your cartridges get the syntax, scope and checks the server applies
.ds files, server .js files and templates. Not set uses the mode of the code version last activated from the B2C explorer, and the comment names itExplore Digital Script
Syntax & Compatibility Mode
Rhino forms, E4X, and the syntax your code version can run
Import Calls
What importPackage, importClass and importScript bind, script paths, navigation and require
Optimize Imports
Remove unused and repeated import calls, on demand or on the fly
Scopes & Types
The server scope, host objects, unresolved names, annotations and loop types
Pipelets & Script Nodes
Typed pdict, the pipeline contract and Script nodes of the Pipeline Editor
Editing Digital Script
Structure, folding, quick documentation, live templates, new files, intentions and colors
Digital Script Inspections
Every Digital Script check with its message and quick fix
Which files are Digital Script
| Files | Parsed as |
|---|---|
.ds | Digital Script, always. The file type is Digital Script |
.js inside a cartridge folder | Digital Script while Parse cartridge .js as Digital Script is on, the default. The file type stays JavaScript, so ESLint, Prettier and the debugger still treat it as JavaScript |
.js under cartridge/client, cartridge/static, cartridge/js, cartridge/front-end or cartridge/front, in node_modules, and every .mjs or .cjs file | JavaScript |
${...} and <isscript> in templates | The template dialect of Digital Script: E4X members parse, XML literals don't, see Scripting in ISML |
The client folders count only right under cartridge, so cartridge/scripts/js is still server code
The first start after the update moves *.ds from the JavaScript file type to Digital Script, once. If you map .ds back to JavaScript later, the IDE keeps your choice
require paths, module.superModule and custom attributes work in .ds files as in server .js files, see JavaScript
Settings
Options are in Settings › Languages & Frameworks › Digital Script. Project options are saved in .idea/intellij-sfcc-script.xml, so the team can share them
| Group | Option | What it does |
|---|---|---|
| Runtime | Script compatibility mode | The mode of the site's code version, from Business Manager › Administration › Site Development › Code Deployment. Syntax that mode can't run is an error in .ds files, server .js files, ${...} and <isscript>. Not set uses the mode of the code version last activated from the B2C explorer, see Where the mode comes from |
| Server JavaScript | Parse cartridge .js as Digital Script | On. Server scripts accept the Rhino forms B2C Commerce runs, such as for each (var item in items). Turning it off reparses them as JavaScript. .ds files are always Digital Script |
| Imports | Optimize imports on the fly | Off, for you only. Removes unused and repeated import calls as you edit, see Optimize Imports |
Script compatibility mode moved here from the ISML page. One mode covers templates, .ds and server .js files. A mode picked on the ISML page before 2026.3 counts until you pick one here, and the ISML page now shows the mode with a Change on the Digital Script page link
The other Digital Script options sit with their features:
| Where | What |
|---|---|
| Editor › Inspections › SFCC › Digital Script | The checks, see Digital Script Inspections |
| Editor › Color Scheme › Digital Script | Rhino keywords, type annotations, imports, E4X and pipelet headers, see Colors |
| Editor › Intentions › SFCC/Digital Script | Five intentions, see Intentions |
| Editor › Live Templates › Digital Script | Seven live templates, see Live templates |
| Editor › File and Code Templates | The Digital Script group of the New dialog's templates |
| Editor › Inlay Hints › Code vision › Digital Script | The lens above functions that other scripts use through importScript |
| Editor › General › Code Folding › B2C Commerce Scripts | Resource.msg() messages, which shows Resource.msg calls as their text, see Folding |
Free and licensed
A license change applies at once, without a restart:
| Free | Needs a license or trial |
|---|---|
| The Digital Script file type and parsing, Rhino forms included | Import calls: binding, completion, links, gutter icons and Code Vision |
| Highlighting, with the type annotation, import call and pipelet header colors | The imported name and pdict key colors |
| The compatibility mode check, its fixes and the Rhino syntax checks | Every other Digital Script inspection, Optimize Imports and on the fly |
| Live templates, the New Digital Script File dialog, File Structure and folding | Quick documentation, E4X and pdict completion, and the intentions |
Type annotations, and for each over Script API collections | E4X types, loops over maps, arrays and XML, the function scope of a block const, and pipelet, hook and job step parameter types |
| Dictionary rows of Script nodes in the Pipeline Editor | ScriptFile links in pipeline XML |
See Purchase & License for the trial
Works while the IDE indexes
Parsing, highlighting, folding, the compatibility mode check and the Rhino syntax checks work while the IDE indexes. importScript targets, imported names and the checks that read other files answer once indexing ends. Until then, Name that nothing declares leaves unresolved names to the IDE's own warning
From the plugin's performance tests:
| Task | Time |
|---|---|
| Parsing a 5,000-line script | 23 ms, against 33 ms as plain ES6 |
Typing 1,000 for each variables in one highlighting pass | 242 ms |
First completion after ProductMgr. | 91 ms |
| Go to Declaration on an imported function | 2.4 ms |
| Find Usages of a function 100 scripts import | 11.7 ms |
| Highlighting a 1,600-line script that imports 4 packages, a class and 10 scripts | 802 ms |
The plugin parses all 199 SiteGenesis scripts and 207 SFRA server scripts without a parse error
What isn't covered
- Expression closures, legacy generators,
letblocks and array comprehensions don't parse yet - After
importScript, static properties of an imported function, such asResourceHelper.getConstants(), don't resolve - Job step
parametersstaysObject: the parameter definitions insteptypes.jsonaren't read, and thedw.system.Statusreturn isn't checked - The Pipeline Editor reads dictionary rows only from
.dsscripts, and doesn't show the header descriptions - Call Hierarchy doesn't list top-level calls in template code, and Analyze Data Flow isn't available
Troubleshooting
| Symptom | What to do |
|---|---|
A .ds file opens as JavaScript or text | Make sure *.ds belongs to Digital Script in Settings › Editor › File Types |
for each or an XML literal is an error in a server .js file | Turn on Parse cartridge .js as Digital Script, and check that the file isn't in a client folder |
| Template literals or arrow functions are errors | Set Script compatibility mode to your code version's mode, see Compatibility mode |
| Imported names don't resolve or complete | Import calls need a license or trial, and indexing must finish |
Cannot find script on an importScript path that exists | Add the cartridge: prefix. Without one, only the calling script's cartridge is searched, see Script paths |
| An import call stays after Optimize Imports | It's used, its script doesn't resolve, or it's used as a value, see What stays |
| Optimize imports on the fly removes nothing | It waits while the caret is on the import calls or the file has errors, and needs the Unused or repeated import call inspection on |
| A Script node has no dictionary rows | Rows come from the header of a .ds script. A .js pipelet gets none, see Script nodes |