diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/codeMetaInfo/model/CodeMetaInfo.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/codeMetaInfo/model/CodeMetaInfo.kt index a50d791152e..bcb4798ca1f 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/codeMetaInfo/model/CodeMetaInfo.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/codeMetaInfo/model/CodeMetaInfo.kt @@ -10,9 +10,9 @@ import org.jetbrains.kotlin.codeMetaInfo.renderConfigurations.AbstractCodeMetaIn interface CodeMetaInfo { val start: Int val end: Int + val tag: String val renderConfiguration: AbstractCodeMetaInfoRenderConfiguration val platforms: MutableList fun asString(): String - fun getTag(): String } diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/codeMetaInfo/model/DiagnosticCodeMetaInfo.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/codeMetaInfo/model/DiagnosticCodeMetaInfo.kt index 4eae522e47d..0867f996da0 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/codeMetaInfo/model/DiagnosticCodeMetaInfo.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/codeMetaInfo/model/DiagnosticCodeMetaInfo.kt @@ -21,9 +21,10 @@ class DiagnosticCodeMetaInfo( diagnostic: Diagnostic ) : this(range.startOffset, range.endOffset, renderConfiguration, diagnostic) + override val tag: String + get() = renderConfiguration.getTag(this) + override val platforms: MutableList = mutableListOf() override fun asString(): String = renderConfiguration.asString(this) - - override fun getTag(): String = renderConfiguration.getTag(this) } diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/codeMetaInfo/model/ParsedCodeMetaInfo.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/codeMetaInfo/model/ParsedCodeMetaInfo.kt index f5cc2796ff8..2e15df0e8eb 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/codeMetaInfo/model/ParsedCodeMetaInfo.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/codeMetaInfo/model/ParsedCodeMetaInfo.kt @@ -11,18 +11,16 @@ class ParsedCodeMetaInfo( override val start: Int, override val end: Int, override val platforms: MutableList, - private val tag: String, + override val tag: String, val description: String? ) : CodeMetaInfo { override val renderConfiguration = object : AbstractCodeMetaInfoRenderConfiguration(false) {} override fun asString(): String = renderConfiguration.asString(this) - override fun getTag(): String = tag - override fun equals(other: Any?): Boolean { if (other == null || other !is CodeMetaInfo) return false - return this.tag == other.getTag() && this.start == other.start && this.end == other.end + return this.tag == other.tag && this.start == other.start && this.end == other.end } override fun hashCode(): Int { diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/codeMetaInfo/renderConfigurations/AbstractCodeMetaInfoRenderConfiguration.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/codeMetaInfo/renderConfigurations/AbstractCodeMetaInfoRenderConfiguration.kt index e76f705402f..3c72f7329da 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/codeMetaInfo/renderConfigurations/AbstractCodeMetaInfoRenderConfiguration.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/codeMetaInfo/renderConfigurations/AbstractCodeMetaInfoRenderConfiguration.kt @@ -10,7 +10,7 @@ import org.jetbrains.kotlin.codeMetaInfo.model.CodeMetaInfo abstract class AbstractCodeMetaInfoRenderConfiguration(var renderParams: Boolean = true) { private val clickOrPressRegex = "Click or press (.*)to navigate".toRegex() // We have different hotkeys on different platforms - open fun asString(codeMetaInfo: CodeMetaInfo) = codeMetaInfo.getTag() + getPlatformsString(codeMetaInfo) + open fun asString(codeMetaInfo: CodeMetaInfo): String = codeMetaInfo.tag + getPlatformsString(codeMetaInfo) open fun getAdditionalParams(codeMetaInfo: CodeMetaInfo) = "" diff --git a/idea/tests/org/jetbrains/kotlin/idea/codeMetaInfo/models/HighlightingCodeMetaInfo.kt b/idea/tests/org/jetbrains/kotlin/idea/codeMetaInfo/models/HighlightingCodeMetaInfo.kt index 8c6b456b257..d47a5480a59 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/codeMetaInfo/models/HighlightingCodeMetaInfo.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/codeMetaInfo/models/HighlightingCodeMetaInfo.kt @@ -17,9 +17,11 @@ class HighlightingCodeMetaInfo( get() = highlightingInfo.startOffset override val end: Int get() = highlightingInfo.endOffset + + override val tag: String + get() = renderConfiguration.getTag() + override val platforms: MutableList = mutableListOf() override fun asString(): String = renderConfiguration.asString(this) - - override fun getTag(): String = renderConfiguration.getTag() } diff --git a/idea/tests/org/jetbrains/kotlin/idea/codeMetaInfo/models/LineMarkerCodeMetaInfo.kt b/idea/tests/org/jetbrains/kotlin/idea/codeMetaInfo/models/LineMarkerCodeMetaInfo.kt index 4ae09ef6735..c397e6f67d5 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/codeMetaInfo/models/LineMarkerCodeMetaInfo.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/codeMetaInfo/models/LineMarkerCodeMetaInfo.kt @@ -17,9 +17,11 @@ class LineMarkerCodeMetaInfo( get() = lineMarker.startOffset override val end: Int get() = lineMarker.endOffset + + override val tag: String + get() = renderConfiguration.getTag() + override val platforms: MutableList = mutableListOf() override fun asString(): String = renderConfiguration.asString(this) - - override fun getTag(): String = renderConfiguration.getTag() }