[CMI] Rename CodeMetaInfo.platforms to attributes
This commit is contained in:
@@ -12,7 +12,7 @@ interface CodeMetaInfo {
|
|||||||
val end: Int
|
val end: Int
|
||||||
val tag: String
|
val tag: String
|
||||||
val renderConfiguration: AbstractCodeMetaInfoRenderConfiguration
|
val renderConfiguration: AbstractCodeMetaInfoRenderConfiguration
|
||||||
val platforms: MutableList<String>
|
val attributes: MutableList<String>
|
||||||
|
|
||||||
fun asString(): String
|
fun asString(): String
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -24,7 +24,7 @@ class DiagnosticCodeMetaInfo(
|
|||||||
override val tag: String
|
override val tag: String
|
||||||
get() = renderConfiguration.getTag(this)
|
get() = renderConfiguration.getTag(this)
|
||||||
|
|
||||||
override val platforms: MutableList<String> = mutableListOf()
|
override val attributes: MutableList<String> = mutableListOf()
|
||||||
|
|
||||||
override fun asString(): String = renderConfiguration.asString(this)
|
override fun asString(): String = renderConfiguration.asString(this)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ import org.jetbrains.kotlin.codeMetaInfo.renderConfigurations.AbstractCodeMetaIn
|
|||||||
class ParsedCodeMetaInfo(
|
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 attributes: MutableList<String>,
|
||||||
override val tag: String,
|
override val tag: String,
|
||||||
val description: String?
|
val description: String?
|
||||||
) : CodeMetaInfo {
|
) : CodeMetaInfo {
|
||||||
|
|||||||
+2
-2
@@ -32,7 +32,7 @@ abstract class AbstractCodeMetaInfoRenderConfiguration(var renderParams: Boolean
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected fun getPlatformsString(codeMetaInfo: CodeMetaInfo): String {
|
protected fun getPlatformsString(codeMetaInfo: CodeMetaInfo): String {
|
||||||
if (codeMetaInfo.platforms.isEmpty()) return ""
|
if (codeMetaInfo.attributes.isEmpty()) return ""
|
||||||
return "{${codeMetaInfo.platforms.joinToString(";")}}"
|
return "{${codeMetaInfo.attributes.joinToString(";")}}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -161,13 +161,13 @@ class CodeMetaInfoTestCase(
|
|||||||
val correspondingParsed = parsedMetaInfo.firstOrNull { it == codeMetaInfo }
|
val correspondingParsed = parsedMetaInfo.firstOrNull { it == codeMetaInfo }
|
||||||
if (correspondingParsed != null) {
|
if (correspondingParsed != null) {
|
||||||
parsedMetaInfo.remove(correspondingParsed)
|
parsedMetaInfo.remove(correspondingParsed)
|
||||||
codeMetaInfo.platforms.addAll(correspondingParsed.platforms)
|
codeMetaInfo.attributes.addAll(correspondingParsed.attributes)
|
||||||
if (correspondingParsed.platforms.isNotEmpty() && OSKind.current.toString() !in correspondingParsed.platforms)
|
if (correspondingParsed.attributes.isNotEmpty() && OSKind.current.toString() !in correspondingParsed.attributes)
|
||||||
codeMetaInfo.platforms.add(OSKind.current.toString())
|
codeMetaInfo.attributes.add(OSKind.current.toString())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
parsedMetaInfo.forEach {
|
parsedMetaInfo.forEach {
|
||||||
if (it.platforms.isNotEmpty() && OSKind.current.toString() !in it.platforms) codeMetaInfoForCheck.add(
|
if (it.attributes.isNotEmpty() && OSKind.current.toString() !in it.attributes) codeMetaInfoForCheck.add(
|
||||||
it
|
it
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@ class HighlightingCodeMetaInfo(
|
|||||||
override val tag: String
|
override val tag: String
|
||||||
get() = renderConfiguration.getTag()
|
get() = renderConfiguration.getTag()
|
||||||
|
|
||||||
override val platforms: MutableList<String> = mutableListOf()
|
override val attributes: MutableList<String> = mutableListOf()
|
||||||
|
|
||||||
override fun asString(): String = renderConfiguration.asString(this)
|
override fun asString(): String = renderConfiguration.asString(this)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class LineMarkerCodeMetaInfo(
|
|||||||
override val tag: String
|
override val tag: String
|
||||||
get() = renderConfiguration.getTag()
|
get() = renderConfiguration.getTag()
|
||||||
|
|
||||||
override val platforms: MutableList<String> = mutableListOf()
|
override val attributes: MutableList<String> = mutableListOf()
|
||||||
|
|
||||||
override fun asString(): String = renderConfiguration.asString(this)
|
override fun asString(): String = renderConfiguration.asString(this)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user