void (@NotNull ProgressIndicator progress) { InspectionProfile profileToUse = InspectionProfileManager.getInstance().getCurrentProfile(); ResourceBundle rb = myEditor.getResourceBundle(); if (!rb.isValid()) return; final PsiFile containingFile = rb.getDefaultPropertiesFile().getContainingFile(); List<InspectionVisitorWrapper> visitors = new ArrayList<>(); HighlightDisplayKey unusedKey = HighlightDisplayKey.find(UnusedPropertyInspection.SHORT_NAME); if (profileToUse.isToolEnabled(unusedKey, containingFile)) { visitors.add(new InspectionVisitorWrapper( UnusedPropertyUtil.buildPropertyGroupVisitor(rb), profileToUse.getErrorLevel(unusedKey, containingFile).getSeverity(), unusedKey)); } HighlightDisplayKey incompleteKey = HighlightDisplayKey.find(IncompletePropertyInspection.TOOL_KEY); if (profileToUse.isToolEnabled(incompleteKey, containingFile)) { InspectionProfileEntry unwrappedTool = profileToUse.getUnwrappedTool(IncompletePropertyInspection.TOOL_KEY, containingFile); assert unwrappedTool != null; visitors.add(new InspectionVisitorWrapper( ((IncompletePropertyInspection)unwrappedTool).buildPropertyGroupVisitor(rb), profileToUse.getErrorLevel(incompleteKey, containingFile).getSeverity(), incompleteKey)); } final List<PropertiesFile> files = rb.getPropertiesFiles(); final Project project = rb.getProject(); final StructureViewModel model = myEditor.getStructureViewComponent().getTreeModel(); final Deque<TreeElement> queue = new ArrayDeque<>(1); queue.addLast(model.getRoot()); while (!queue.isEmpty()) { final TreeElement treeElement = queue.removeFirst(); if (treeElement instanceof PropertyBundleEditorStructureViewElement) { IProperty property = ((PropertyBundleEditorStructureViewElement)treeElement).getProperty(); if (property == null) continue; final String key = property.getKey(); if (key == null) continue; SortedSet<HighlightInfoType> highlightTypes = new TreeSet<>(Comparator.comparing(t -> t.getSeverity(null))); List<Pair<ResourceBundleEditorProblemDescriptor, HighlightDisplayKey>> allDescriptors = new SmartList<>(); final IProperty[] properties = files.stream().map(f -> f.findPropertyByKey(key)).filter(Objects::nonNull).toArray(IProperty[]::new); if (properties.length != 0) { for (InspectionVisitorWrapper v : visitors) { final ResourceBundleEditorProblemDescriptor[] problemDescriptors = v.getProblemVisitor().apply(properties); if (!ArrayUtil.isEmpty(problemDescriptors)) { final HighlightSeverity severity = v.getSeverity(); for (ResourceBundleEditorProblemDescriptor descriptor : problemDescriptors) { allDescriptors.add(Pair.create(descriptor, v.getKey())); final HighlightInfoType infoType = ProblemDescriptorUtil.getHighlightInfoType(descriptor.getHighlightType(), severity, SeverityRegistrar.getSeverityRegistrar(project)); highlightTypes.add(infoType); } } } ((PropertyBundleEditorStructureViewElement)treeElement).setInspectedPropertyProblems(allDescriptors.isEmpty() ? null : new InspectedPropertyProblems(allDescriptors.toArray(new Pair[0]), highlightTypes)); } } for (TreeElement element : treeElement.getChildren()) { queue.addLast(element); } } }