Skip to content

Commit 03060c5

Browse files
committed
fix inline completion not supported language UI is rendered in background thread
1 parent cd63f65 commit 03060c5

File tree

1 file changed

+10
-8
lines changed
  • plugins/amazonq/codewhisperer/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codewhisperer/service

1 file changed

+10
-8
lines changed

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)