Skip to content

Commit 86d0840

Browse files
committed
fix(LLMInlayManager): use InlayModelImpl for inlay model
for handle java.lang.Throwable: Inlay operations are not supported for injected editors
1 parent 8fc6255 commit 86d0840

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import com.intellij.openapi.editor.EditorCustomElementRenderer
1414
import com.intellij.openapi.editor.Inlay
1515
import com.intellij.openapi.editor.ex.EditorEx
1616
import com.intellij.openapi.editor.impl.ImaginaryEditor
17+
import com.intellij.openapi.editor.impl.InlayModelImpl
1718
import com.intellij.openapi.fileEditor.FileDocumentSynchronizationVetoer
1819
import com.intellij.openapi.project.Project
1920
import com.intellij.openapi.util.Disposer
@@ -77,7 +78,7 @@ class LLMInlayManagerImpl : LLMInlayManager {
7778

7879
@RequiresEdt
7980
override fun collectInlays(editor: Editor, startOffset: Int, endOffset: Int): List<LLMInlayRenderer> {
80-
val model = editor.inlayModel
81+
val model = editor.inlayModel as? InlayModelImpl ?: return emptyList()
8182

8283
if (endOffset <= startOffset) return emptyList()
8384

0 commit comments

Comments
 (0)