Do not try to run reformat inspection on read-only file (EA-126979)

This commit is contained in:
Nikolay Krasko
2018-12-11 18:04:17 +03:00
parent fc4971aa98
commit aada1e4c1b
@@ -40,7 +40,7 @@ class ReformatInspection : LocalInspectionTool() {
override fun runForWholeFile(): Boolean = true
override fun checkFile(file: PsiFile, manager: InspectionManager, isOnTheFly: Boolean): Array<out ProblemDescriptor>? {
if (file !is KtFile || !ProjectRootsUtil.isInProjectSource(file)) {
if (file !is KtFile || !file.isWritable || !ProjectRootsUtil.isInProjectSource(file)) {
return null
}