use of org.eclipse.jface.text.rules.IPartitionTokenScanner in project eclipse.platform.text by eclipse.
the class FastPartitionerTest method testBug409538_2.
@Test
public void testBug409538_2() throws Exception {
fPartitioner.disconnect();
IPartitionTokenScanner scanner = new RuleBasedPartitionScanner() {
{
IToken comment = new Token(COMMENT);
IPredicateRule[] rules = new IPredicateRule[] { new MultiLineRule("<!--", "-->", comment, (char) 0, true) };
setPredicateRules(rules);
}
};
fPartitioner = createPartitioner(scanner);
fDoc.setDocumentPartitioner(fPartitioner);
fPartitioner.connect(fDoc);
fDoc.set("<!-- blah");
assertEqualPartition(0, 9, COMMENT);
}
use of org.eclipse.jface.text.rules.IPartitionTokenScanner in project eclipse.platform.text by eclipse.
the class FastPartitionerTest method testPR130900.
@Test
public void testPR130900() throws Exception {
fPartitioner.disconnect();
IPartitionTokenScanner scanner = new RuleBasedPartitionScanner() {
{
IToken comment = new Token(COMMENT);
IPredicateRule[] rules = new IPredicateRule[] { new SingleLineRule("#", null, comment, (char) 0, true, false) };
setPredicateRules(rules);
}
};
fPartitioner = createPartitioner(scanner);
fDoc.setDocumentPartitioner(fPartitioner);
fPartitioner.connect(fDoc);
fDoc.set("#");
int[] offsets = new int[] { 0, 1 };
assertComputePartitioning_InterleavingPartitions(offsets);
}
Aggregations