void (@NotNull PsiTreeChangeEvent event) { final PsiElement child = event.getChild(); if (!(child instanceof PsiFile psiFile)) { if (child instanceof PsiDirectory) { final String deletedDirUrl = ((PsiDirectory)child).getVirtualFile().getUrl() + "/"; for (String dissociatedFileUrl : new SmartList<>(myState.getDissociatedFiles())) { if (dissociatedFileUrl.startsWith(deletedDirUrl)) { myState.getDissociatedFiles().remove(dissociatedFileUrl); } } for (CustomResourceBundleState customResourceBundleState : new SmartList<>(myState.getCustomResourceBundles())) { for (String fileUrl : new ArrayList<>(customResourceBundleState.getFileUrls())) { if (fileUrl.startsWith(deletedDirUrl)) { customResourceBundleState.getFileUrls().remove(fileUrl); } } if (customResourceBundleState.getFileUrls().size() < 2) { myState.getCustomResourceBundles().remove(customResourceBundleState); } } } return; } if (!PropertiesImplUtil.canBePropertyFile(psiFile)) return; final VirtualFile virtualFile = psiFile.getVirtualFile(); final NotNullLazyValue<String> url = NotNullLazyValue.lazy(() -> virtualFile.getUrl()); if (!myState.getDissociatedFiles().isEmpty()) { myState.getDissociatedFiles().remove(url.getValue()); } for (CustomResourceBundleState customResourceBundleState : new SmartList<>(myState.getCustomResourceBundles())) { final Set<String> urls = customResourceBundleState.getFileUrls(); if (urls.remove(url.getValue())) { if (urls.size() < 2) { myState.getCustomResourceBundles().remove(customResourceBundleState); } break; } } }