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

Function extract

__tests__/go-shadowed-function-value.test.ts:159–169  ·  view source on GitHub ↗
(backend: 'kernel' | 'wasm', source: string)

Source from the content-addressed store, hash-verified

157 });
158
159 function extract(backend: 'kernel' | 'wasm', source: string): ExtractionResult {
160 if (backend === 'wasm') {
161 process.env.CODEGRAPH_KERNEL = '0';
162 return extractFromSource('main.go', source, 'go');
163 }
164 delete process.env.CODEGRAPH_KERNEL;
165 process.env.CODEGRAPH_KERNEL_LANGS = 'all';
166 const result = tryKernelExtract('main.go', source, 'go');
167 expect(result, 'kernel extraction of main.go').not.toBeNull();
168 return result!;
169 }
170
171 const backends = kernelAvailable ? (['kernel', 'wasm'] as const) : (['wasm'] as const);
172

Calls 2

extractFromSourceFunction · 0.90
tryKernelExtractFunction · 0.90

Tested by

no test coverage detected