MCPcopy
hub / github.com/opentrace/opentrace / getPhpParser

Function getPhpParser

ui/src/components/pipeline/__tests__/helpers.ts:57–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

55let phpParser: Parser | null = null;
56
57export async function getPhpParser(): Promise<Parser> {
58 await initTreeSitter();
59 if (!phpParser) {
60 phpParser = new Parser();
61 const buf = await readFile(getWasmPath('php'));
62 const lang = await Language.load(buf);
63 phpParser.setLanguage(lang);
64 }
65 return phpParser;
66}
67
68export function makeRepoTree(
69 files: Array<{ path: string; content?: string }>,

Callers 2

parsing.test.tsFile · 0.90
fixture.test.tsFile · 0.90

Calls 4

getWasmPathFunction · 0.90
initTreeSitterFunction · 0.85
readFileFunction · 0.85
loadMethod · 0.80

Tested by

no test coverage detected