QD-4986 Escape "/" symbol in group names with "\"

GitOrigin-RevId: 7c1c230a6b89e92f630f547eb4299245d1d9e1df
This commit is contained in:
alexey.afanasiev
2023-10-16 22:47:58 +02:00
committed by intellij-monorepo-bot
parent df9a76bca0
commit 1e7b391201

View File

@@ -16,7 +16,7 @@ class InspectionCategoryGroupProvider : InspectionGroupProvider {
override fun includesInspection(tool: InspectionToolWrapper<*, *>): Boolean {
return try {
tool.groupPath.joinToString("/").startsWith(category)
tool.groupPath.escapeToolGroupPath().joinToString("/").startsWith(category)
}
catch (e: AssertionError) {
false
@@ -24,4 +24,14 @@ class InspectionCategoryGroupProvider : InspectionGroupProvider {
}
}
}
}
fun Array<String>.escapeToolGroupPath(): List<String> {
return map { escapeToolGroupPathElement(it) }
}
private fun escapeToolGroupPathElement(path: String): String {
return path
.replace("""\""", """\\""")
.replace("""/""", """\/""")
}