[CMI] Rename platforms to attributes in some forgotten places
This commit is contained in:
+3
-3
@@ -15,7 +15,7 @@ object CodeMetaInfoParser {
|
||||
|
||||
/*
|
||||
* ([\S&&[^,(){}]]+) -- tag, allowing all non-space characters except bracers and curly bracers
|
||||
* ([{](.*?)[}])? -- list of platforms
|
||||
* ([{](.*?)[}])? -- list of attributes
|
||||
* (\("(.*?)"\))? -- arguments of meta info
|
||||
* (, )? -- possible separator between different infos
|
||||
*/
|
||||
@@ -60,14 +60,14 @@ object CodeMetaInfoParser {
|
||||
val allMetaInfos = openingMatchResult.groups[2]!!.value
|
||||
tagRegex.findAll(allMetaInfos).map { it.groups }.forEach {
|
||||
val tag = it[1]!!.value
|
||||
val platforms = it[3]?.value?.split(";") ?: emptyList()
|
||||
val attributes = it[3]?.value?.split(";") ?: emptyList()
|
||||
val description = it[5]?.value
|
||||
|
||||
result.add(
|
||||
ParsedCodeMetaInfo(
|
||||
openingMatchResult.range.first,
|
||||
closingMatchResult.range.first,
|
||||
platforms.toMutableList(),
|
||||
attributes.toMutableList(),
|
||||
tag,
|
||||
description
|
||||
)
|
||||
|
||||
+2
-2
@@ -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): String = codeMetaInfo.tag + getPlatformsString(codeMetaInfo)
|
||||
open fun asString(codeMetaInfo: CodeMetaInfo): String = codeMetaInfo.tag + getAttributesString(codeMetaInfo)
|
||||
|
||||
open fun getAdditionalParams(codeMetaInfo: CodeMetaInfo) = ""
|
||||
|
||||
@@ -31,7 +31,7 @@ abstract class AbstractCodeMetaInfoRenderConfiguration(var renderParams: Boolean
|
||||
return sanitizedText
|
||||
}
|
||||
|
||||
protected fun getPlatformsString(codeMetaInfo: CodeMetaInfo): String {
|
||||
protected fun getAttributesString(codeMetaInfo: CodeMetaInfo): String {
|
||||
if (codeMetaInfo.attributes.isEmpty()) return ""
|
||||
return "{${codeMetaInfo.attributes.joinToString(";")}}"
|
||||
}
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ open class DiagnosticCodeMetaInfoRenderConfiguration(
|
||||
override fun asString(codeMetaInfo: CodeMetaInfo): String {
|
||||
if (codeMetaInfo !is DiagnosticCodeMetaInfo) return ""
|
||||
return (getTag(codeMetaInfo)
|
||||
+ getPlatformsString(codeMetaInfo)
|
||||
+ getAttributesString(codeMetaInfo)
|
||||
+ getParamsString(codeMetaInfo))
|
||||
.replace(crossPlatformLineBreak, "")
|
||||
}
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ class FirDiagnosticCodeMetaRenderConfiguration(
|
||||
override fun asString(codeMetaInfo: CodeMetaInfo): String {
|
||||
if (codeMetaInfo !is FirDiagnosticCodeMetaInfo) return ""
|
||||
return (getTag(codeMetaInfo)
|
||||
+ getPlatformsString(codeMetaInfo)
|
||||
+ getAttributesString(codeMetaInfo)
|
||||
+ getParamsString(codeMetaInfo))
|
||||
.replace(crossPlatformLineBreak, "")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user