Minor: extract function without manager parameter

This commit is contained in:
Nikolay Krasko
2018-12-28 13:29:25 +03:00
parent 4e9c8cee70
commit 55498450d1
@@ -40,6 +40,10 @@ class ReformatInspection : LocalInspectionTool() {
override fun runForWholeFile(): Boolean = true
override fun checkFile(file: PsiFile, manager: InspectionManager, isOnTheFly: Boolean): Array<out ProblemDescriptor>? {
return checkFile(file, isOnTheFly)?.toTypedArray()
}
private fun checkFile(file: PsiFile, isOnTheFly: Boolean): List<ProblemDescriptor>? {
if (file !is KtFile || !file.isWritable || !ProjectRootsUtil.isInProjectSource(file)) {
return null
}
@@ -72,7 +76,7 @@ class ReformatInspection : LocalInspectionTool() {
ProblemHighlightType.GENERIC_ERROR_OR_WARNING, false, null,
isOnTheFly
)
}.toTypedArray()
}
}
override fun createOptionsPanel(): JComponent? {