Intellij SFCC labels every result with its cartridge, puts gutter icons on the strings that point to other files and makes the SFCC strings in your code work with Go to Declaration. To find entry points by name, see Search Everywhere. For the lenses above routes, hooks and step types, see Code Vision
hooks.json, Cmd+Click on the script of a system hook opens the function the hook runsThe cartridge on every result
Files from linked cartridges and modules show their cartridge on the right side of a result, with an icon for its kind: cartridge , B2C module or modules folder . Three copies of productHelpers.js become three clearly different rows. You see the label in:
- The All, Files and Symbols tabs of Search Everywhere and Go to File (
Cmd+Shift+O,Ctrl+Shift+N) - Choose Declaration when
Cmd+Clickhas more than one target - The lists a gutter icon opens, such as Choose Template
Routes, hooks, forms, resource keys and require targets in those lists get the same label. A custom attribute shows the metadata XML file that defines it instead. The label needs a valid license or trial
Controllers , models , forms , pipelines and ISML templates keep their own file icons, see Cartridges & Modules
Gutter icons
A gutter icon sits next to a string that points to another file and shows the icon of the file it opens, or a function icon when it opens a function
| File | Line | Tooltip | A click opens |
|---|---|---|---|
| JavaScript | The template of a render, renderTemplate, getRenderedHtml, sendEmail, template or Template call, such as res.render('cart/cart') | Navigate to template, or Navigate to template (2 cartridges) when several cartridges have it | The template. With several, Choose Template lists them in the order the server tries them |
hooks.json | script | Navigate to file, or Navigate to calculate for a system hook such as dw.order.calculate | The hook script, at the function a system hook runs |
steptypes.json | module | Navigate to file | The job step script |
steptypes.json | function and the chunk keys such as read-function | Navigate to and the function name, such as Navigate to execute | The function in the step's module. A function the module doesn't export gets no icon |
package.json | hooks, caches and each path in init | Navigate to file | The referenced file |
| Form XML | name of an <include> | Open billing.xml form | The copy of the included form in use: with a site selected in the Site Scope widget, the one from the first cartridge on that site's path, with Global scope the first in linked order |
| Form XML | The root <form> | Overrides newsletter.xml in app_storefront_base, Locale copies | The other copies of the form, see Forms |
site.xml, preferences.xml | <custom-cartridges>, the CustomCartridges preference | Edit Cartridge Path | The Cartridge Path Editor |
Custom API api.json | schema and implementation | Navigate to file | The schema, or the script with .js or .ds added |
Custom API api.json, schema.yaml and script | endpoint, each operation and the endpoint function | Custom API getPoints with its links in the other two files | The only link, or a list of them, see Custom APIs |
The script icons in hooks.json, steptypes.json and package.json open Choose Declaration when they have more than one target. ISML templates have their own icons for includes, decorators and modules, see ISML navigation
Turn each icon on or off in Settings › Editor › General › Gutter Icons: SFCC JavaScript template navigation, SFCC JSON script navigation, SFCC form includes, SFCC form overrides, SFCC form overridden by, SFCC form locale copies, SFCC cartridge path and SFCC custom API links
Go to Declaration
Cmd+Click or Cmd+B (Ctrl+Click or Ctrl+B) works on SFCC strings too:
| On | Goes to |
|---|---|
A require path | The module, see Module Resolution |
module.superModule | The file the current one overrides |
A route in URLUtils.url('...'), new URLAction('...'), server.append('...') or a helper from SFCC Route Calls | The route definitions and overrides |
| A template path | The ISML template |
An ISML custom tag such as <isproductprice> | The template of its <ismodule name="productprice" template="..."> in a modules.isml or module.isml template, current cartridge first, then your linked cartridge order |
| A resource key | The key in every locale file |
| A hook ID or hook function | The hooks.json entry or the exported function |
An importScript('app_core:checkout/Calculate.ds') path | The script under cartridge/scripts of the cartridge before the colon, or of the current cartridge when there is no prefix |
A form ID in server.forms.getForm('...') | The form XML |
| A custom attribute | Its definition in the metadata XML |
A hook name in hooks.json | For a system hook such as dw.ocapi.baskets.actions.afterMerge, the function its name ends with, here afterMerge. A custom hook lists every function its script exports. Without that function, the script opens |
| A path a JSON gutter icon opens | The same file, at the function a system hook runs |
function or a chunk key such as read-function in steptypes.json | The function of that name in the step's module, or the module when it has no such function |
endpoint, schema or implementation in a custom API api.json | The endpoint function and each operation of the schema, the schema, or the script, see Custom APIs |
A service ID in LocalServiceRegistry.createService('...'), ServiceRegistry.get('...'), configure or isConfigured | The <service> in the project's services XML, see IDs in scripts |
A credential ID in setCredentialID('...') | The <service-credential> |
A preference ID in getCustomPreferenceValue('...') or setCustomPreferenceValue('...') | The <preference> in the preferences XML, every instance type |
The type and key in CustomObjectMgr.getCustomObject('PaymentCountry', 'AT') | The <custom-object> of that type and key |
A pipeline opens in the Pipeline Editor first, so switch to its XML source tab
| In pipeline XML | Goes to |
|---|---|
start-name-ref on a call-node or jump-node | The start node in the Pipeline Editor, current cartridge first, then your linked cartridge order |
value of <config-property key="ScriptFile"> | The script under cartridge/scripts. A cartridge: prefix picks the cartridge, otherwise the current cartridge comes first |
name of a <template> | The ISML template. A dynamic="true" template names a pipeline dictionary key, so it has no target |
SFCC Contracts lists every call that is covered
In library and slot HTML of the site archive, a content link such as $url('Page-Show','cid','shipping-info')$ goes to its route, and its cid, fdid, cgid or pid value to the content asset, folder, category or product. images/hero.jpg?$staticlink$ goes to the static file, see Content links
Troubleshooting
| Symptom | What to do |
|---|---|
| No cartridge label on a result | The file is outside your linked cartridges and modules, or the license has expired |
| A gutter icon is missing | Check that the icon is on in Settings › Editor › General › Gutter Icons and that the license is valid. The JavaScript icon shows only when the template exists in a linked cartridge, the JSON icons only when the path resolves to a file, and a step type function icon only when the module exports that function |
Cmd+Click on a hooks.json script opens the file, not a function | Only system hooks such as dw.order.calculate open at a function |
| Too many rows in Choose Declaration | Read the cartridge label on the right. With a site selected, Site Scopes orders many lists by that site's cartridge path |
Related
Search Everywhere
Find every entry point by name in the B2C Entry Points tab
Code Vision
Lenses above routes, hooks, step types and cartridge paths
SFCC Contracts
Every string the plugin completes and resolves
Site Scopes
Order results by one site's cartridge path
Overrides
See every copy of the open file
ISML navigation
Gutter icons, Code Vision and Find Usages in templates