Skip to content

Commit 0e0302f

Browse files
Merge pull request #6552 from continuedev/exigow/dont-put-inlay-in-write
fix: Don't mark autocompletion inlay rendering as write operation
2 parents bef5fa1 + a780297 commit 0e0302f

File tree

1 file changed

+9
-11
lines changed
  • extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete

1 file changed

+9
-11
lines changed

extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/autocomplete/AutocompleteService.kt

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -185,26 +185,24 @@ class AutocompleteService(private val project: Project) {
185185
return
186186
}
187187

188-
ApplicationManager.getApplication().invokeLater {
189-
WriteAction.run<Throwable> {
190-
// Clear existing completions
191-
hideCompletions(editor)
188+
invokeLater {
189+
// Clear existing completions
190+
hideCompletions(editor)
192191

193-
val properties = InlayProperties()
194-
properties.relatesToPrecedingText(true)
195-
properties.disableSoftWrapping(true)
192+
val properties = InlayProperties()
193+
properties.relatesToPrecedingText(true)
194+
properties.disableSoftWrapping(true)
196195

197-
val lines = completion.lines()
198-
pendingCompletion = pendingCompletion?.copy(text = lines.joinToString("\n"))
199-
editor.addInlayElement(lines, offset, properties)
196+
val lines = completion.lines()
197+
pendingCompletion = pendingCompletion?.copy(text = lines.joinToString("\n"))
198+
editor.addInlayElement(lines, offset, properties)
200199

201200
// val attributes = TextAttributes().apply {
202201
// backgroundColor = JBColor.GREEN
203202
// }
204203
// val key = TextAttributesKey.createTextAttributesKey("CONTINUE_AUTOCOMPLETE")
205204
// key.let { editor.colorsScheme.setAttributes(it, attributes) }
206205
// editor.markupModel.addLineHighlighter(key, editor.caretModel.logicalPosition.line, HighlighterLayer.LAST)
207-
}
208206
}
209207
}
210208

0 commit comments

Comments
 (0)