Minor: ignore KDoc like comments which starts with /**

for example it can be used to mark lookups which we can't report yet

Original commit: 7790c2fd71
This commit is contained in:
Zalim Bashorov
2015-08-14 15:13:47 +03:00
parent b068d19bd2
commit d3e29843aa
@@ -28,7 +28,8 @@ abstract class AbstractLookupTrackerTest : AbstractIncrementalJpsTest(
allowNoFilesWithSuffixInTestData = true,
allowNoBuildLogFileInTestData = true
) {
val MULTILINE_COMMENT = "/\\*[^\\*]*\\*/".toRegex()
// ignore KDoc like comments which starts with `/**`, example: /** text */
val COMMENT_WITH_LOOKUP_INFO = "/\\*[^*]+\\*/".toRegex()
override fun createLookupTracker() = TestLookupTracker()
@@ -45,7 +46,7 @@ abstract class AbstractLookupTrackerTest : AbstractIncrementalJpsTest(
val text = file.readText()
val matchResult = MULTILINE_COMMENT.match(text)
val matchResult = COMMENT_WITH_LOOKUP_INFO.match(text)
if (matchResult != null) {
matchResult.groups
fail("File $file unexpectedly contains multiline comments. In range ${matchResult.range} found: ${matchResult.value} in $text")
@@ -90,7 +91,7 @@ abstract class AbstractLookupTrackerTest : AbstractIncrementalJpsTest(
private fun dropBlockComments(workSrcDir: File) {
for (file in workSrcDir.walkTopDown()) {
if (!file.isFile) continue
file.writeText(file.readText().replace(MULTILINE_COMMENT, ""))
file.writeText(file.readText().replace(COMMENT_WITH_LOOKUP_INFO, ""))
}
}
}