[CMI] Replace getTag with tag property in CodeMetaInfo
This commit is contained in:
@@ -10,9 +10,9 @@ import org.jetbrains.kotlin.codeMetaInfo.renderConfigurations.AbstractCodeMetaIn
|
|||||||
interface CodeMetaInfo {
|
interface CodeMetaInfo {
|
||||||
val start: Int
|
val start: Int
|
||||||
val end: Int
|
val end: Int
|
||||||
|
val tag: String
|
||||||
val renderConfiguration: AbstractCodeMetaInfoRenderConfiguration
|
val renderConfiguration: AbstractCodeMetaInfoRenderConfiguration
|
||||||
val platforms: MutableList<String>
|
val platforms: MutableList<String>
|
||||||
|
|
||||||
fun asString(): String
|
fun asString(): String
|
||||||
fun getTag(): String
|
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -21,9 +21,10 @@ class DiagnosticCodeMetaInfo(
|
|||||||
diagnostic: Diagnostic
|
diagnostic: Diagnostic
|
||||||
) : this(range.startOffset, range.endOffset, renderConfiguration, diagnostic)
|
) : this(range.startOffset, range.endOffset, renderConfiguration, diagnostic)
|
||||||
|
|
||||||
|
override val tag: String
|
||||||
|
get() = renderConfiguration.getTag(this)
|
||||||
|
|
||||||
override val platforms: MutableList<String> = mutableListOf()
|
override val platforms: MutableList<String> = mutableListOf()
|
||||||
|
|
||||||
override fun asString(): String = renderConfiguration.asString(this)
|
override fun asString(): String = renderConfiguration.asString(this)
|
||||||
|
|
||||||
override fun getTag(): String = renderConfiguration.getTag(this)
|
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-4
@@ -11,18 +11,16 @@ class ParsedCodeMetaInfo(
|
|||||||
override val start: Int,
|
override val start: Int,
|
||||||
override val end: Int,
|
override val end: Int,
|
||||||
override val platforms: MutableList<String>,
|
override val platforms: MutableList<String>,
|
||||||
private val tag: String,
|
override val tag: String,
|
||||||
val description: String?
|
val description: String?
|
||||||
) : CodeMetaInfo {
|
) : CodeMetaInfo {
|
||||||
override val renderConfiguration = object : AbstractCodeMetaInfoRenderConfiguration(false) {}
|
override val renderConfiguration = object : AbstractCodeMetaInfoRenderConfiguration(false) {}
|
||||||
|
|
||||||
override fun asString(): String = renderConfiguration.asString(this)
|
override fun asString(): String = renderConfiguration.asString(this)
|
||||||
|
|
||||||
override fun getTag(): String = tag
|
|
||||||
|
|
||||||
override fun equals(other: Any?): Boolean {
|
override fun equals(other: Any?): Boolean {
|
||||||
if (other == null || other !is CodeMetaInfo) return false
|
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 {
|
override fun hashCode(): Int {
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ import org.jetbrains.kotlin.codeMetaInfo.model.CodeMetaInfo
|
|||||||
|
|
||||||
abstract class AbstractCodeMetaInfoRenderConfiguration(var renderParams: Boolean = true) {
|
abstract class AbstractCodeMetaInfoRenderConfiguration(var renderParams: Boolean = true) {
|
||||||
private val clickOrPressRegex = "Click or press (.*)to navigate".toRegex() // We have different hotkeys on different platforms
|
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) = ""
|
open fun getAdditionalParams(codeMetaInfo: CodeMetaInfo) = ""
|
||||||
|
|
||||||
|
|||||||
+4
-2
@@ -17,9 +17,11 @@ class HighlightingCodeMetaInfo(
|
|||||||
get() = highlightingInfo.startOffset
|
get() = highlightingInfo.startOffset
|
||||||
override val end: Int
|
override val end: Int
|
||||||
get() = highlightingInfo.endOffset
|
get() = highlightingInfo.endOffset
|
||||||
|
|
||||||
|
override val tag: String
|
||||||
|
get() = renderConfiguration.getTag()
|
||||||
|
|
||||||
override val platforms: MutableList<String> = mutableListOf()
|
override val platforms: MutableList<String> = mutableListOf()
|
||||||
|
|
||||||
override fun asString(): String = renderConfiguration.asString(this)
|
override fun asString(): String = renderConfiguration.asString(this)
|
||||||
|
|
||||||
override fun getTag(): String = renderConfiguration.getTag()
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,9 +17,11 @@ class LineMarkerCodeMetaInfo(
|
|||||||
get() = lineMarker.startOffset
|
get() = lineMarker.startOffset
|
||||||
override val end: Int
|
override val end: Int
|
||||||
get() = lineMarker.endOffset
|
get() = lineMarker.endOffset
|
||||||
|
|
||||||
|
override val tag: String
|
||||||
|
get() = renderConfiguration.getTag()
|
||||||
|
|
||||||
override val platforms: MutableList<String> = mutableListOf()
|
override val platforms: MutableList<String> = mutableListOf()
|
||||||
|
|
||||||
override fun asString(): String = renderConfiguration.asString(this)
|
override fun asString(): String = renderConfiguration.asString(this)
|
||||||
|
|
||||||
override fun getTag(): String = renderConfiguration.getTag()
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user