diff --git a/.vscode/launch.json b/.vscode/launch.json index 13af9bf1c..a01245e07 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -11,7 +11,7 @@ "name": "Core Binary", "skipFiles": ["/**"], "program": "${workspaceFolder}/binary/out/index.js", - "preLaunchTask": "binary:esbuild", + // "preLaunchTask": "binary:esbuild", "outFiles": ["${workspaceFolder}/binary/out/**/*.js"], "sourceMaps": true, "smartStep": true, diff --git a/binary/README.md b/binary/README.md index bc0716b7d..beff54b4b 100644 --- a/binary/README.md +++ b/binary/README.md @@ -26,3 +26,7 @@ The build process is otherwise defined entirely in `build.js`. - tree-sitter-wasms/ (\*) = need to download for each platform manually + +## Debugging + +To debug the binary with IntelliJ, set `useTcp` to `true` in `CoreMessenger.kt`, and then in VS Code run the "Core Binary" debug script. Instead of starting a subprocess for the binary and communicating over stdin/stdout, the IntelliJ extension will connect over TCP to the server started from the VS Code window. You can place breakpoints anywhere in the `core` or `binary` folders. diff --git a/binary/build.js b/binary/build.js index ecebddabc..cdfec950c 100644 --- a/binary/build.js +++ b/binary/build.js @@ -107,6 +107,7 @@ async function installNodeModuleInTempDirAndCopyToCurrent(packageName, toCopy) { } (async () => { + fs.mkdirSync("out/node_modules", { recursive: true }); fs.mkdirSync("bin/node_modules", { recursive: true }); console.log("[info] Downloading prebuilt lancedb..."); diff --git a/core/util/treeSitter.ts b/core/util/treeSitter.ts index 60759284b..967f5d979 100644 --- a/core/util/treeSitter.ts +++ b/core/util/treeSitter.ts @@ -78,9 +78,6 @@ export const supportedLanguages: { [key: string]: string } = { }; export async function getParserForFile(filepath: string) { - if (process.env.IS_BINARY) { - return undefined; - } try { await Parser.init(); const parser = new Parser();