[debugger] Fix statistics about evaluator compilation failures

Fixed evaluation.result event. Note, the statistics were correct for the analysis.compilation.result

IDEA-366380

(cherry picked from commit 90b8f35bc6b9e8c08ef06b965088c509fc17d3c0)


Merge-request: IJ-MR-153908
Merged-by: Alexey Merkulov <alexey.merkulov@jetbrains.com>

GitOrigin-RevId: 47c80ce393305490a467cba3cd743f8b6c343218
This commit is contained in:
Alexey.Merkulov
2025-01-29 19:12:07 +00:00
committed by intellij-monorepo-bot
parent d43fe4c2e4
commit c8080e5f06
3 changed files with 12 additions and 1 deletions

View File

@@ -22,6 +22,8 @@ import org.jetbrains.kotlin.resolve.jvm.diagnostics.ErrorsJvm
import java.util.*
class K1KotlinCodeFragmentCompiler : KotlinCodeFragmentCompiler {
override val compilerType: CompilerType = CompilerType.IR
override fun compileCodeFragment(
context: ExecutionContext,
codeFragment: KtCodeFragment

View File

@@ -32,6 +32,8 @@ import org.jetbrains.kotlin.psi.KtOperationReferenceExpression
import java.util.concurrent.ExecutionException
interface KotlinCodeFragmentCompiler {
val compilerType: CompilerType
fun compileCodeFragment(context: ExecutionContext, codeFragment: KtCodeFragment): CompiledCodeFragmentData
companion object {
@@ -40,6 +42,8 @@ interface KotlinCodeFragmentCompiler {
}
class K2KotlinCodeFragmentCompiler : KotlinCodeFragmentCompiler {
override val compilerType: CompilerType = CompilerType.K2
@OptIn(KaExperimentalApi::class)
override fun compileCodeFragment(
context: ExecutionContext,

View File

@@ -139,7 +139,12 @@ class KotlinEvaluator(val codeFragment: KtCodeFragment, private val sourcePositi
is EvaluateException -> StatisticsEvaluationResult.COMPILER_INTERNAL_ERROR
else -> StatisticsEvaluationResult.UNCLASSIFIED_COMPILATION_PROBLEM
}
KotlinDebuggerEvaluatorStatisticsCollector.logEvaluationResult(codeFragment.project, evaluationResultValue, CompilerType.K2, context.evaluationContext.origin)
KotlinDebuggerEvaluatorStatisticsCollector.logEvaluationResult(
codeFragment.project,
evaluationResultValue,
KotlinCodeFragmentCompiler.getInstance().compilerType,
context.evaluationContext.origin
)
}
throw e
}