Refactoring: convert problemHighlightType to function with parameter

This commit is contained in:
Mikhail Glukhikh
2017-05-05 12:59:55 +03:00
parent d9a33af61e
commit 2d9a5afb15
11 changed files with 34 additions and 29 deletions
@@ -124,15 +124,15 @@ abstract class IntentionBasedInspection<TElement : PsiElement>(
additionalFixes(targetElement)?.let { allFixes.addAll(it) }
if (!allFixes.isEmpty()) {
holder.registerProblem(targetElement, problemText ?: allFixes.first().name,
problemHighlightType, range, *allFixes.toTypedArray())
problemHighlightType(targetElement), range, *allFixes.toTypedArray())
}
}
}
}
}
protected open val problemHighlightType: ProblemHighlightType
get() = ProblemHighlightType.GENERIC_ERROR_OR_WARNING
protected open fun problemHighlightType(element: TElement): ProblemHighlightType =
ProblemHighlightType.GENERIC_ERROR_OR_WARNING
private fun createQuickFix(
intention: SelfTargetingRangeIntention<TElement>,