Skip to content

Commit dc86139

Browse files
authored
Revert "fix(amazonq): "failed to run command" #6982"
This reverts commit e78b9a2.
1 parent 3ce0dec commit dc86139

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

packages/amazonq/src/lsp/chat/commands.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6+
import * as vscode from 'vscode'
67
import { Commands, globals } from 'aws-core-vscode/shared'
78
import { window } from 'vscode'
89
import { AmazonQChatViewProvider } from './webviewProvider'
@@ -73,6 +74,6 @@ function registerGenericCommand(commandName: string, genericCommand: string, pro
7374
* Instead, we just create our own as a temporary solution
7475
*/
7576
async function focusAmazonQPanel() {
76-
await Commands.tryExecute('aws.amazonq.AmazonQChatView.focus')
77-
await Commands.tryExecute('aws.amazonq.AmazonCommonAuth.focus')
77+
await vscode.commands.executeCommand('aws.amazonq.AmazonQChatView.focus')
78+
await vscode.commands.executeCommand('aws.amazonq.AmazonCommonAuth.focus')
7879
}

packages/core/src/amazonqFeatureDev/controllers/chat/controller.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import { AuthUtil } from '../../../codewhisperer/util/authUtil'
4242
import { AuthController } from '../../../amazonq/auth/controller'
4343
import { getLogger } from '../../../shared/logger/logger'
4444
import { submitFeedback } from '../../../feedback/vue/submitFeedback'
45-
import { Commands, placeholder } from '../../../shared/vscode/commands2'
45+
import { placeholder } from '../../../shared/vscode/commands2'
4646
import { EditorContentController } from '../../../amazonq/commons/controllers/contentController'
4747
import { openUrl } from '../../../shared/utilities/vsCodeUtils'
4848
import { checkForDevFile, getPathsFromZipFilePath } from '../../../amazonq/util/files'
@@ -579,7 +579,7 @@ export class FeatureDevController {
579579
open
580580
)
581581
if (resp === open) {
582-
await Commands.tryExecute('aws.amazonq.AmazonQChatView.focus')
582+
await vscode.commands.executeCommand('aws.amazonq.AmazonQChatView.focus')
583583
// TODO add focusing on the specific tab once that's implemented
584584
}
585585
}

packages/core/src/codewhispererChat/commands/registerCommands.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { commandPalette } from '../../codewhisperer/commands/types'
77
import { CodeScanIssue } from '../../codewhisperer/models/model'
88
import { Commands, VsCodeCommandArg, placeholder } from '../../shared/vscode/commands2'
99
import { ChatControllerMessagePublishers } from '../controllers/chat/controller'
10+
import vscode from 'vscode'
1011

1112
/**
1213
* Opens the Amazon Q panel, showing the correct View that should
@@ -24,8 +25,8 @@ export const focusAmazonQPanel = Commands.declare(
2425
* So when we try to focus the following Views, only one will show depending
2526
* on the context.
2627
*/
27-
await Commands.tryExecute('aws.amazonq.AmazonQChatView.focus')
28-
await Commands.tryExecute('aws.amazonq.AmazonCommonAuth.focus')
28+
await vscode.commands.executeCommand('aws.amazonq.AmazonQChatView.focus')
29+
await vscode.commands.executeCommand('aws.amazonq.AmazonCommonAuth.focus')
2930
}
3031
)
3132

0 commit comments

Comments
 (0)