featherbit UI
    Preparing search index...

    Function useContextSuggestions

    • Resolves the live $var/{{path}} suggestions for one node in the editor — every group (context statics/families and env), both triggers ('dollar' and 'brace'); see the module doc comment. Per-field filtering (by trigger, and by VarInput's templateMode) is the caller's job, not this hook's — one hook instance serves every field on the node regardless of that field's mode.

      See the module doc comment for the full data flow and the predecessorId undefined-vs-null encoding. Re-fetches whenever any input changes (in particular nodeId, when the selection moves).

      nodeId: null is the caller's signal that this selection needs no live preview at all — the node editor passes it for fixed/supernode/boundary nodes (listener, client, supernode instances, and the input/output/error boundary pseudo-nodes), which never render a VarInput popover to show a value in, anyway. run() below checks this last, immediately before the /api/debug/traces round trip, so the cheaper synchronous branches above it (supernode-definition canvas, debug-off, no-incoming-edge, no policy name) still take priority and keep their existing availability — this check only ever prevents a network call that would otherwise have fired. It reuses 'no-trace' for availability: no other value describes "this node was never eligible for a trace lookup" any better, and since no popover renders for these nodes the value is never actually shown to a user — it only flows through as the (unused) availability return for this hook's caller in that case.

      Parameters

      • args: {
            captureBodies: boolean;
            debugEnabled: boolean;
            kind: "policy" | "supernode";
            nodeId: string | null;
            policyName: string | null;
            predecessorId: string | null | undefined;
        }

      Returns { availability: Availability; catalog: VarEntry[]; suggestions: Suggestion[] }