Skip to content

Commit b2dac74

Browse files
authored
Merge branch 'main' into crossfile-config
2 parents 2daf95f + 687cb2d commit b2dac74

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "bugfix",
3+
"description" : "Fix error occuring when Amazon Q attempts to show UI hints on manually triggerred inline suggestion (#4929)"
4+
}

plugins/amazonq/codewhisperer/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codewhisperer/service/CodeWhispererService.kt

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -409,10 +409,8 @@ class CodeWhispererService(private val cs: CoroutineScope) : Disposable {
409409
if (requestContext.triggerTypeInfo.triggerType == CodewhispererTriggerType.OnDemand) {
410410
// We should only show error hint when CodeWhisperer popup is not visible,
411411
// and make it silent if CodeWhisperer popup is showing.
412-
runInEdt {
413-
if (!CodeWhispererInvocationStatus.getInstance().isPopupActive()) {
414-
showCodeWhispererErrorHint(requestContext.editor, displayMessage)
415-
}
412+
if (!CodeWhispererInvocationStatus.getInstance().isPopupActive()) {
413+
showCodeWhispererErrorHint(requestContext.editor, displayMessage)
416414
}
417415
}
418416
}
@@ -754,12 +752,16 @@ class CodeWhispererService(private val cs: CoroutineScope) : Disposable {
754752
return true
755753
}
756754

757-
fun showCodeWhispererInfoHint(editor: Editor, message: String) {
758-
HintManager.getInstance().showInformationHint(editor, message, HintManager.UNDER)
755+
private fun showCodeWhispererInfoHint(editor: Editor, message: String) {
756+
runInEdt {
757+
HintManager.getInstance().showInformationHint(editor, message, HintManager.UNDER)
758+
}
759759
}
760760

761-
fun showCodeWhispererErrorHint(editor: Editor, message: String) {
762-
HintManager.getInstance().showErrorHint(editor, message, HintManager.UNDER)
761+
private fun showCodeWhispererErrorHint(editor: Editor, message: String) {
762+
runInEdt {
763+
HintManager.getInstance().showErrorHint(editor, message, HintManager.UNDER)
764+
}
763765
}
764766

765767
override fun dispose() {}

0 commit comments

Comments
 (0)