Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.intellij.idea.AppMode
import com.intellij.openapi.actionSystem.IdeActions.ACTION_EDITOR_ENTER
import com.intellij.openapi.actionSystem.IdeActions.ACTION_EDITOR_ESCAPE
import com.intellij.openapi.actionSystem.IdeActions.ACTION_EDITOR_TAB
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.command.WriteCommandAction
import com.intellij.openapi.components.Service
Expand Down Expand Up @@ -59,6 +60,7 @@
import software.aws.toolkits.jetbrains.services.codewhisperer.popup.handlers.CodeWhispererEditorActionHandler
import software.aws.toolkits.jetbrains.services.codewhisperer.popup.handlers.CodeWhispererPopupEnterHandler
import software.aws.toolkits.jetbrains.services.codewhisperer.popup.handlers.CodeWhispererPopupEscHandler
import software.aws.toolkits.jetbrains.services.codewhisperer.popup.handlers.CodeWhispererPopupTabHandler
import software.aws.toolkits.jetbrains.services.codewhisperer.popup.handlers.CodeWhispererPopupTypedHandler
import software.aws.toolkits.jetbrains.services.codewhisperer.popup.listeners.CodeWhispererAcceptButtonActionListener
import software.aws.toolkits.jetbrains.services.codewhisperer.popup.listeners.CodeWhispererActionListener
Expand Down Expand Up @@ -331,7 +333,7 @@
popup.size = popup.preferredContentSize
}
} else {
if (!AppMode.isRemoteDevHost()) {

Check warning on line 336 in plugins/amazonq/codewhisperer/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codewhisperer/popup/CodeWhispererPopupManager.kt

View workflow job for this annotation

GitHub Actions / qodana

Unstable API Usage

'com.intellij.idea.AppMode' is marked unstable with @ApiStatus.Internal
if (visible && !noEnoughSpaceForPopup) {
// TODO: will move to a keybinding listener once I found one
popupComponents.prevButton.text = popupComponents.prevButtonText()
Expand Down Expand Up @@ -483,6 +485,10 @@
ACTION_EDITOR_ENTER,
CodeWhispererPopupEnterHandler(EditorActionManager.getInstance().getActionHandler(ACTION_EDITOR_ENTER), states)
)

if (AppMode.isRemoteDevHost()) {

Check warning on line 489 in plugins/amazonq/codewhisperer/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codewhisperer/popup/CodeWhispererPopupManager.kt

View workflow job for this annotation

GitHub Actions / qodana

Unstable API Usage

'isRemoteDevHost()' is declared in unstable class 'com.intellij.idea.AppMode' marked with @ApiStatus.Internal
setPopupActionHandler(ACTION_EDITOR_TAB, CodeWhispererPopupTabHandler(states))
}
}

private fun setPopupTypedHandler(newHandler: CodeWhispererPopupTypedHandler) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ import com.intellij.openapi.editor.Caret
import com.intellij.openapi.editor.Editor
import software.aws.toolkits.jetbrains.services.codewhisperer.model.InvocationContext
import software.aws.toolkits.jetbrains.services.codewhisperer.popup.CodeWhispererPopupManager
import software.aws.toolkits.jetbrains.services.codewhisperer.service.CodeWhispererInvocationStatus

class CodeWhispererPopupTabHandler(states: InvocationContext) : CodeWhispererEditorActionHandler(states) {
override fun doExecute(editor: Editor, caret: Caret?, dataContext: DataContext?) {
if (!CodeWhispererInvocationStatus.getInstance().isDisplaySessionActive()) return
ApplicationManager.getApplication().messageBus.syncPublisher(
CodeWhispererPopupManager.CODEWHISPERER_USER_ACTION_PERFORMED
).beforeAccept(states, CodeWhispererPopupManager.getInstance().sessionContext)
Expand Down
Loading