Navigation & Symbols

Follow definitions, inspect references, and search script and SFCC symbols across cartridge source and configuration

Navigation connects a use to its declaration, and a declaration to its indexed consumers. For SFCC, that includes relationships expressed through strings, XML, JSON, and properties files as well as ordinary JavaScript symbols

Definitions and implementation targets

Use Go to Definition (F12) or Peek Definition from the editor's context menu

FromDestination
A resolved require() path or imported memberThe module or member declaration selected by the cartridge context
require('dw/…') or an API memberThe bundled SFCC declaration
module.superModule and its membersThe corresponding parent implementation
A recognized custom attribute or preference accessIts metadata XML definition
A generated form field, or the name in server.forms.getForm('name')The form XML or field definition
A hook name or function in a recognized hook callThe indexed hook implementation
A route name in URLUtils or a configured helperController or pipeline route declarations
A template path in a recognized render callMatching ISML templates
A resource key or bundle nameMatching properties entries or resource files
Supported hook, job-step, and custom-API configuration valuesTheir indexed script, export, or related configuration
Supported pipeline XML resource attributesPipeline, script, or template targets

Some contexts return several matching declarations, allowing VS Code to show a definition list. Other contexts resolve a selected implementation. Do not interpret a list of matching files as proof of which version is deployed; cartridge order determines the override relationship

References across module boundaries

Use Go to References / Find All References (Shift+F12) to inspect indexed consumers

References on an exported property list the export itself and every recognized call through require, here labels.getLabel in productTile.js
cartridge/scripts/helpers/productLabels.js
/** @param {dw.catalog.Product} product */
function getLabel(product) {
    return product.name || product.ID;
}

module.exports = { getLabel: getLabel };
cartridge/scripts/helpers/productTile.js
var labels = require('*/cartridge/scripts/helpers/productLabels');

/** @param {dw.catalog.Product} product */
function toTile(product) {
    return { id: product.ID, label: labels.getLabel(product) };
}

module.exports = { toTile: toTile };

Find references to the getLabel export to inspect matching call sites. The server supplements TypeScript's symbol references with SFCC-aware handling for CommonJS exports, Digital Script imports, and other indexed relationships

References to an export also include ISML templates that load the module with require() in an <isscript> block and read the export in a script block or a ${ … } expression, see Find template usages from scripts

References beyond JavaScript symbols

TargetIndexed relationship
Route nameRecognized route calls and route declarations
Resource keyMatching bundle/key lookups and declarations
Metadata attributeRecognized accesses linked to the object and attribute definition
Digital Script declarationImported symbols and consumers reached through supported importScript relationships
ISML variableUses of modeled variables across script blocks and expressions in the template, and in the templates it is connected to, see Variables across templates

References describe statically recognized local usage. Dynamic string concatenation, computed property access, unrelated workspaces, or code available only on a sandbox can fall outside the results. A zero count is not a safe-delete guarantee

For hooks, custom APIs, and job steps, use the dedicated CodeLens links to trace registrations and implementations; not every SFCC relationship is exposed through the generic references action

Document outline and breadcrumbs

The Outline view, the breadcrumbs above the editor and Go to Symbol in Editor read the same document symbols from the language server. In a controller every SFRA route is its own entry, named after the server method and the route: server.get('Show', ...) is listed as server.get Show with the detail SFCC controller route, and server.extend(module.superModule) as server.extend module.superModule with SFCC controller inheritance. When the controller keeps require('server') in another variable, such as var s = require('server'), the entries use that name: s.get Show

Routes, the superModule extension and top-level requires appear in the Outline and the breadcrumbs. The Outline follows the cursor, a click jumps to a route and the breadcrumb picker previews each symbol before you open it

Because the method stays in the name, an overlay's server.append Show reads differently from the base cartridge's server.get Show, and append, prepend and replace routes are easy to tell apart in a long controller

In a scriptEntryKind and detail
server.get, post, put, patch, delete, use, append, prepend or replace callserver.get ShowMethod, SFCC controller route
server.extend(module.superModule)server.extend module.superModuleMethod, SFCC controller inheritance
var cache = require('...') and other top-level variablescacheVariable
function getPoints(product) {}, or a function assigned to a variablegetPointsFunction, with its parameters
class declarationThe class with its constructor, methods and properties nested under itClass
module.exports = { ... } or another object literalmodule.exports with each member nested under itObject
module.exports = server.exports()module.exportsVariable
SiteGenesis exports.Show = guard.ensure(...), or a function or function name assigned to exports.Show, in a controllerexports.ShowMethod, SFCC controller route
importPackage, importScript or importClass callimportScript int_loyalty:helpers/legacy.dsModule (Class for importClass), SFCC import
hooks.json registrationThe hook nameEvent, hooks.json -> <script>
Endpoint in rest-apis/<api>/api.jsonThe endpoint nameMethod, custom API <api> -> <schema> -> <implementation>
Step type in steptypes.json (script-module-step, chunk-script-module-step, pipeline-step)The @type-idFunction, steptypes.json -> <module> (the pipeline for a pipeline step)

Only top-level statements become entries. Route middleware, the route callback and functions declared inside other functions are not listed

Jump to a symbol in the file

Go to Symbol in Editor lists every route of the controller by its server method. Typing filters by name, @: groups routes and variables, and the editor previews each symbol before Enter jumps to it
  • The Outline follows the cursor. Clicking an entry moves the cursor to the start of the symbol, for a route the server method, and brings it near the top of the editor when it was out of view
  • Click the last breadcrumb, or press Cmd+Shift+. on macOS or Ctrl+Shift+. on Windows/Linux, to open the symbol picker. It shows each entry with its detail, previews the focused symbol in the editor and opens it on Enter
  • Run Go to Symbol in Editor with Cmd+Shift+O on macOS or Ctrl+Shift+O on Windows/Linux. Type to filter by name, or type : after the @ to group the entries by kind, so routes appear under methods and the required modules under variables

Run Go to Symbol in Workspace with Cmd+T on macOS or Ctrl+T on Windows/Linux and type part of a name. The index covers the cartridges in your workspace, so you can jump to a route, hook or helper without knowing which cartridge declares it

Go to Symbol in Workspace finds SFRA routes by their Controller-action name in every cartridge, along with hooks.json hooks, custom API operations and script functions, and opens the controller right at the route

Routes are listed by their route name: the controller file name, a hyphen and the action, such as Product-Show. That is the name URLUtils.url() takes, and each declaring cartridge gets its own row

Indexed sourceName in the listDescription
SFRA route in a controllerProduct-ShowSFCC route and the controller path, such as SFCC route • app_storefront_base/cartridge/controllers/Product.js
SiteGenesis action, such as exports.Show = guard.ensure(...)Product-ShowSFCC route and the controller path
Pipeline start nodeProduct-ShowSFCC route and the pipeline path
hooks.json registrationapp.loyalty.points.calculatehooks.json -> <script> and the hooks.json path
Custom API endpointredeemPointscustom API <api> -> <schema> -> <implementation> and the api.json path
steptypes.json step typecustom.ExportOrderssteptypes.json -> <module> and the steptypes.json path
Script declarationsFunction, variable and class namesThe script path
  • Selecting a route opens the controller with the cursor on the route's name, for example on 'Show' in server.get('Show', ...)
  • Add a second word to narrow the results by their description: Show app_storefront_base keeps the routes declared in app_storefront_base
  • Routes are also listed under their outline names, such as server.append Show, whether the controller is open or not. Searching by the action name, such as Show, finds both rows

Smart Search offers dedicated pickers for routes, hooks, step types, custom APIs and resource keys, with row actions such as Open Endpoint and Copy Endpoint URL for routes. See Smart Search

What connects the files

Local sourceFeatures using it
Script exports and importsCompletion, definitions, references, signatures, diagnostics
Cartridge order and matching file pathsOverlay resolution and module.superModule
Controllers and pipeline XMLRoute completion, navigation, callers, and route lenses
hooks.json and implementation scriptsHook names, known signatures, definition links, and hook lenses
steptypes.json and step modulesModule/function completion and reverse registration links
api.json, OpenAPI YAML, and handlersCustom API wiring and cross-file navigation
ISML and resource bundlesTemplate paths, localized keys, resource references
Metadata and form XMLGenerated declarations and source-definition mapping

If a target looks wrong, follow Configuration & troubleshooting before changing source to match an unexpected suggestion

On this page