use of org.eclipse.xtext.ui.editor.folding.FoldedPosition in project xtext-eclipse by eclipse.
the class DefaultFoldingRegionProviderTest method testGetFoldingRegionsWithMutltipleMlComment.
@Test
public void testGetFoldingRegionsWithMutltipleMlComment() throws Exception {
IFile iFile = createFile("foo/bar.foldingtestlanguage", "/**\n*/\n element foo \nelement bar \n/**\n*/\n end \nelement \n/**\n*/\n baz end \n/**\n*/\n end");
IXtextDocument document = openFileAndReturnDocument(iFile);
DefaultFoldingRegionProvider reg = createFoldingRegionProvider();
Collection<FoldedPosition> regions = reg.getFoldingRegions(document);
assertEquals(7, regions.size());
}
use of org.eclipse.xtext.ui.editor.folding.FoldedPosition in project xtext-eclipse by eclipse.
the class DefaultFoldingRegionProviderTest method testGetFoldingRegions3.
@Test
public void testGetFoldingRegions3() throws Exception {
IFile iFile = createFile("foo/bar.foldingtestlanguage", "element foo \nelement \nbar end \nelement baz \nend end");
IXtextDocument document = openFileAndReturnDocument(iFile);
DefaultFoldingRegionProvider reg = createFoldingRegionProvider();
Collection<FoldedPosition> regions = reg.getFoldingRegions(document);
assertEquals(3, regions.size());
}
use of org.eclipse.xtext.ui.editor.folding.FoldedPosition in project xtext-eclipse by eclipse.
the class DefaultFoldingRegionProviderTest method testGetFoldingRegionsWithMlCommentInSameLine.
@Test
public void testGetFoldingRegionsWithMlCommentInSameLine() throws Exception {
IFile iFile = createFile("foo/bar.foldingtestlanguage", "/* */\n element foo \nelement bar end \nelement baz end end");
IXtextDocument document = openFileAndReturnDocument(iFile);
DefaultFoldingRegionProvider reg = createFoldingRegionProvider();
Collection<FoldedPosition> regions = reg.getFoldingRegions(document);
assertEquals(1, regions.size());
}
use of org.eclipse.xtext.ui.editor.folding.FoldedPosition in project xtext-eclipse by eclipse.
the class DefaultFoldingRegionProviderTest method testGetFoldingRegions1.
@Test
public void testGetFoldingRegions1() throws Exception {
IFile iFile = createFile("foo/bar.foldingtestlanguage", "element foo \nelement bar end \nelement baz end end");
IXtextDocument document = openFileAndReturnDocument(iFile);
DefaultFoldingRegionProvider reg = createFoldingRegionProvider();
Collection<FoldedPosition> regions = reg.getFoldingRegions(document);
assertEquals(1, regions.size());
}
use of org.eclipse.xtext.ui.editor.folding.FoldedPosition in project xtext-eclipse by eclipse.
the class DefaultFoldingRegionProviderTest method testGetFoldingRegionsWithMlCommentBetween.
@Test
public void testGetFoldingRegionsWithMlCommentBetween() throws Exception {
IFile iFile = createFile("foo/bar.foldingtestlanguage", "element foo \nelement bar \n /**\n*/ \n end \nelement baz end end");
IXtextDocument document = openFileAndReturnDocument(iFile);
DefaultFoldingRegionProvider reg = createFoldingRegionProvider();
Collection<FoldedPosition> regions = reg.getFoldingRegions(document);
assertEquals(3, regions.size());
}
Aggregations