diff --git a/plugins/grazie/src/main/kotlin/com/intellij/grazie/ide/inspection/grammar/GrazieInspection.kt b/plugins/grazie/src/main/kotlin/com/intellij/grazie/ide/inspection/grammar/GrazieInspection.kt index 6bc34aa13ecf..393262de3212 100644 --- a/plugins/grazie/src/main/kotlin/com/intellij/grazie/ide/inspection/grammar/GrazieInspection.kt +++ b/plugins/grazie/src/main/kotlin/com/intellij/grazie/ide/inspection/grammar/GrazieInspection.kt @@ -92,11 +92,12 @@ class GrazieInspection : LocalInspectionTool(), DumbAware { } private fun areDisabled(session: LocalInspectionToolSession): Boolean { - val project = session.file.project + val file = session.file + val project = file.project val profile = InspectionProfileManager.getInstance(project).currentProfile return inspections.all { inspection -> val tools = profile.getToolsOrNull(inspection.shortName, project) - tools == null || !tools.isEnabled + tools == null || !tools.isEnabled(file) } }