Skip to content

Commit

Permalink
Merge main into feature/q-mega
Browse files Browse the repository at this point in the history
  • Loading branch information
aws-toolkit-automation authored Nov 13, 2024
2 parents dd05f9f + 7c89b10 commit a8c0685
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a8c0685

Please sign in to comment.