Skip to content

Commit ba2db03

Browse files
committed
refactor(amazonqFeatureDev): use else catch for return statement
1 parent 644dedd commit ba2db03

File tree

1 file changed

+15
-14
lines changed
  • packages/core/src/amazonqFeatureDev/controllers/chat

1 file changed

+15
-14
lines changed

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

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -417,22 +417,23 @@ export class FeatureDevController {
417417
if (session?.state?.tokenSource) {
418418
session.state.tokenSource = undefined
419419
}
420-
return
421-
}
422-
this.messenger.sendAsyncEventProgress(tabID, false, undefined)
420+
getLogger().debug('Request cancelled, skipping further processing')
421+
} else {
422+
this.messenger.sendAsyncEventProgress(tabID, false, undefined)
423423

424-
// Lock the chat input until they explicitly click one of the follow ups
425-
this.messenger.sendChatInputEnabled(tabID, false)
424+
// Lock the chat input until they explicitly click one of the follow ups
425+
this.messenger.sendChatInputEnabled(tabID, false)
426426

427-
if (!this.isAmazonQVisible) {
428-
const open = 'Open chat'
429-
const resp = await vscode.window.showInformationMessage(
430-
i18n('AWS.amazonq.featureDev.answer.qGeneratedCode'),
431-
open
432-
)
433-
if (resp === open) {
434-
await vscode.commands.executeCommand('aws.AmazonQChatView.focus')
435-
// TODO add focusing on the specific tab once that's implemented
427+
if (!this.isAmazonQVisible) {
428+
const open = 'Open chat'
429+
const resp = await vscode.window.showInformationMessage(
430+
i18n('AWS.amazonq.featureDev.answer.qGeneratedCode'),
431+
open
432+
)
433+
if (resp === open) {
434+
await vscode.commands.executeCommand('aws.AmazonQChatView.focus')
435+
// TODO add focusing on the specific tab once that's implemented
436+
}
436437
}
437438
}
438439
}

0 commit comments

Comments
 (0)