diff --git a/idea/testData/debugger/tinyApp/outs/delegatedPropertyInClass.out b/idea/testData/debugger/tinyApp/outs/delegatedPropertyInClass.out index ad5a8bb15b7..0e22ee3d2c7 100644 --- a/idea/testData/debugger/tinyApp/outs/delegatedPropertyInClass.out +++ b/idea/testData/debugger/tinyApp/outs/delegatedPropertyInClass.out @@ -27,7 +27,6 @@ class MyDelegateThrowsException { // PRINT_FRAME frame = main():8, DelegatedPropertyInClassKt {delegatedPropertyInClass} - static = static = delegatedPropertyInClass.DelegatedPropertyInClassKt local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = delegatedPropertyInClass.kt, 5) local = a: delegatedPropertyInClass.A = {delegatedPropertyInClass.A@uniqueID} (sp = delegatedPropertyInClass.kt, 6) field = prop$delegate: delegatedPropertyInClass.MyDelegate = {delegatedPropertyInClass.MyDelegate@uniqueID} (sp = delegatedPropertyInClass.kt, 12) diff --git a/idea/testData/debugger/tinyApp/outs/delegatedPropertyInClassWoRenderer.out b/idea/testData/debugger/tinyApp/outs/delegatedPropertyInClassWoRenderer.out index 5c7a3d37a18..c22d404cae0 100644 --- a/idea/testData/debugger/tinyApp/outs/delegatedPropertyInClassWoRenderer.out +++ b/idea/testData/debugger/tinyApp/outs/delegatedPropertyInClassWoRenderer.out @@ -23,7 +23,6 @@ class MyDelegate { // RENDER_DELEGATED_PROPERTIES: false // PRINT_FRAME frame = main():8, DelegatedPropertyInClassWoRendererKt {delegatedPropertyInClassWoRenderer} - static = static = delegatedPropertyInClassWoRenderer.DelegatedPropertyInClassWoRendererKt local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = delegatedPropertyInClassWoRenderer.kt, 5) local = a: delegatedPropertyInClassWoRenderer.A = {delegatedPropertyInClassWoRenderer.A@uniqueID} (sp = delegatedPropertyInClassWoRenderer.kt, 6) field = prop: int = {delegatedPropertyInClassWoRenderer.MyDelegate@uniqueID} (sp = delegatedPropertyInClassWoRenderer.kt, 12) diff --git a/idea/testData/debugger/tinyApp/outs/evBreakpointOnPropertyDeclaration.out b/idea/testData/debugger/tinyApp/outs/evBreakpointOnPropertyDeclaration.out index f7a933a1347..bf219cdee98 100644 --- a/idea/testData/debugger/tinyApp/outs/evBreakpointOnPropertyDeclaration.out +++ b/idea/testData/debugger/tinyApp/outs/evBreakpointOnPropertyDeclaration.out @@ -20,8 +20,8 @@ fun main(args: Array) { } // PRINT_FRAME +Compile bytecode for a2.prop frame = main():14, EvBreakpointOnPropertyDeclarationKt {evBreakpointOnPropertyDeclaration} - static = static = evBreakpointOnPropertyDeclaration.EvBreakpointOnPropertyDeclarationKt local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = evBreakpointOnPropertyDeclaration.kt, 7) local = a1: evBreakpointOnPropertyDeclaration.A = {evBreakpointOnPropertyDeclaration.A@uniqueID} (sp = evBreakpointOnPropertyDeclaration.kt, 8) field = prop: int = 1 (sp = evBreakpointOnPropertyDeclaration.kt, 4) diff --git a/idea/testData/debugger/tinyApp/outs/evDelegatedProperty.out b/idea/testData/debugger/tinyApp/outs/evDelegatedProperty.out index 6a325dc6eac..da7d7f60175 100644 --- a/idea/testData/debugger/tinyApp/outs/evDelegatedProperty.out +++ b/idea/testData/debugger/tinyApp/outs/evDelegatedProperty.out @@ -19,7 +19,6 @@ fun main(args: Array) { // PRINT_FRAME frame = main():13, EvDelegatedPropertyKt {evDelegatedProperty} - static = static = evDelegatedProperty.EvDelegatedPropertyKt local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = evDelegatedProperty.kt, 9) local = a: evDelegatedProperty.A = {evDelegatedProperty.A@uniqueID} (sp = evDelegatedProperty.kt, 10) field = prop$delegate: kotlin.properties.ReadWriteProperty = {kotlin.properties.NotNullVar@uniqueID} (sp = evDelegatedProperty.kt, 6) diff --git a/idea/testData/debugger/tinyApp/outs/evDuplicateItems.out b/idea/testData/debugger/tinyApp/outs/evDuplicateItems.out index 47820b38103..a97cf2ca19a 100644 --- a/idea/testData/debugger/tinyApp/outs/evDuplicateItems.out +++ b/idea/testData/debugger/tinyApp/outs/evDuplicateItems.out @@ -15,8 +15,8 @@ fun main(args: Array) { } // PRINT_FRAME +Compile bytecode for a.prop frame = main():10, EvDuplicateItemsKt {evDuplicateItems} - static = static = evDuplicateItems.EvDuplicateItemsKt local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = evDuplicateItems.kt, 7) local = a: evDuplicateItems.A = {evDuplicateItems.A@uniqueID} (sp = evDuplicateItems.kt, 8) field = prop: int = 1 (sp = evDuplicateItems.kt, 4) diff --git a/idea/testData/debugger/tinyApp/outs/evFinalProperty.out b/idea/testData/debugger/tinyApp/outs/evFinalProperty.out index 1e9cf77e1ff..07688a8faaf 100644 --- a/idea/testData/debugger/tinyApp/outs/evFinalProperty.out +++ b/idea/testData/debugger/tinyApp/outs/evFinalProperty.out @@ -16,7 +16,6 @@ fun main(args: Array) { // PRINT_FRAME frame = main():10, EvFinalPropertyKt {evFinalProperty} - static = static = evFinalProperty.EvFinalPropertyKt local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = evFinalProperty.kt, 7) local = a: evFinalProperty.A = {evFinalProperty.A@uniqueID} (sp = evFinalProperty.kt, 8) field = prop: int = 1 (sp = evFinalProperty.kt, 4) diff --git a/idea/testData/debugger/tinyApp/outs/evLineRange.out b/idea/testData/debugger/tinyApp/outs/evLineRange.out index 31270ab2f80..edbe112fceb 100644 --- a/idea/testData/debugger/tinyApp/outs/evLineRange.out +++ b/idea/testData/debugger/tinyApp/outs/evLineRange.out @@ -24,8 +24,8 @@ fun main(args: Array) { fun foo(i: Int) {} // PRINT_FRAME +Compile bytecode for a2.prop frame = main():15, EvLineRangeKt {evLineRange} - static = static = evLineRange.EvLineRangeKt local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = evLineRange.kt, 7) local = a1: evLineRange.A = {evLineRange.A@uniqueID} (sp = evLineRange.kt, 8) field = prop: int = 1 (sp = evLineRange.kt, 4) diff --git a/idea/testData/debugger/tinyApp/outs/evProperty.out b/idea/testData/debugger/tinyApp/outs/evProperty.out index b3261bd079a..d4a100a8241 100644 --- a/idea/testData/debugger/tinyApp/outs/evProperty.out +++ b/idea/testData/debugger/tinyApp/outs/evProperty.out @@ -17,8 +17,8 @@ fun main(args: Array) { } // PRINT_FRAME +Compile bytecode for a.prop frame = main():10, EvPropertyKt {evProperty} - static = static = evProperty.EvPropertyKt local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = evProperty.kt, 7) local = a: evProperty.A = {evProperty.A@uniqueID} (sp = evProperty.kt, 8) field = prop: int = 1 (sp = evProperty.kt, 4) diff --git a/idea/testData/debugger/tinyApp/outs/evPropertyRefExpr.out b/idea/testData/debugger/tinyApp/outs/evPropertyRefExpr.out index 20b014ded74..0e89423858a 100644 --- a/idea/testData/debugger/tinyApp/outs/evPropertyRefExpr.out +++ b/idea/testData/debugger/tinyApp/outs/evPropertyRefExpr.out @@ -20,6 +20,7 @@ fun main(args: Array) { } // PRINT_FRAME +Compile bytecode for prop frame = test():8, A {evPropertyRefExpr} this = this = {evPropertyRefExpr.A@uniqueID} field = prop: int = 1 (sp = evPropertyRefExpr.kt, 4) diff --git a/idea/testData/debugger/tinyApp/outs/evSkipAnonymousObject.out b/idea/testData/debugger/tinyApp/outs/evSkipAnonymousObject.out index a187a9e707f..0bfddf807c5 100644 --- a/idea/testData/debugger/tinyApp/outs/evSkipAnonymousObject.out +++ b/idea/testData/debugger/tinyApp/outs/evSkipAnonymousObject.out @@ -28,8 +28,8 @@ interface T { fun foo(i: Int) {} // PRINT_FRAME +Compile bytecode for a1.prop frame = main():12, EvSkipAnonymousObjectKt {evSkipAnonymousObject} - static = static = evSkipAnonymousObject.EvSkipAnonymousObjectKt local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = evSkipAnonymousObject.kt, 7) local = a1: evSkipAnonymousObject.A = {evSkipAnonymousObject.A@uniqueID} (sp = evSkipAnonymousObject.kt, 8) field = prop: int = 1 (sp = evSkipAnonymousObject.kt, 4) diff --git a/idea/testData/debugger/tinyApp/outs/evSkipLambda.out b/idea/testData/debugger/tinyApp/outs/evSkipLambda.out index 918ac307b09..30394fd6d64 100644 --- a/idea/testData/debugger/tinyApp/outs/evSkipLambda.out +++ b/idea/testData/debugger/tinyApp/outs/evSkipLambda.out @@ -23,8 +23,8 @@ fun foo(i: Int) {} fun l(f: () -> Unit) {} // PRINT_FRAME +Compile bytecode for a1.prop frame = main():12, EvSkipLambdaKt {evSkipLambda} - static = static = evSkipLambda.EvSkipLambdaKt local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = evSkipLambda.kt, 7) local = a1: evSkipLambda.A = {evSkipLambda.A@uniqueID} (sp = evSkipLambda.kt, 8) field = prop: int = 1 (sp = evSkipLambda.kt, 4) diff --git a/idea/testData/debugger/tinyApp/outs/evSkipLocalClass.out b/idea/testData/debugger/tinyApp/outs/evSkipLocalClass.out index bf581717cd7..6e28ab2f133 100644 --- a/idea/testData/debugger/tinyApp/outs/evSkipLocalClass.out +++ b/idea/testData/debugger/tinyApp/outs/evSkipLocalClass.out @@ -24,8 +24,8 @@ fun main(args: Array) { fun foo(i: Int) {} // PRINT_FRAME +Compile bytecode for a1.prop frame = main():12, EvSkipLocalClassKt {evSkipLocalClass} - static = static = evSkipLocalClass.EvSkipLocalClassKt local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = evSkipLocalClass.kt, 7) local = a1: evSkipLocalClass.A = {evSkipLocalClass.A@uniqueID} (sp = evSkipLocalClass.kt, 8) field = prop: int = 1 (sp = evSkipLocalClass.kt, 4) diff --git a/idea/testData/debugger/tinyApp/outs/frameClosingBracket.out b/idea/testData/debugger/tinyApp/outs/frameClosingBracket.out index 57527da974f..bac507e8540 100644 --- a/idea/testData/debugger/tinyApp/outs/frameClosingBracket.out +++ b/idea/testData/debugger/tinyApp/outs/frameClosingBracket.out @@ -15,7 +15,6 @@ fun main(args: Array) { // RESULT: 1: I frame = main():6, FrameClosingBracketKt {frameClosingBracket} - static = static = frameClosingBracket.FrameClosingBracketKt local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = frameClosingBracket.kt, 3) local = a: int = 1 (sp = frameClosingBracket.kt, 4) Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' diff --git a/idea/testData/debugger/tinyApp/outs/frameExtensionFun.out b/idea/testData/debugger/tinyApp/outs/frameExtensionFun.out index 756b816ee73..54d8d71960a 100644 --- a/idea/testData/debugger/tinyApp/outs/frameExtensionFun.out +++ b/idea/testData/debugger/tinyApp/outs/frameExtensionFun.out @@ -28,7 +28,6 @@ fun A.foo() { // EXPRESSION: myFun() // RESULT: 1: I frame = foo():14, FrameExtensionFunKt {frameExtensionFun} - static = static = frameExtensionFun.FrameExtensionFunKt local = $receiver: frameExtensionFun.A = {frameExtensionFun.A@uniqueID} (sp = null) field = prop: int = 1 (sp = frameExtensionFun.kt, 8) Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' diff --git a/idea/testData/debugger/tinyApp/outs/frameLocalVariable.out b/idea/testData/debugger/tinyApp/outs/frameLocalVariable.out index 1a0af447670..70c0f281d16 100644 --- a/idea/testData/debugger/tinyApp/outs/frameLocalVariable.out +++ b/idea/testData/debugger/tinyApp/outs/frameLocalVariable.out @@ -12,7 +12,6 @@ fun main(args: Array) { // PRINT_FRAME frame = main():6, FrameLocalVariableKt {frameLocalVariable} - static = static = frameLocalVariable.FrameLocalVariableKt local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = frameLocalVariable.kt, 3) local = val1: int = 1 (sp = frameLocalVariable.kt, 4) Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' diff --git a/idea/testData/debugger/tinyApp/outs/frameSharedVarLocalVar.out b/idea/testData/debugger/tinyApp/outs/frameSharedVarLocalVar.out index 55c6c28c40e..b24fb55f809 100644 --- a/idea/testData/debugger/tinyApp/outs/frameSharedVarLocalVar.out +++ b/idea/testData/debugger/tinyApp/outs/frameSharedVarLocalVar.out @@ -22,7 +22,6 @@ inline fun foo(f: () -> Unit) { // EXPRESSION: var1 // RESULT: 1: I frame = main():7, FrameSharedVarLocalVarKt {frameSharedVarLocalVar} - static = static = frameSharedVarLocalVar.FrameSharedVarLocalVarKt local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = frameSharedVarLocalVar.kt, 3) local = var1: kotlin.jvm.internal.Ref$IntRef = {kotlin.jvm.internal.Ref$IntRef@uniqueID}1 (sp = frameSharedVarLocalVar.kt, 4) field = element: int = 1 (sp = Ref.!EXT!) diff --git a/idea/testData/debugger/tinyApp/outs/toStringRenderer.out b/idea/testData/debugger/tinyApp/outs/toStringRenderer.out index 35fd1d2ff55..0cef0822278 100644 --- a/idea/testData/debugger/tinyApp/outs/toStringRenderer.out +++ b/idea/testData/debugger/tinyApp/outs/toStringRenderer.out @@ -16,7 +16,6 @@ class A { // PRINT_FRAME frame = main():6, ToStringRendererKt {toStringRenderer} - static = static = toStringRenderer.ToStringRendererKt local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = toStringRenderer.kt, 3) local = a: toStringRenderer.A = {toStringRenderer.A@uniqueID}myA (sp = toStringRenderer.kt, 4) - No fields to display diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinDebuggerTestCase.java b/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinDebuggerTestCase.java index da1197539f6..f79e067918e 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinDebuggerTestCase.java +++ b/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinDebuggerTestCase.java @@ -34,6 +34,7 @@ import com.intellij.psi.JavaPsiFacade; import com.intellij.psi.PsiClass; import com.intellij.psi.search.GlobalSearchScope; import com.intellij.testFramework.IdeaTestUtil; +import com.intellij.xdebugger.XDebugSession; import org.jetbrains.annotations.NotNull; import org.jetbrains.kotlin.asJava.FakeLightClassForFileOfPackage; import org.jetbrains.kotlin.asJava.KotlinLightClassForFacade; @@ -238,4 +239,12 @@ public abstract class KotlinDebuggerTestCase extends DescriptorTestCase { e.getActual()); } } + + @Override + public Object getData(String dataId) { + if (XDebugSession.DATA_KEY.is(dataId)) { + return myDebuggerSession == null ? null : myDebuggerSession.getXDebugSession(); + } + return super.getData(dataId); + } } diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/AbstractKotlinEvaluateExpressionTest.kt b/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/AbstractKotlinEvaluateExpressionTest.kt index c5d62a10401..215eec8e18a 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/AbstractKotlinEvaluateExpressionTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/AbstractKotlinEvaluateExpressionTest.kt @@ -17,16 +17,14 @@ package org.jetbrains.kotlin.idea.debugger.evaluate import com.intellij.debugger.SourcePosition -import com.intellij.debugger.engine.ContextUtil -import com.intellij.debugger.engine.SourcePositionProvider -import com.intellij.debugger.engine.SuspendContextImpl +import com.intellij.debugger.engine.* import com.intellij.debugger.engine.evaluation.CodeFragmentKind import com.intellij.debugger.engine.evaluation.EvaluateException import com.intellij.debugger.engine.evaluation.TextWithImports import com.intellij.debugger.engine.evaluation.TextWithImportsImpl import com.intellij.debugger.engine.evaluation.expression.EvaluatorBuilderImpl +import com.intellij.debugger.impl.DescriptorTestCase import com.intellij.debugger.settings.NodeRendererSettings -import com.intellij.debugger.ui.impl.FrameVariablesTree import com.intellij.debugger.ui.impl.watch.* import com.intellij.debugger.ui.tree.FieldDescriptor import com.intellij.debugger.ui.tree.LocalVariableDescriptor @@ -36,8 +34,15 @@ import com.intellij.execution.process.ProcessOutputTypes import com.intellij.openapi.util.Disposer import com.intellij.openapi.util.io.FileUtil import com.intellij.psi.PsiElement +import com.intellij.xdebugger.impl.XDebugSessionImpl +import com.intellij.xdebugger.impl.breakpoints.XExpressionImpl +import com.intellij.xdebugger.impl.frame.XDebugViewSessionListener +import com.intellij.xdebugger.impl.frame.XVariablesView +import com.intellij.xdebugger.impl.frame.XWatchesViewImpl import com.intellij.xdebugger.impl.ui.XDebuggerUIConstants import com.intellij.xdebugger.impl.ui.tree.ValueMarkup +import com.intellij.xdebugger.impl.ui.tree.XDebuggerTree +import com.intellij.xdebugger.impl.ui.tree.nodes.* import com.sun.jdi.ObjectReference import org.apache.log4j.AppenderSkeleton import org.apache.log4j.Level @@ -53,8 +58,8 @@ import org.jetbrains.kotlin.idea.util.application.runReadAction import org.jetbrains.kotlin.test.InTextDirectivesUtils import org.junit.Assert import java.io.File -import java.util.Collections -import kotlin.test.fail +import java.util.* +import javax.swing.tree.TreeNode public abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestBase() { private val logger = Logger.getLogger(javaClass())!! @@ -115,6 +120,9 @@ public abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestB doStepping(path) + val variablesView = createVariablesView() + val watchesView = createWatchesView() + doOnBreakpoint { val exceptions = linkedMapOf() try { @@ -131,8 +139,8 @@ public abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestB } } finally { - if (shouldPrintFrame) { - printFrame() + if (shouldPrintFrame) { + printFrame(variablesView, watchesView) println(fileText, ProcessOutputTypes.SYSTEM) } else { @@ -174,25 +182,44 @@ public abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestB finish() } - private fun SuspendContextImpl.printFrame() { - val tree = FrameVariablesTree(getProject()!!) - Disposer.register(getTestRootDisposable()!!, tree); + private fun createWatchesView(): XWatchesViewImpl { + val session = myDebuggerSession.xDebugSession as XDebugSessionImpl + val watchesView = XWatchesViewImpl(session) + Disposer.register(testRootDisposable, watchesView) + session.addSessionListener(XDebugViewSessionListener(watchesView), testRootDisposable) + return watchesView + } - invokeRatherLater(this) { - tree.rebuild(debuggerContext) - expandAll(tree, Runnable { - try { - val printer = Printer() - printer.printTree(tree) - for (extra in getExtraVars()) { - printer.printDescriptor(tree.getNodeFactory().getWatchItemDescriptor(null, extra, null), 2) + private fun createVariablesView(): XVariablesView { + val session = myDebuggerSession.xDebugSession as XDebugSessionImpl + val variablesView = XVariablesView(session) + Disposer.register(testRootDisposable, variablesView) + session.addSessionListener(XDebugViewSessionListener(variablesView), testRootDisposable) + return variablesView + } + + private fun SuspendContextImpl.printFrame(variablesView: XVariablesView, watchesView: XWatchesViewImpl) { + val tree = variablesView.tree!! + expandAll( + tree, + Runnable { + try { + Printer().printTree(tree) + + for (extra in getExtraVars()) { + watchesView.addWatchExpression(XExpressionImpl.fromText(extra.text), -1, false); + } + Printer().printTree(watchesView.tree) } - } - finally { - resume(this@printFrame) - } - }) - } + finally { + resume(this) + } + }, + hashSetOf(), + // TODO why this is needed? Otherwise some tests are never ended + DescriptorTestCase.NodeFilter { it !is XValueNodeImpl || it.name != "cause" }, + this + ) } fun getExtraVars(): Set { @@ -200,15 +227,24 @@ public abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestB } private inner class Printer() { - fun printTree(tree: DebuggerTree) { - val root = tree.getMutableModel()!!.getRoot() as DebuggerTreeNodeImpl + fun printTree(tree: XDebuggerTree) { + val root = tree.treeModel.root as TreeNode printNode(root, 0) } - private fun printNode(node: DebuggerTreeNodeImpl, indent: Int) { - val descriptor: NodeDescriptorImpl = node.getDescriptor()!! + private fun printNode(node: TreeNode, indent: Int) { + val descriptor = when { + node is DebuggerTreeNodeImpl -> node.descriptor + node is XValueNodeImpl -> (node.valueContainer as? JavaValue)?.descriptor ?: MessageDescriptor(node.text.toString()) + node is XStackFrameNode -> (node.valueContainer as? JavaStackFrame)?.descriptor + node is XValueGroupNodeImpl -> (node.valueContainer as? JavaStaticGroup)?.descriptor + node is WatchesRootNode -> null + node is WatchMessageNode -> WatchItemDescriptor(project, TextWithImportsImpl(CodeFragmentKind.EXPRESSION, node.expression.expression)) + node is MessageTreeNode -> MessageDescriptor(node.text.toString()) + else -> MessageDescriptor(node.toString()) + } - if (printDescriptor(descriptor, indent)) return + if (descriptor != null && printDescriptor(descriptor, indent)) return printChildren(node, indent + 2) } @@ -216,7 +252,11 @@ public abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestB fun printDescriptor(descriptor: NodeDescriptorImpl, indent: Int): Boolean { if (descriptor is DefaultNodeDescriptor) return true - val label = descriptor.getLabel()!! + var label = descriptor.label + // TODO: update presentation before calc label + if (label == NodeDescriptorImpl.UNKNOWN_VALUE_MESSAGE && descriptor is StaticDescriptor) { + label = "static = " + NodeRendererSettings.getInstance().classRenderer.renderTypeName(descriptor.type.name()) + } if (label.endsWith(XDebuggerUIConstants.COLLECTING_DATA_MESSAGE)) return true val curIndent = " ".repeat(indent) @@ -235,10 +275,10 @@ public abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestB return false } - private fun printChildren(node: DebuggerTreeNodeImpl, indent: Int) { - val e = node.rawChildren()!! + private fun printChildren(node: TreeNode, indent: Int) { + val e = node.children() while (e.hasMoreElements()) { - printNode(e.nextElement() as DebuggerTreeNodeImpl, indent) + printNode(e.nextElement() as TreeNode, indent) } }