Do not try to run reformat inspection on read-only file (EA-126979)
This commit is contained in:
@@ -40,7 +40,7 @@ class ReformatInspection : LocalInspectionTool() {
|
|||||||
override fun runForWholeFile(): Boolean = true
|
override fun runForWholeFile(): Boolean = true
|
||||||
|
|
||||||
override fun checkFile(file: PsiFile, manager: InspectionManager, isOnTheFly: Boolean): Array<out ProblemDescriptor>? {
|
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
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user