Hi, I am experiencing an issue with printing hyper...
# intellij
n
Hi, I am experiencing an issue with printing hyperlinks in error messages in IntelliJ IDEA 2024.2.4 (Ultimate Edition). In IntelliJ IDEA 2024.2.3, the following code works fine and prints the file paths as clickable hyperlinks:
Copy code
fun toHyperlink(path: String): String {
    val absolutePath = File(path).absolutePath
    return absolutePath
}
However, in IntelliJ IDEA 2024.2.4 (Ultimate Edition), this no longer works. To display the paths as clickable links, I now need to add the prefix
file:/
to the absolute path, like this:
Copy code
fun toHyperlink(path: String): String {
    val absolutePath = File(path).absolutePath
    return "file://$absolutePath"
}
Does anyone have any idea why this behaviour has changed between versions? Is it because of the Ultimate Edition, or could there be another reason for this difference? Thank you in advance for your help!
a
Hi, where do you pass those "hyperlinked" string?
n
I am creating a
String
message containing hyperlinks and passing it to an exception:
Copy code
class KoAssertionFailedException(
    message: String? = null,
    cause: Throwable? = null,
) : KoException(message, cause)
The exception is initialized as follows:
Copy code
KoAssertionFailedException(messageWithHyperlinks)
The expected output on the console should resemble what is shown in the first attachment, and this behaviour is observed in IntelliJ IDEA version 2024.2.3. However, in IntelliJ IDEA version 2024.2.4 (Ultimate Edition), the output differs and looks like what is shown in the second attachment.