Changesets · Branches · Tags · Compare
| Changeset | 62285ff5a158d44643d7282826ce5dc66d59b79c490a7ae2f6ac0b7227b59e45 |
|---|---|
| Author | Jakub Blach <jakubblach@gmail.com> · 2025-07-07 17:57 +02:00 |
| Committer | Jakub Blach <jakubblach@gmail.com> · 2025-07-08 14:27 +02:00 |
| Parents | 3071520a22c1 |
4 files changed
modified extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/process/ContinueBinaryProcess.kt +22 −2
| @@ -1,8 +1,10 @@ | ||
| 1 | 1 | package com.github.continuedev.continueintellijextension.`continue`.process |
| 2 | 2 | |
| 3 | +import com.github.continuedev.continueintellijextension.services.TelemetryService | |
| 3 | 4 | import com.github.continuedev.continueintellijextension.utils.OS |
| 4 | 5 | import com.github.continuedev.continueintellijextension.utils.getContinueBinaryPath |
| 5 | 6 | import com.github.continuedev.continueintellijextension.utils.getOS |
| 7 | +import com.intellij.openapi.components.service | |
| 6 | 8 | import kotlinx.coroutines.Dispatchers |
| 7 | 9 | import kotlinx.coroutines.runBlocking |
| 8 | 10 | import java.io.File |
| @@ -28,7 +30,25 @@ | ||
| 28 | 30 | } |
| 29 | 31 | return ProcessBuilder(path).directory(File(path).parentFile) |
| 30 | 32 | .start() |
| 31 | - .apply { onExit().thenRun(onExit) } | |
| 33 | + .apply { onExit().thenRun(onExit).thenRun { reportErrorTelemetry() } } | |
| 34 | + } | |
| 35 | + | |
| 36 | + | |
| 37 | + private fun reportErrorTelemetry() { | |
| 38 | + var err = process.errorStream?.bufferedReader()?.readText()?.trim() | |
| 39 | + if (err != null) { | |
| 40 | + // There are often "⚡️Done in Xms" messages, and we want everything after the last one | |
| 41 | + val delimiter = "⚡ Done in" | |
| 42 | + val doneIndex = err.lastIndexOf(delimiter) | |
| 43 | + if (doneIndex != -1) { | |
| 44 | + err = err.substring(doneIndex + delimiter.length) | |
| 45 | + } | |
| 46 | + } | |
| 47 | + | |
| 48 | + println("Core process exited with output: $err") | |
| 49 | + | |
| 50 | + val telemetryService = service<TelemetryService>() | |
| 51 | + telemetryService.capture("jetbrains_core_exit", mapOf("error" to err)) | |
| 32 | 52 | } |
| 33 | 53 | |
| 34 | 54 | private companion object { |
| @@ -58,4 +78,4 @@ | ||
| 58 | 78 | } |
| 59 | 79 | } |
| 60 | 80 | |
| 61 | -} | |
| No newline at the end of the file | ||
| 81 | +} |
modified extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/process/ContinueProcess.kt +1 −1
| @@ -10,4 +10,4 @@ | ||
| 10 | 10 | |
| 11 | 11 | fun close() |
| 12 | 12 | |
| 13 | -} | |
| No newline at the end of the file | ||
| 13 | +} |
modified extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/process/ContinueProcessHandler.kt +1 −1
| @@ -58,4 +58,4 @@ | ||
| 58 | 58 | process.close() |
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | -} | |
| No newline at the end of the file | ||
| 61 | +} |
modified extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/process/ContinueSocketProcess.kt +1 −1
| @@ -13,4 +13,4 @@ | ||
| 13 | 13 | override fun close() = |
| 14 | 14 | socket.close() |
| 15 | 15 | |
| 16 | -} | |
| No newline at the end of the file | ||
| 16 | +} |