In a project with many cartridges the same file name shows up again and again, and a route like Cart-Show can be defined in one cartridge and extended in two more. Intellij SFCC adds SFCC results to Search Everywhere, labels every result with its cartridge and puts gutter icons on the strings that point to other files
Search Everywhere
Press Shift twice to open Search Everywhere and type part of a route or hook name. On the All tab the plugin adds two groups
| Group | Finds | Each result shows | Opens |
|---|---|---|---|
| SFCC Routes | Routes whose full name contains what you type, for example cart-sh for Cart-Show | The route and how it is defined: get, post, use, append, prepend or replace for SFRA, the guard settings such as get:https for SiteGenesis controllers, or the node type for pipelines | The line that defines or extends the route. A pipeline start node opens in the Pipeline Editor on that node |
| SFCC Hooks | Hook IDs from your cartridges' hooks.json files, for example app.payment.processor | The hook ID and the script it points to | The hook's entry in hooks.json |
A base route and its overrides sit side by side, so Cart-Show lists the get in app_storefront_base next to the append in app_custom. With a site scope selected, results follow that site's cartridge order
The groups need a valid license or trial, a linked cartridge and finished indexing
The cartridge on every result
Files from linked roots show their cartridge on the right side of a result, with an icon for its kind: cartridge , B2C module or modules folder . You see it in Search Everywhere, Go to File and in the Choose Declaration list when Cmd+Click has more than one target. Five copies of productHelpers.js become five clearly different rows
Controllers , models , forms , pipelines and ISML templates keep their own file icons in the results too, see Cartridges & Modules
Gutter icons
| File | Line | Icon | Opens |
|---|---|---|---|
| JavaScript | res.render, ISML.renderTemplate, getRenderedHtml, sendEmail, new Template with a known template | Navigate to template | The template |
| ISML | template on <isinclude>, <isdecorate> and <ismodule> | Navigate to template | The template |
hooks.json | script | Navigate to file | The hook script |
steptypes.json | module | Navigate to file | The job step script |
package.json | hooks, caches, init | Navigate to file | The referenced file |
| Form XML | <include name="..."> | "Open billing.xml form" | The included form |
When the target exists in several cartridges, the icon opens Choose Declaration with one row per cartridge
Go to Declaration
Cmd+Click or Cmd+B (Ctrl+Click or Ctrl+B) works on the SFCC strings as well as on code:
| On | Goes to |
|---|---|
A require path | The module, see Module Resolution |
module.superModule | The file the current one overrides |
A route in URLUtils.url('...') or server.append('...') | The route definitions and overrides |
| A template path | The ISML template |
| A resource key | The key in every locale file |
| A hook ID or hook function | The hooks.json entry or the exported function |
A form ID in server.forms.getForm('...') | The form XML |
| A custom attribute | Its definition in the metadata XML |
SFCC Contracts lists every call that is covered
Troubleshooting
| Symptom | What to do |
|---|---|
| No SFCC Routes or SFCC Hooks group | Check the license, link a cartridge and wait for indexing. The groups only show once you type something |
| A route is missing | Its controller isn't in a controllers folder of a linked cartridge, or the pipeline isn't in a pipelines folder. Routes are read from server.* calls, exports.<Name> = assignments and pipeline start nodes |
| No cartridge label on a result | The file is outside your linked cartridges and modules |
| Too many results for a common name | Select a site scope, or type a longer part of the route such as Cart-Show |