int (@NotNull PsiElement parent, @NotNull PsiElement child) { if (!Registry.is("similarity.find.usages.use.parent.features.with.child.number")) return -1; PsiElement[] children = Arrays.stream(parent.getChildren()).filter(e -> !(e instanceof PsiWhiteSpace)).toArray(PsiElement[]::new); for (int i = 0; i < children.length; i++) { if (children[i] == child) { return i; } } return -1; }