void (@NotNull PsiElement root, @NotNull FileHighlightingSetting setting) { PsiFile containingFile = root.getContainingFile(); VirtualFile virtualFile = containingFile.getVirtualFile(); if (virtualFile == null) return; FileHighlightingSetting[] defaults = myHighlightSettings.get(virtualFile); int rootIndex = getRootIndex(containingFile); if (defaults != null && rootIndex >= defaults.length) { defaults = null; } if (defaults == null) { defaults = getDefaults(containingFile); } defaults[rootIndex] = setting; boolean toRemove = true; for (FileHighlightingSetting aDefault : defaults) { if (aDefault != FileHighlightingSetting.NONE) { toRemove = false; break; } } if (toRemove) { myHighlightSettings.remove(virtualFile); } else { myHighlightSettings.put(virtualFile, defaults); } incModificationCount(); messageBus.syncPublisher(FileHighlightingSettingListener.SETTING_CHANGE).settingChanged(root, setting); InspectionWidgetUsageCollector.HIGHLIGHT_LEVEL_CHANGED.log(root.getProject(), root.getLanguage(), FileHighlightingSetting.toInspectionsLevel(setting)); }