From aada1e4c1ba2af5c608d8107840df0db999ead7e Mon Sep 17 00:00:00 2001 From: Nikolay Krasko Date: Tue, 11 Dec 2018 18:04:17 +0300 Subject: [PATCH] Do not try to run reformat inspection on read-only file (EA-126979) --- .../org/jetbrains/kotlin/idea/inspections/ReformatInspection.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idea/src/org/jetbrains/kotlin/idea/inspections/ReformatInspection.kt b/idea/src/org/jetbrains/kotlin/idea/inspections/ReformatInspection.kt index 8432d955d47..ec3d0a82cca 100644 --- a/idea/src/org/jetbrains/kotlin/idea/inspections/ReformatInspection.kt +++ b/idea/src/org/jetbrains/kotlin/idea/inspections/ReformatInspection.kt @@ -40,7 +40,7 @@ class ReformatInspection : LocalInspectionTool() { override fun runForWholeFile(): Boolean = true override fun checkFile(file: PsiFile, manager: InspectionManager, isOnTheFly: Boolean): Array? { - if (file !is KtFile || !ProjectRootsUtil.isInProjectSource(file)) { + if (file !is KtFile || !file.isWritable || !ProjectRootsUtil.isInProjectSource(file)) { return null }