Skip to content

Commit 986685b

Browse files
committed
patch for aws#5076
1 parent 2032a57 commit 986685b

File tree

1 file changed

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

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@
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+
// this is a hack since this key does not exist in 233
15+
// TODO: change below to use ConsoleViewImpl.IS_CONSOLE_DOCUMENT after 233 support is removed
16+
val key: Key<*> = Key.findKeyByName("IS_CONSOLE_DOCUMENT") ?: return
17+
val isConsole = editor.document.getUserData(key)
1518
if (isConsole == true) return
1619
if (!editor.document.isWritable) return
1720
val project = editor.project ?: return

0 commit comments

Comments
 (0)