[CMI] Fix clearing code meta infos from original text
This commit is contained in:
@@ -8,8 +8,10 @@ package org.jetbrains.kotlin.codeMetaInfo
|
|||||||
import org.jetbrains.kotlin.codeMetaInfo.model.ParsedCodeMetaInfo
|
import org.jetbrains.kotlin.codeMetaInfo.model.ParsedCodeMetaInfo
|
||||||
|
|
||||||
object CodeMetaInfoParser {
|
object CodeMetaInfoParser {
|
||||||
private val openingRegex = """(<!([^"]*?(".*?")?[^"]*?)!>)""".toRegex()
|
val openingRegex = """(<!([^"]*?((".*?")(, ".*?")*?)?[^"]*?)!>)""".toRegex()
|
||||||
private val closingRegex = """(<!>)""".toRegex()
|
val closingRegex = """(<!>)""".toRegex()
|
||||||
|
|
||||||
|
val openingOrClosingRegex = """(${closingRegex.pattern}|${openingRegex.pattern})""".toRegex()
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ([\S&&[^,(){}]]+) -- tag, allowing all non-space characters except bracers and curly bracers
|
* ([\S&&[^,(){}]]+) -- tag, allowing all non-space characters except bracers and curly bracers
|
||||||
|
|||||||
+1
-1
@@ -106,4 +106,4 @@ fun clearFileFromDiagnosticMarkup(file: File) {
|
|||||||
file.writeText(cleanText)
|
file.writeText(cleanText)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun clearTextFromDiagnosticMarkup(text: String): String = CheckerTestUtil.rangeStartOrEndPattern.matcher(text).replaceAll("")
|
fun clearTextFromDiagnosticMarkup(text: String): String = text.replace(CodeMetaInfoParser.openingOrClosingRegex, "")
|
||||||
|
|||||||
Reference in New Issue
Block a user