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
| From | Destination |
|---|---|
A resolved require() path or imported member | The module or member declaration selected by the cartridge context |
require('dw/…') or an API member | The bundled SFCC declaration |
module.superModule and its members | The corresponding parent implementation |
| A recognized custom attribute or preference access | Its 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 call | The indexed hook implementation |
A route name in URLUtils or a configured helper | Controller or pipeline route declarations |
| A template path in a recognized render call | Matching ISML templates |
| A resource key or bundle name | Matching properties entries or resource files |
| Supported hook, job-step, and custom-API configuration values | Their indexed script, export, or related configuration |
| Supported pipeline XML resource attributes | Pipeline, 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
/** @param {dw.catalog.Product} product */
function getLabel(product) {
return product.name || product.ID;
}
module.exports = { getLabel: getLabel };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
| Target | Indexed relationship |
|---|---|
| Route name | Recognized route calls and route declarations |
| Resource key | Matching bundle/key lookups and declarations |
| Metadata attribute | Recognized accesses linked to the object and attribute definition |
| Digital Script declaration | Imported symbols and consumers reached through supported importScript relationships |
| ISML variable | Uses 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
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 script | Entry | Kind and detail |
|---|---|---|
server.get, post, put, patch, delete, use, append, prepend or replace call | server.get Show | Method, SFCC controller route |
server.extend(module.superModule) | server.extend module.superModule | Method, SFCC controller inheritance |
var cache = require('...') and other top-level variables | cache | Variable |
function getPoints(product) {}, or a function assigned to a variable | getPoints | Function, with its parameters |
class declaration | The class with its constructor, methods and properties nested under it | Class |
module.exports = { ... } or another object literal | module.exports with each member nested under it | Object |
module.exports = server.exports() | module.exports | Variable |
SiteGenesis exports.Show = guard.ensure(...), or a function or function name assigned to exports.Show, in a controller | exports.Show | Method, SFCC controller route |
importPackage, importScript or importClass call | importScript int_loyalty:helpers/legacy.ds | Module (Class for importClass), SFCC import |
hooks.json registration | The hook name | Event, hooks.json -> <script> |
Endpoint in rest-apis/<api>/api.json | The endpoint name | Method, custom API <api> -> <schema> -> <implementation> |
Step type in steptypes.json (script-module-step, chunk-script-module-step, pipeline-step) | The @type-id | Function, 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
- The Outline follows the cursor. Clicking an entry moves the cursor to the start of the symbol, for a route the
servermethod, 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 orCtrl+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+Oon macOS orCtrl+Shift+Oon 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
Workspace symbol search
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
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 source | Name in the list | Description |
|---|---|---|
| SFRA route in a controller | Product-Show | SFCC 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-Show | SFCC route and the controller path |
| Pipeline start node | Product-Show | SFCC route and the pipeline path |
hooks.json registration | app.loyalty.points.calculate | hooks.json -> <script> and the hooks.json path |
| Custom API endpoint | redeemPoints | custom API <api> -> <schema> -> <implementation> and the api.json path |
steptypes.json step type | custom.ExportOrders | steptypes.json -> <module> and the steptypes.json path |
| Script declarations | Function, variable and class names | The script path |
- Selecting a route opens the controller with the cursor on the route's name, for example on
'Show'inserver.get('Show', ...) - Add a second word to narrow the results by their description:
Show app_storefront_basekeeps the routes declared inapp_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 asShow, 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 source | Features using it |
|---|---|
| Script exports and imports | Completion, definitions, references, signatures, diagnostics |
| Cartridge order and matching file paths | Overlay resolution and module.superModule |
| Controllers and pipeline XML | Route completion, navigation, callers, and route lenses |
hooks.json and implementation scripts | Hook names, known signatures, definition links, and hook lenses |
steptypes.json and step modules | Module/function completion and reverse registration links |
api.json, OpenAPI YAML, and handlers | Custom API wiring and cross-file navigation |
| ISML and resource bundles | Template paths, localized keys, resource references |
| Metadata and form XML | Generated declarations and source-definition mapping |
If a target looks wrong, follow Configuration & troubleshooting before changing source to match an unexpected suggestion