focus cody chat on startup when launching debug task from vscode (#50685)

Just applies in dev mode.

This means you can hit F5 and then wait a few seconds and the Cody panel
will be focused in the extension host VS Code instance.
This commit is contained in:
Quinn Slack 2023-04-15 20:48:36 -07:00 committed by GitHub
parent 476ca9e63d
commit 4af7dcd384
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

3
.vscode/launch.json vendored
View File

@ -21,7 +21,8 @@
"sourceMaps": true,
"outFiles": ["${workspaceRoot}/client/cody/dist/*.js"],
"env": {
"NODE_ENV": "development"
"NODE_ENV": "development",
"CODY_FOCUS_ON_STARTUP": "1"
}
},
{

View File

@ -10,6 +10,12 @@ export function activate(context: vscode.ExtensionContext): Promise<ExtensionApi
PromptMixin.add(languagePromptMixin(vscode.env.language))
if (process.env.CODY_FOCUS_ON_STARTUP) {
setTimeout(() => {
void vscode.commands.executeCommand('cody.chat.focus')
}, 250)
}
// Register commands and webview
return CommandsProvider(context)
}