Skip to content

Commit dfb6a83

Browse files
Merge main into feature/dev-execution
2 parents 1513a47 + 2032a57 commit dfb6a83

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
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 issue where Amazon Q inline chat can be invoked from non-editor windows"
4+
}

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/cwc/inline/OpenChatInputAction.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@
33

44
package software.aws.toolkits.jetbrains.services.cwc.inline
55

6+
import com.intellij.execution.impl.ConsoleViewImpl
67
import com.intellij.openapi.actionSystem.AnAction
78
import com.intellij.openapi.actionSystem.AnActionEvent
89
import com.intellij.openapi.actionSystem.CommonDataKeys
910

1011
class OpenChatInputAction : AnAction() {
1112
override fun actionPerformed(e: AnActionEvent) {
12-
val editor = e.getRequiredData(CommonDataKeys.EDITOR)
13+
val editor = e.getData(CommonDataKeys.EDITOR) ?: return
14+
val isConsole = editor.document.getUserData(ConsoleViewImpl.IS_CONSOLE_DOCUMENT)
15+
if (isConsole == true) return
16+
if (!editor.document.isWritable) return
1317
val project = editor.project ?: return
1418

1519
val inlineChatController = InlineChatController.getInstance(project)

0 commit comments

Comments
 (0)