Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
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 @@ -10,6 +10,9 @@ import software.aws.toolkits.jetbrains.services.codewhisperer.popup.QInlineCompl
fun InlineCompletionEvent.isManualCall(): Boolean =
this is InlineCompletionEvent.DirectCall && this.context?.getData(DATA_KEY_Q_AUTO_TRIGGER_INTELLISENSE) == false

fun InlineCompletionEvent.isIntelliSense(): Boolean =
this is InlineCompletionEvent.DirectCall && this.context?.getData(DATA_KEY_Q_AUTO_TRIGGER_INTELLISENSE) == true

fun getManualCallEvent(editor: Editor, isIntelliSenseAccept: Boolean): InlineCompletionEvent {
val dataContext = DataContext { dataId ->
when (dataId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@
import software.aws.toolkits.jetbrains.services.codewhisperer.popup.QInlineCompletionProvider.Companion.Q_INLINE_PROVIDER_ID

fun InlineCompletionEvent.isManualCall(): Boolean =
this is InlineCompletionEvent.ManualCall && this.additionalData.getUserData(KEY_Q_AUTO_TRIGGER_INTELLISENSE) == false

Check warning on line 12 in plugins/amazonq/codewhisperer/jetbrains-community/src-243+/software/aws/toolkits/jetbrains/services/codewhisperer/popup/QManualCall.kt

View workflow job for this annotation

GitHub Actions / qodana

Unstable API Usage

'additionalData' is marked unstable with @ApiStatus.Experimental

Check warning on line 12 in plugins/amazonq/codewhisperer/jetbrains-community/src-243+/software/aws/toolkits/jetbrains/services/codewhisperer/popup/QManualCall.kt

View workflow job for this annotation

GitHub Actions / qodana

Unstable API Usage

'com.intellij.codeInsight.inline.completion.InlineCompletionEvent.ManualCall' is marked unstable with @ApiStatus.Experimental

fun InlineCompletionEvent.isIntelliSense(): Boolean =
this is InlineCompletionEvent.ManualCall && this.additionalData.getUserData(KEY_Q_AUTO_TRIGGER_INTELLISENSE) == true

fun getManualCallEvent(editor: Editor, isIntelliSenseAccept: Boolean): InlineCompletionEvent {
val data = UserDataHolderBase().apply { this.putUserData(KEY_Q_AUTO_TRIGGER_INTELLISENSE, isIntelliSenseAccept) }
return InlineCompletionEvent.ManualCall(editor, Q_INLINE_PROVIDER_ID, data)
Expand Down
Loading
Loading