void (@NotNull Project project, VirtualFile vFile, @NotNull ModUpdateInspectionOptions options, boolean newValue) { PsiFile file = PsiManager.getInstance(project).findFile(vFile); if (file == null) return; InspectionProfileModifiableModelKt.modifyAndCommitProjectProfile(project, model -> { InspectionToolWrapper<?, ?> tool = model.getInspectionTool(options.inspectionShortName(), file); if (tool == null) { throw new IllegalStateException("Inspection not found: " + options.inspectionShortName()); } InspectionProfileEntry inspection = tool.getTool(); for (ModUpdateInspectionOptions.ModifiedInspectionOption option : options.options()) { Object value = newValue ? option.newValue() : option.oldValue(); if (value instanceof List<?> list) { @SuppressWarnings("unchecked") List<Object> oldList = (List<Object>)Objects.requireNonNull(inspection.getOptionController().getOption(option.bindId())); oldList.clear(); oldList.addAll(list); } else { inspection.getOptionController().setOption(option.bindId(), value); } } }); }