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

Function extract

__tests__/go-var-groups.test.ts:96–106  ·  view source on GitHub ↗
(backend: 'kernel' | 'wasm', source: string)

Source from the content-addressed store, hash-verified

94 });
95
96 function extract(backend: 'kernel' | 'wasm', source: string): ExtractionResult {
97 if (backend === 'wasm') {
98 process.env.CODEGRAPH_KERNEL = '0';
99 return extractFromSource('shapes/shapes.go', source, 'go');
100 }
101 delete process.env.CODEGRAPH_KERNEL;
102 process.env.CODEGRAPH_KERNEL_LANGS = 'all';
103 const result = tryKernelExtract('shapes/shapes.go', source, 'go');
104 expect(result, 'kernel extraction').not.toBeNull();
105 return result!;
106 }
107
108 const backends = kernelAvailable ? (['kernel', 'wasm'] as const) : (['wasm'] as const);
109

Callers 1

Calls 2

extractFromSourceFunction · 0.90
tryKernelExtractFunction · 0.90

Tested by

no test coverage detected