Skip to content

Commit 50b858e

Browse files
zixlin7rli
authored andcommitted
patch for aws#5076 (aws#5081)
* patch for aws#5076 * Update plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/cwc/inline/OpenChatInputAction.kt Co-authored-by: Richard Li <[email protected]> --------- Co-authored-by: Richard Li <[email protected]>
1 parent ff67463 commit 50b858e

File tree

1 file changed

+7
-2
lines changed
  • plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/cwc/inline

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,20 @@
33

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

6-
import com.intellij.execution.impl.ConsoleViewImpl
76
import com.intellij.openapi.actionSystem.AnAction
87
import com.intellij.openapi.actionSystem.AnActionEvent
98
import com.intellij.openapi.actionSystem.CommonDataKeys
9+
import com.intellij.openapi.util.Key
1010

1111
class OpenChatInputAction : AnAction() {
1212
override fun actionPerformed(e: AnActionEvent) {
1313
val editor = e.getData(CommonDataKeys.EDITOR) ?: return
14-
val isConsole = editor.document.getUserData(ConsoleViewImpl.IS_CONSOLE_DOCUMENT)
14+
// FIX_WHEN_MIN_IS_241: change below to use ConsoleViewImpl.IS_CONSOLE_DOCUMENT
15+
var isConsole: Any? = null
16+
val key: Key<*>? = Key.findKeyByName("IS_CONSOLE_DOCUMENT")
17+
if (key != null) {
18+
isConsole = editor.document.getUserData(key)
19+
}
1520
if (isConsole == true) return
1621
if (!editor.document.isWritable) return
1722
val project = editor.project ?: return

0 commit comments

Comments
 (0)