diff --git a/.changes/next-release/bugfix-34500b24-b177-49b2-a740-3b89dfb1f702.json b/.changes/next-release/bugfix-34500b24-b177-49b2-a740-3b89dfb1f702.json new file mode 100644 index 00000000000..15a42cee065 --- /dev/null +++ b/.changes/next-release/bugfix-34500b24-b177-49b2-a740-3b89dfb1f702.json @@ -0,0 +1,4 @@ +{ + "type" : "bugfix", + "description" : "Fix error occuring when Amazon Q attempts to show UI hints on manually triggerred inline suggestion (#4929)" +} diff --git a/plugins/amazonq/codewhisperer/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codewhisperer/service/CodeWhispererService.kt b/plugins/amazonq/codewhisperer/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codewhisperer/service/CodeWhispererService.kt index 8b9c9d22949..e9d1cf26527 100644 --- a/plugins/amazonq/codewhisperer/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codewhisperer/service/CodeWhispererService.kt +++ b/plugins/amazonq/codewhisperer/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codewhisperer/service/CodeWhispererService.kt @@ -409,10 +409,8 @@ class CodeWhispererService(private val cs: CoroutineScope) : Disposable { if (requestContext.triggerTypeInfo.triggerType == CodewhispererTriggerType.OnDemand) { // We should only show error hint when CodeWhisperer popup is not visible, // and make it silent if CodeWhisperer popup is showing. - runInEdt { - if (!CodeWhispererInvocationStatus.getInstance().isPopupActive()) { - showCodeWhispererErrorHint(requestContext.editor, displayMessage) - } + if (!CodeWhispererInvocationStatus.getInstance().isPopupActive()) { + showCodeWhispererErrorHint(requestContext.editor, displayMessage) } } } @@ -754,12 +752,16 @@ class CodeWhispererService(private val cs: CoroutineScope) : Disposable { return true } - fun showCodeWhispererInfoHint(editor: Editor, message: String) { - HintManager.getInstance().showInformationHint(editor, message, HintManager.UNDER) + private fun showCodeWhispererInfoHint(editor: Editor, message: String) { + runInEdt { + HintManager.getInstance().showInformationHint(editor, message, HintManager.UNDER) + } } - fun showCodeWhispererErrorHint(editor: Editor, message: String) { - HintManager.getInstance().showErrorHint(editor, message, HintManager.UNDER) + private fun showCodeWhispererErrorHint(editor: Editor, message: String) { + runInEdt { + HintManager.getInstance().showErrorHint(editor, message, HintManager.UNDER) + } } override fun dispose() {}