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

Function trigger

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

Source from the content-addressed store, hash-verified

217 return (await callArgumentsForFile(file.abs, file.language, [key])).get(siteKey(key)) ?? null;
218 },
219 async trigger(caller, site) {
220 // Not counted against the budget: the tree is already parsed for the
221 // site's guards, and a trigger lookup is a walk up from one node.
222 if (!site.line || !supportsBranchGuards(caller.language)) return null;
223 const file = resolve(caller);
224 if (!file) return null;
225 const key = { line: site.line, column: typeof site.column === 'number' ? site.column : null };
226 return (await triggersForFile(file.abs, file.language, [key])).get(siteKey(key)) ?? null;
227 },
228 async callSite(caller, site) {
229 if (!site.line || sites >= maxSites || !supportsBranchGuards(caller.language)) return null;
230 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