Skip to content
This repository was archived by the owner on Aug 1, 2025. It is now read-only.

Commit 8e1aad2

Browse files
authored
helpful VS Code launch profile for running a separate instance (#384)
This makes it easier to test settings and auth in the extension host without interfering with your main instance of VS Code.
1 parent c9f1096 commit 8e1aad2

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

.vscode/launch.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,29 @@
1919
"NODE_ENV": "development",
2020
"CODY_FOCUS_ON_STARTUP": "1"
2121
}
22+
},
23+
{
24+
"name": "Launch VS Code Extension (Separate Instance)",
25+
"type": "extensionHost",
26+
"request": "launch",
27+
"runtimeExecutable": "${execPath}",
28+
"preLaunchTask": "Build VS Code Extension",
29+
"args": [
30+
"--user-data-dir=/tmp/vscode-cody-extension-dev-host",
31+
"--profile-temp",
32+
"--extensionDevelopmentPath=${workspaceRoot}/vscode",
33+
"--disable-extension=sourcegraph.cody-ai",
34+
"--disable-extension=github.copilot",
35+
"--disable-extension=github.copilot-nightly"
36+
],
37+
"sourceMaps": true,
38+
"outFiles": ["${workspaceRoot}/vscode/dist/**/*.js"],
39+
"env": {
40+
"NODE_ENV": "development",
41+
"CODY_PROFILE_TEMP": "true",
42+
"CODY_DEBUG_ENABLE": "true",
43+
"CODY_FOCUS_ON_STARTUP": "1"
44+
}
2245
}
2346
]
2447
}

vscode/src/log.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ export function debug(filterLabel: string, text: string, ...args: unknown[]): vo
3030
const workspaceConfig = vscode.workspace.getConfiguration()
3131
const config = getConfiguration(workspaceConfig)
3232

33-
if (!outputChannel || !config.debugEnable) {
33+
const debugEnable = process.env.CODY_DEBUG_ENABLE === 'true' || config.debugEnable
34+
35+
if (!outputChannel || !debugEnable) {
3436
return
3537
}
3638

vscode/src/main.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ export async function start(context: vscode.ExtensionContext): Promise<vscode.Di
4646
await migrateConfiguration()
4747

4848
const secretStorage =
49-
process.env.CODY_TESTING === 'true' ? new InMemorySecretStorage() : new VSCodeSecretStorage(context.secrets)
49+
process.env.CODY_TESTING === 'true' || process.env.CODY_PROFILE_TEMP === 'true'
50+
? new InMemorySecretStorage()
51+
: new VSCodeSecretStorage(context.secrets)
5052
const localStorage = new LocalStorage(context.globalState)
5153
const rgPath = await getRgPath(context.extensionPath)
5254

0 commit comments

Comments
 (0)