Hover & Signature Help

SFCC API documentation on hover, live parameter hints while you call functions, and inlay hints for parameter names and types in VS Code

The language server surfaces the SFCC API's documentation right where you are typing - no switching to the docs site to remember a method signature or what an argument expects

Hover

Hover over a symbol to see a formatted card with its kind, type signature, and documentation

Hovering getOrder shows the method declaration and its API documentation as Markdown; links point at the referenced types and the @param, @returns, @see and @throws tags follow
var OrderMgr = require('dw/order/OrderMgr');
OrderMgr.getOrder('00001');
//       ^ hover shows the signature and JSDoc for getOrder()

A hover card includes:

  • Kind & signature - e.g. (method) OrderMgr.getOrder(orderNo: string): Order
  • Documentation - the official JSDoc description, rendered as Markdown, with @param, @returns, @example, and @deprecated tags
  • Resolved links - {@link …} references in the docs become clickable

Hover works on the whole dw.* API, on your own functions and variables (showing their inferred types and any JSDoc you wrote), and on symbols brought in via require() or importScript

Signature Help

As you fill in a function call, signature help pops up to show the parameter list and highlights the argument you are currently typing

Typing the comma opens signature help for the matching Resource.msg overload with the current argument in bold; moving the caret to another argument switches the highlight and its @param text
var URLUtils = require('dw/web/URLUtils');
URLUtils.url('Product-Show', 'pid', product.ID);
//           └─ signature help shows each parameter and bolds the active one

Signature help:

  • Triggers automatically on ( and ,, and can be re-invoked with Cmd/Ctrl+Shift+Space
  • Shows per-parameter documentation pulled from @param tags
  • Steps through overloads when an API method has more than one signature
  • Works for the dw.* API and for your own JSDoc-documented functions

Inlay Hints

Inlay hints display non-editable context between your source tokens. Enable Editor: Inlay Hints Enabled in VS Code to show the hints supplied by the scripting service

Once the semantic project is ready, the server's inlay hints appear as editor overlays: the inferred return type after the declaration and parameter names before each argument
Hint categoryCurrent server defaults
Parameter names at call sitesEnabled for all parameter categories, subject to the TypeScript service's placement rules
Function-like return typesEnabled
Property declaration typesEnabled
Inferred variable typesDisabled
/** @param {number} amount @param {string} currency */
function formatAmount(amount, currency) {
    return amount.toFixed(2) + ' ' + currency;
}

var label = formatAmount(50, 'USD');

The call can display amount: and currency: next to its arguments, and the function can display its inferred return type. Those labels are editor overlays, not text inserted into the file. Explicit annotations or redundant names can affect which hints appear

Inlay hints wait for the semantic project to be ready. The SFCC server has its own hint preferences; changing the built-in TypeScript extension's preferences does not necessarily change these defaults

On this page