Skip to content

Commit 1ec96a9

Browse files
authored
fix(amazonq): codewhisperer manual trigger not working in Q (#4716)
* fix manual trigger not working in q * rm hack
1 parent 1e411db commit 1ec96a9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/core/src/shared/vscode/commands2.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { ToolkitError } from '../errors'
1515
import crypto from 'crypto'
1616
import { keysAsInt } from '../utilities/tsUtils'
1717
import { partialClone } from '../utilities/collectionUtils'
18+
import { VSCODE_EXTENSION_ID } from '../utilities'
1819

1920
type Callback = (...args: any[]) => any
2021
type CommandFactory<T extends Callback, U extends any[]> = (...parameters: U) => T
@@ -635,8 +636,8 @@ async function runCommand<T extends Callback>(fn: T, info: CommandInfo<T>): Prom
635636

636637
try {
637638
if (info.autoconnect === true) {
638-
// HACK: this only occurs for the explorer case, which is in toolkit
639-
await vscode.commands.executeCommand('_aws.toolkit.auth.autoConnect')
639+
const prefix = globals.context.extension.id === VSCODE_EXTENSION_ID.amazonq ? 'amazonq' : 'toolkit'
640+
await vscode.commands.executeCommand(`_aws.${prefix}.auth.autoConnect`)
640641
}
641642

642643
return await (instrumenter ? instrumenter(fn, ...args) : fn(...args))

0 commit comments

Comments
 (0)