Do not write showing_time log when there is no show

GitOrigin-RevId: 1250a73bd0c478b5cfb8e198e3e7c0c61e3da6ce
This commit is contained in:
Petr Surkov
2024-09-23 13:19:18 +02:00
committed by intellij-monorepo-bot
parent 8b3fd0b3ef
commit 4690be09a5

View File

@@ -98,14 +98,16 @@ internal class InlineCompletionLogsListener(private val editor: Editor) : Inline
override fun onHide(event: InlineCompletionEventType.Hide) {
val container = InlineCompletionLogsContainer.remove(editor) ?: return
with(holder) {
container.add(WAS_SHOWN with wasShown)
container.add(SHOWING_TIME.with(System.currentTimeMillis() - showStartTime))
container.add(FINISH_TYPE with event.finishType)
container.add(FULL_INSERT_ACTIONS with fullInsertActions)
container.add(NEXT_WORD_ACTIONS with nextWordActions)
container.add(NEXT_LINE_ACTIONS with nextLineActions)
container.add(TOTAL_INSERTED_LENGTH with totalInsertedLength)
container.add(TOTAL_INSERTED_LINES with totalInsertedLines)
container.add(WAS_SHOWN with wasShown)
if (wasShown) {
container.add(SHOWING_TIME.with(System.currentTimeMillis() - showStartTime))
container.add(FULL_INSERT_ACTIONS with fullInsertActions)
container.add(NEXT_WORD_ACTIONS with nextWordActions)
container.add(NEXT_LINE_ACTIONS with nextLineActions)
container.add(TOTAL_INSERTED_LENGTH with totalInsertedLength)
container.add(TOTAL_INSERTED_LINES with totalInsertedLines)
}
}
container.logCurrent() // see doc of this function, it's very fast, and we should wait for its completion
}