highlighting tests optimization: do not run highlighting pass if its results are going to be ignored in tests

GitOrigin-RevId: c6926fef6c415e1ba257cb164bd4a5e0648bccf1
This commit is contained in:
Alexey Kudravtsev
2025-02-12 13:17:58 +00:00
committed by intellij-monorepo-bot
parent 318ad51f37
commit abc3b389c4
@@ -24,7 +24,12 @@ abstract class AbstractHighlightingPassBase(
override fun doCollectInformation(progress: ProgressIndicator) {
val holder = HighlightInfoHolder(file)
runAnnotatorWithContext(file, holder)
if (IGNORE_IN_TESTS) {
assert(ApplicationManager.getApplication().isUnitTestMode)
}
else {
runAnnotatorWithContext(file, holder)
}
applyInformationInBackground(holder)
}
@@ -55,10 +60,6 @@ abstract class AbstractHighlightingPassBase(
}
private fun applyInformationInBackground(holder: HighlightInfoHolder) {
if (IGNORE_IN_TESTS) {
assert(ApplicationManager.getApplication().isUnitTestMode)
return
}
val result:MutableList<HighlightInfo> = ArrayList(holder.size())
for (i in 0 until holder.size()) {
result.add(holder.get(i))