use of org.eclipse.xtext.ui.editor.folding.DefaultFoldedPosition in project xtext-xtend by eclipse.
the class XtendFoldingRegionProviderTest method testFoldCopyrightHeader2.
@Test
public void testFoldCopyrightHeader2() throws Exception {
String content = "package test\n/**\n * \n * Hello Copyright\n * \n */\nimport java.util.List\nimport java.util.Set\nclass Bar{}";
Collection<FoldedPosition> foldingRegions = calculateFoldingRegions("test/Bar", content);
assertEquals(2, foldingRegions.size());
Iterator<FoldedPosition> iterator = foldingRegions.iterator();
FoldedPosition first = iterator.next();
assertEquals(48, first.getOffset());
assertEquals(43, first.length);
assertTrue(((DefaultFoldedPosition) first).isInitiallyFolded());
FoldedPosition second = iterator.next();
assertEquals(13, second.getOffset());
assertEquals(35, second.length);
assertFalse(((DefaultFoldedPosition) second).isInitiallyFolded());
}
use of org.eclipse.xtext.ui.editor.folding.DefaultFoldedPosition in project xtext-xtend by eclipse.
the class XtendFoldingRegionProviderTest method testFoldCopyrightHeader.
@Test
public void testFoldCopyrightHeader() throws Exception {
String content = "/**\n * \n * Hello Copyright\n * \n */\npackage test\nimport java.util.List\nimport java.util.Set\nclass Bar{}";
Collection<FoldedPosition> foldingRegions = calculateFoldingRegions("test/Bar", content);
assertEquals(2, foldingRegions.size());
Iterator<FoldedPosition> iterator = foldingRegions.iterator();
FoldedPosition first = iterator.next();
assertEquals(48, first.getOffset());
assertEquals(43, first.length);
assertTrue(((DefaultFoldedPosition) first).isInitiallyFolded());
FoldedPosition second = iterator.next();
assertEquals(0, second.getOffset());
assertEquals(35, second.length);
assertTrue(((DefaultFoldedPosition) second).isInitiallyFolded());
}
Aggregations