void () { final FoldingBuilder first = createDummyFoldingBuilder("plain", "mountain", true); LanguageFolding.INSTANCE.addExplicitExtension(PlainTextLanguage.INSTANCE, first); try { PsiFile file = getFile(); List<FoldingUpdate.RegionInfo> regionInfos = FoldingUpdate.getFoldingsFor(file, false); int regionCount = ContainerUtil.count(regionInfos, i -> file.equals(i.element)); assertEquals("mountain", regionInfos.get(0).descriptor.getPlaceholderText()); assert regionCount == 1: "Only one descriptor allowed for the same text range. Descriptors: " + regionInfos; } finally { LanguageFolding.INSTANCE.removeExplicitExtension(PlainTextLanguage.INSTANCE, first); } }