From 50f7978e666337d967d3cbeb0a33ef06f13acd2e Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Sun, 19 May 2024 21:50:15 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20small=20jetbrains=20updates?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/launch.json | 2 +- binary/README.md | 4 ++++ binary/build.js | 1 + core/util/treeSitter.ts | 3 --- 4 files changed, 6 insertions(+), 4 deletions(-) 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();