boolean (@NotNull IElementType source, @NotNull IElementType target) { if (source == target) { return true; } if (source instanceof ParentProviderElementType) { Set<IElementType> parents = ((ParentProviderElementType)source).getParents(); return ContainerUtil.exists(parents, parent -> parent != null && is(parent, target)); } return false; }