MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / trigger

Function trigger

src/ui-server/api/when.ts:199–207  ·  view source on GitHub ↗
(caller, site)

Source from the content-addressed store, hash-verified

197 return (await callArgumentsForFile(file.abs, file.language, [key])).get(siteKey(key)) ?? null;
198 },
199 async trigger(caller, site) {
200 // Not counted against the budget: the tree is already parsed for the
201 // site's guards, and a trigger lookup is a walk up from one node.
202 if (!site.line || !supportsBranchGuards(caller.language)) return null;
203 const file = resolve(caller);
204 if (!file) return null;
205 const key = { line: site.line, column: typeof site.column === 'number' ? site.column : null };
206 return (await triggersForFile(file.abs, file.language, [key])).get(siteKey(key)) ?? null;
207 },
208 async callSite(caller, site) {
209 if (!site.line || sites >= maxSites || !supportsBranchGuards(caller.language)) return null;
210 const file = resolve(caller);

Callers

nothing calls this directly

Calls 5

supportsBranchGuardsFunction · 0.90
triggersForFileFunction · 0.90
siteKeyFunction · 0.90
resolveFunction · 0.70
getMethod · 0.65

Tested by

no test coverage detected