QD-4986 Id of group is same as name but with "/" replaced by "_"

GitOrigin-RevId: 1263c2846bf1ee46dbcdb42db61c2ac74a1d01af
This commit is contained in:
alexey.afanasiev
2023-10-20 10:19:14 +02:00
committed by intellij-monorepo-bot
parent b1b266d0de
commit 1edf614aff

View File

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