use of org.eclipse.jface.text.rules.MultiLineRule in project eclipse.platform.text by eclipse.
the class DefaultPartitionerZeroLengthTest method setUp.
@Before
public void setUp() {
fDoc = new Document();
IPartitionTokenScanner scanner = new RuleBasedPartitionScanner() {
{
IToken comment = new Token(COMMENT);
IPredicateRule[] rules = new IPredicateRule[] { new MultiLineRule("/*", "*/", comment) };
setPredicateRules(rules);
}
};
fPartitioner = new FastPartitioner(scanner, new String[] { DEFAULT, COMMENT });
fDoc.setDocumentPartitioner(fPartitioner);
fPartitioner.connect(fDoc);
}
use of org.eclipse.jface.text.rules.MultiLineRule in project eclipse.platform.text by eclipse.
the class FastPartitionerTest method testBug368219_1.
@Test
public void testBug368219_1() throws Exception {
fPartitioner.disconnect();
IPartitionTokenScanner scanner = new RuleBasedPartitionScanner() {
{
IToken comment = new Token(COMMENT);
IPredicateRule[] rules = new IPredicateRule[] { new MultiLineRule("/*", "*/", comment) };
setPredicateRules(rules);
}
};
fPartitioner = createPartitioner(scanner);
fDoc.setDocumentPartitioner(fPartitioner);
fPartitioner.connect(fDoc);
fDoc.set("/**");
assertEqualPartition(0, 3, DEFAULT);
}
use of org.eclipse.jface.text.rules.MultiLineRule in project eclipse.platform.text by eclipse.
the class FastPartitionerTest method testBug368219_2.
@Test
public void testBug368219_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("/**");
assertEqualPartition(0, 3, COMMENT);
}
use of org.eclipse.jface.text.rules.MultiLineRule in project eclipse.platform.text by eclipse.
the class FastPartitionerTest method setUp.
@Before
public void setUp() {
fDoc = new Document();
IPartitionTokenScanner scanner = new RuleBasedPartitionScanner() {
{
IToken comment = new Token(COMMENT);
IPredicateRule[] rules = new IPredicateRule[] { new MultiLineRule("/*", "*/", comment) };
setPredicateRules(rules);
}
};
fPartitioner = createPartitioner(scanner);
fDoc.setDocumentPartitioner(fPartitioner);
fPartitioner.connect(fDoc);
}
use of org.eclipse.jface.text.rules.MultiLineRule in project eclipse.platform.text by eclipse.
the class FastPartitionerTest method testBug409538_1.
@Test
public void testBug409538_1() 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("<");
assertEqualPartition(0, 1, DEFAULT);
}
Aggregations