From 78ed38944812ee729ae7749ec206e3eb677b2387 Mon Sep 17 00:00:00 2001 From: Yaroslav Lepenkin Date: Thu, 26 Jan 2017 18:12:21 +0300 Subject: [PATCH] [inlay tests] removed psi dump, added more logging --- .../src/com/intellij/codeInsight/hints/JavaHintUtils.kt | 8 +++++++- .../codeInsight/daemon/inlays/InlayParameterHintsTest.kt | 1 - .../codeInsight/hints/ParameterHintsPassFactory.java | 1 - 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/java/java-impl/src/com/intellij/codeInsight/hints/JavaHintUtils.kt b/java/java-impl/src/com/intellij/codeInsight/hints/JavaHintUtils.kt index 65c1952a0bea..75d368306b80 100644 --- a/java/java-impl/src/com/intellij/codeInsight/hints/JavaHintUtils.kt +++ b/java/java-impl/src/com/intellij/codeInsight/hints/JavaHintUtils.kt @@ -91,7 +91,13 @@ object JavaInlayHintsProvider { private fun createUnclearInlays(args: List): List { return args .filter { isUnclearExpression(it.argument) } - .mapNotNull { createInlayInfo(it.argument, it.parameter) } + .mapNotNull { + val inlayInfo = createInlayInfo(it.argument, it.parameter) + if (ParameterHintsPassFactory.isDebug()) { + println("Hint for ${it.argument} : ${inlayInfo?.text}") + } + inlayInfo + } } private fun getVarArgInlay(info: CallInfo): InlayInfo? { diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/inlays/InlayParameterHintsTest.kt b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/inlays/InlayParameterHintsTest.kt index 7a813df4bbb6..5996c9380d75 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/inlays/InlayParameterHintsTest.kt +++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/inlays/InlayParameterHintsTest.kt @@ -67,7 +67,6 @@ abstract class InlayParameterHintsTest : LightCodeInsightFixtureTestCase() { assertThat(actualInlays.size) .withFailMessage("Expected ${expectedInlays.size} elements with hints, Actual elements count ${actualInlays.size}" + ", file text: \n\n ${file.text} \n\n isCommitted ${isCommitted(file)} \n\n" + - "Psi: \n ${DebugUtil.psiToString(file, true)}\n" + "All inlays: ${actualInlays}") .isEqualTo(expectedInlays.size) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/hints/ParameterHintsPassFactory.java b/platform/lang-impl/src/com/intellij/codeInsight/hints/ParameterHintsPassFactory.java index 1ecc01f12710..15b9755d8437 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/hints/ParameterHintsPassFactory.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/hints/ParameterHintsPassFactory.java @@ -58,7 +58,6 @@ public class ParameterHintsPassFactory extends AbstractProjectComponent implemen isDebug = value; } - @TestOnly public static boolean isDebug() { return isDebug; }