void (@NotNull PsiElement newElement) { LOG.assertTrue(newElement instanceof PsiQualifiedNamedElement || newElement instanceof PsiDirectory); String newName = getQualifiedName(newElement, referenceKind); if (newName != null) { PackageSet newSet = oldSet.map(set -> updateNameInPattern(set, oldQualifiedName, newName)); if (newSet != oldSet) { String presentableName = oldScope.getPresentableName(); descriptor.replaceScope(new NamedScope(oldScope.getScopeId(), () -> presentableName, oldScope.getIcon(), newSet)); } } }