fix: code completion state when session contains remining completion

This commit is contained in:
Carl-Robert Linnupuu 2024-11-01 14:27:18 +00:00
parent 04713fe534
commit 478340fe11

View file

@ -101,7 +101,14 @@ class DebouncedCodeCompletionProvider : DebouncedInlineCompletionProvider() {
null -> false
}
return event is InlineCompletionEvent.DocumentChange && codeCompletionsEnabled
if (!codeCompletionsEnabled) {
return false
}
val containsActiveCompletion =
REMAINING_EDITOR_COMPLETION.get(event.toRequest()?.editor)?.isNotEmpty() ?: false
return event is InlineCompletionEvent.DocumentChange || containsActiveCompletion
}
private fun ProducerScope<InlineCompletionElement>.getEventListener(