Skip to content

Commit 48901f8

Browse files
committed
fix(codecomplete): handle empty range in collectInlays function
1 parent 80e10a7 commit 48901f8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main/kotlin/com/intellij/temporary/inlay/codecomplete/LLMInlayManagerImpl.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ class LLMInlayManagerImpl : LLMInlayManager {
7979
override fun collectInlays(editor: Editor, startOffset: Int, endOffset: Int): List<LLMInlayRenderer> {
8080
val model = editor.inlayModel
8181

82+
if (endOffset <= startOffset) return emptyList()
83+
8284
val inlays = mutableListOf<Inlay<*>>().apply {
8385
addAll(model.getInlineElementsInRange(startOffset, endOffset))
8486
addAll(model.getAfterLineEndElementsInRange(startOffset, endOffset))

0 commit comments

Comments
 (0)