1

Let's say I have the following in kotlin

    const val ME_FIRST = "FIRST/"
    const val ME_SECOND = "SECOND/"
    const val ME_THIRD = "THIRD/"
    const val AT_THE_END = "PutMeFirst/"

    const val SOME_OF_IT = ME_FIRST + ME_SECOND + ME_THIRD
    const val ALL_OF_IT = AT_THE_END + SOME_OF_IT

In Intellij, is there a way to press + click on ALL_OF_IT and see that the value equals PutMeFirst/FIRST/SECOND/THIRD/ in the hint or in the documentation window? Right now it's only showing something like

public const final val ALL_OF_IT: String

I tried adding annotations above each item as well as the final item using the javadoc syntax

/**
* {@value #ALL_OF_IT}
*/

But again, in the "Documentation:" window it just shows the literal values from the description

public const final val ALL_OF_IT: String
{@value #ALL_OF_IT}
Jolley71717
  • 678
  • 1
  • 8
  • 20
  • Have you looked at this? https://stackoverflow.com/questions/15335260/how-find-out-static-string-result-concatenation-in-intellij-idea-without-running – gpunto Oct 03 '19 at 19:28
  • 1
    @gpunto, yes I have. That seems like an extraordinary amount of work to have to do in order to see something that intellij already has access to. It's kind of unbelievable that I would have to copy and paste that in order to see what would be generated. I've seen this type of functionality with Spring properties where it preemptively shows you what the values are so you don't even have to click. – Jolley71717 Oct 03 '19 at 19:33
  • Seems to be an oversight to me. You can Alt+Middle-Click Java fields and at least see their declaration (not the resolved value of static final fields, though). In Kotlin, this only shows you the type of the parameter. – Tenfour04 Oct 03 '19 at 20:54

0 Answers0