fix(vscode): use positional workspace for isolated scripts

This commit is contained in:
kirillk
2026-07-29 16:39:09 -04:00
parent c2e600e97b
commit 74ec8f5fa2
2 changed files with 7 additions and 24 deletions
-22
View File
@@ -31,34 +31,12 @@
"command": "bun script/launch.ts --isolated --workspace \"${workspaceFolder}\"", "command": "bun script/launch.ts --isolated --workspace \"${workspaceFolder}\"",
"cwd": "${workspaceFolder}/packages/kilo-vscode" "cwd": "${workspaceFolder}/packages/kilo-vscode"
}, },
{
"name": "VSCode - Run Extension (Isolated: Choose Folder)",
"type": "node-terminal",
"request": "launch",
"command": "bun script/launch.ts --isolated --workspace \"${input:kiloDevWorkspace}\"",
"cwd": "${workspaceFolder}/packages/kilo-vscode"
},
{ {
"name": "VSCode - Run Extension (Isolated Clean)", "name": "VSCode - Run Extension (Isolated Clean)",
"type": "node-terminal", "type": "node-terminal",
"request": "launch", "request": "launch",
"command": "bun script/launch.ts --isolated --clean --workspace \"${workspaceFolder}\"", "command": "bun script/launch.ts --isolated --clean --workspace \"${workspaceFolder}\"",
"cwd": "${workspaceFolder}/packages/kilo-vscode" "cwd": "${workspaceFolder}/packages/kilo-vscode"
},
{
"name": "VSCode - Run Extension (Isolated Clean: Choose Folder)",
"type": "node-terminal",
"request": "launch",
"command": "bun script/launch.ts --isolated --clean --workspace \"${input:kiloDevWorkspace}\"",
"cwd": "${workspaceFolder}/packages/kilo-vscode"
}
],
"inputs": [
{
"id": "kiloDevWorkspace",
"type": "promptString",
"description": "Folder to open in the isolated VS Code instance",
"default": "${workspaceFolder}"
} }
] ]
} }
+7 -2
View File
@@ -3,7 +3,7 @@
* Build the Kilo VS Code extension and launch it in a development host. * Build the Kilo VS Code extension and launch it in a development host.
* *
* Usage: * Usage:
* bun script/launch.ts [options] * bun script/launch.ts [options] [workspace]
* *
* Options: * Options:
* --no-build Skip the build step (reuse last build) * --no-build Skip the build step (reuse last build)
@@ -44,10 +44,14 @@ const repo = resolve(root, "..", "..")
function parse(argv: string[]) { function parse(argv: string[]) {
const result: Record<string, string | boolean> = {} const result: Record<string, string | boolean> = {}
const values: string[] = []
for (let i = 0; i < argv.length; i++) { for (let i = 0; i < argv.length; i++) {
const item = argv[i]! const item = argv[i]!
if (!item.startsWith("--")) continue if (!item.startsWith("--")) {
values.push(item)
continue
}
if (item.startsWith("--no-")) { if (item.startsWith("--no-")) {
result[item.slice(5)] = false result[item.slice(5)] = false
@@ -72,6 +76,7 @@ function parse(argv: string[]) {
i++ i++
} }
if (typeof result.workspace !== "string" && values[0]) result.workspace = values[0]
return result return result
} }