void (@NotNull PsiFile containingFile, @NotNull FoldingDescriptor descriptor, @NotNull PsiElement descriptorPsi, @NotNull FoldingBuilder foldingBuilder) { PsiFile descriptorFile = PsiUtilCore.getTemplateLanguageFile(descriptorPsi); if (containingFile != descriptorFile) { throw PluginException.createByClass(new IllegalStateException( "Folding descriptor " + descriptor + ", containing PSI element " + descriptorPsi + " of " + descriptorPsi.getClass() + "," + " provided by " + foldingBuilder + " (" + foldingBuilder.getClass() + ") must belong to the file " + containingFile + ", but got: " + descriptorFile), foldingBuilder.getClass()); } }