Skip to content

Commit 672fbb8

Browse files
committed
fix(adapter-json): supress loading wasm file
1 parent c2de0d6 commit 672fbb8

File tree

1 file changed

+4
-1
lines changed
  • packages/apidom-parser-adapter-json/src/tree-sitter/lexical-analysis

1 file changed

+4
-1
lines changed

packages/apidom-parser-adapter-json/src/tree-sitter/lexical-analysis/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ let parserInitLock: Promise<Parser> | null = null;
1818
const analyze = async (source: string): Promise<Tree> => {
1919
if (parser === null && parserInitLock === null) {
2020
// acquire lock
21-
parserInitLock = Parser.init({ wasmBinary: treeSitter } as unknown as EmscriptenModule)
21+
parserInitLock = Parser.init({
22+
wasmBinary: treeSitter,
23+
locateFile: (scriptName: string) => scriptName,
24+
} as unknown as EmscriptenModule)
2225
.then(() => Language.load(treeSitterJson))
2326
.then((jsonLanguage) => {
2427
const parserInstance = new Parser();

0 commit comments

Comments
 (0)