From a891608facc6beb6f9b64499a2d1dd86dd554d22 Mon Sep 17 00:00:00 2001 From: Lars Pagh Date: Sat, 17 Feb 2024 10:23:12 +0100 Subject: [PATCH 1/3] Set itemType for querySubmenuItem This is necessary before calling props.command the same way we do it for non-query item types. Otherwise we receive an 'Unknow provider...' error message in the 'getContextItems' case in the 'panel.webview.onDidReceiveMessage, callback. --- gui/src/components/mainInput/MentionList.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/gui/src/components/mainInput/MentionList.tsx b/gui/src/components/mainInput/MentionList.tsx index cb80878c38..915557951d 100644 --- a/gui/src/components/mainInput/MentionList.tsx +++ b/gui/src/components/mainInput/MentionList.tsx @@ -295,6 +295,7 @@ const MentionList = forwardRef((props: MentionListProps, ref) => { } else { props.command({ ...querySubmenuItem, + itemType: querySubmenuItem.type, query: queryInputRef.current.value, label: `${querySubmenuItem.label}: ${queryInputRef.current.value}`, }); From 06b9ae6a6b834a26213c74f3a01cd2a556026817 Mon Sep 17 00:00:00 2001 From: Lars Pagh Date: Sat, 17 Feb 2024 10:27:56 +0100 Subject: [PATCH 2/3] include @vscode node module folder we need the @vscode folder containing ripgrep in the distribution. --- extensions/vscode/scripts/prepackage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/vscode/scripts/prepackage.js b/extensions/vscode/scripts/prepackage.js index 4db78c7cb4..a207c11f69 100644 --- a/extensions/vscode/scripts/prepackage.js +++ b/extensions/vscode/scripts/prepackage.js @@ -300,7 +300,7 @@ if (args[2] === "--target") { }); // Copy node_modules for pre-built binaries - const NODE_MODULES_TO_COPY = ["esbuild", "@esbuild", "@lancedb"]; + const NODE_MODULES_TO_COPY = ["esbuild", "@esbuild", "@lancedb", "@vscode"]; fs.mkdirSync("out/node_modules", { recursive: true }); await Promise.all( From 57daa01e1ba50024958fdfbd0369188db10c9c62 Mon Sep 17 00:00:00 2001 From: Lars Pagh Date: Sat, 17 Feb 2024 10:38:52 +0100 Subject: [PATCH 3/3] Amended path for ripgrep executable We have to preprend the 'out' folder in order to find the ripgrep executable in the distribution. Prepending 'out' during development is not necessary. We need a way to distinguish in 'ideProtocol'? --- extensions/vscode/src/ideProtocol.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extensions/vscode/src/ideProtocol.ts b/extensions/vscode/src/ideProtocol.ts index e7855934a0..1b291bbbdf 100644 --- a/extensions/vscode/src/ideProtocol.ts +++ b/extensions/vscode/src/ideProtocol.ts @@ -156,13 +156,15 @@ class VsCodeIde implements IDE { const p = child_process.spawn( path.join( getExtensionUri().fsPath, + "out", "node_modules", "@vscode", "ripgrep", "bin", "rg" ), - ["-i", "-C", "2", `"${query}"`, "."], + ["-i", "-C", "2", "--", `${query}`, "."], //no regex + //["-i", "-C", "2", "-e", `${query}`, "."], //use regex { cwd: dir } ); let output = "";