[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
|
||||
|
||||
object CodeMetaInfoParser {
|
||||
private val openingRegex = """(<!([^"]*?(".*?")?[^"]*?)!>)""".toRegex()
|
||||
private val closingRegex = """(<!>)""".toRegex()
|
||||
val openingRegex = """(<!([^"]*?((".*?")(, ".*?")*?)?[^"]*?)!>)""".toRegex()
|
||||
val closingRegex = """(<!>)""".toRegex()
|
||||
|
||||
val openingOrClosingRegex = """(${closingRegex.pattern}|${openingRegex.pattern})""".toRegex()
|
||||
|
||||
/*
|
||||
* ([\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)
|
||||
}
|
||||
|
||||
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