diff --git a/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/cwc/inline/OpenChatInputAction.kt b/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/cwc/inline/OpenChatInputAction.kt index e9ec4058c0..ebc6b53cd1 100644 --- a/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/cwc/inline/OpenChatInputAction.kt +++ b/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/cwc/inline/OpenChatInputAction.kt @@ -3,15 +3,20 @@ package software.aws.toolkits.jetbrains.services.cwc.inline -import com.intellij.execution.impl.ConsoleViewImpl import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.actionSystem.CommonDataKeys +import com.intellij.openapi.util.Key class OpenChatInputAction : AnAction() { override fun actionPerformed(e: AnActionEvent) { val editor = e.getData(CommonDataKeys.EDITOR) ?: return - val isConsole = editor.document.getUserData(ConsoleViewImpl.IS_CONSOLE_DOCUMENT) + // FIX_WHEN_MIN_IS_241: change below to use ConsoleViewImpl.IS_CONSOLE_DOCUMENT + var isConsole: Any? = null + val key: Key<*>? = Key.findKeyByName("IS_CONSOLE_DOCUMENT") + if (key != null) { + isConsole = editor.document.getUserData(key) + } if (isConsole == true) return if (!editor.document.isWritable) return val project = editor.project ?: return