Skip to content

Commit bc11847

Browse files
authored
fix(amazonq): Change JB's behavior back to blocking auto trigger (aws#5978)
Added NonCancellable context: Wrapped getSuggestion with NonCancellable to prevent completion requests from being cancelled mid-execution Implemented session persistence: Maintained activeTriggerSessions map to preserve suggestions from previous trigger sessions that were disposed before completion Cross-session suggestion display: When a display session is invalidated, suggestions from activeTriggerSessions are carried forward to the next available display session via getVariants() Asynchronous pagination: Made pagination non-blocking while ensuring suggestions are still delivered to future display sessions
1 parent 1211c41 commit bc11847

File tree

4 files changed

+147
-88
lines changed

4 files changed

+147
-88
lines changed

plugins/amazonq/codewhisperer/jetbrains-community/src-242/software/aws/toolkits/jetbrains/services/codewhisperer/popup/QManualCall.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ import software.aws.toolkits.jetbrains.services.codewhisperer.popup.QInlineCompl
1010
fun InlineCompletionEvent.isManualCall(): Boolean =
1111
this is InlineCompletionEvent.DirectCall && this.context?.getData(DATA_KEY_Q_AUTO_TRIGGER_INTELLISENSE) == false
1212

13+
fun InlineCompletionEvent.isIntelliSense(): Boolean =
14+
this is InlineCompletionEvent.DirectCall && this.context?.getData(DATA_KEY_Q_AUTO_TRIGGER_INTELLISENSE) == true
15+
1316
fun getManualCallEvent(editor: Editor, isIntelliSenseAccept: Boolean): InlineCompletionEvent {
1417
val dataContext = DataContext { dataId ->
1518
when (dataId) {

plugins/amazonq/codewhisperer/jetbrains-community/src-243+/software/aws/toolkits/jetbrains/services/codewhisperer/popup/QManualCall.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ import software.aws.toolkits.jetbrains.services.codewhisperer.popup.QInlineCompl
1111
fun InlineCompletionEvent.isManualCall(): Boolean =
1212
this is InlineCompletionEvent.ManualCall && this.additionalData.getUserData(KEY_Q_AUTO_TRIGGER_INTELLISENSE) == false
1313

14+
fun InlineCompletionEvent.isIntelliSense(): Boolean =
15+
this is InlineCompletionEvent.ManualCall && this.additionalData.getUserData(KEY_Q_AUTO_TRIGGER_INTELLISENSE) == true
16+
1417
fun getManualCallEvent(editor: Editor, isIntelliSenseAccept: Boolean): InlineCompletionEvent {
1518
val data = UserDataHolderBase().apply { this.putUserData(KEY_Q_AUTO_TRIGGER_INTELLISENSE, isIntelliSenseAccept) }
1619
return InlineCompletionEvent.ManualCall(editor, Q_INLINE_PROVIDER_ID, data)

0 commit comments

Comments
 (0)