Skip to content

Commit

Permalink
Save settings after changing them
Browse files Browse the repository at this point in the history
  • Loading branch information
BoD committed Aug 21, 2023
1 parent 9b9c25b commit a78a6d2
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import com.intellij.lang.jsgraphql.psi.GraphQLTypeName
import com.intellij.lang.jsgraphql.psi.GraphQLTypedOperationDefinition
import com.intellij.lang.jsgraphql.psi.GraphQLVisitor
import com.intellij.openapi.project.Project
import com.intellij.profile.codeInspection.ProjectInspectionProfileManager
import com.intellij.psi.PsiElementVisitor
import com.intellij.psi.util.findParentOfType
import javax.swing.JComponent
Expand Down Expand Up @@ -101,6 +102,7 @@ class ApolloUnusedFieldInspection : LocalInspectionTool() {
}
}

// In a future version of the platform we should use `AddToInspectionOptionListFix` instead.
private inner class IgnoreFieldQuickFix(private val fieldCoordinates: String) : LocalQuickFix {
override fun getName() = ApolloBundle.message("inspection.unusedField.quickFix.ignoreField", fieldCoordinates)
override fun getFamilyName() = name
Expand All @@ -110,6 +112,9 @@ class ApolloUnusedFieldInspection : LocalInspectionTool() {

override fun applyFix(project: Project, descriptor: ProblemDescriptor) {
fieldsToIgnore += fieldCoordinates.replace(".", "\\.")

// Save the inspection settings
ProjectInspectionProfileManager.getInstance(project).fireProfileChanged()
}
}

Expand Down

0 comments on commit a78a6d2

Please sign in to comment.