Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » syntax highlighting
syntax highlighting [message #606461] Fri, 13 August 2010 05:50 Go to next message
Hades is currently offline HadesFriend
Messages: 15
Registered: July 2010
Junior Member
I am developing an eclipse editor for a language, which has keywords like T:.

I'm adding the highlighting- feature with this code:

WordRule keywordRules = new WordRule(new WordDetector(), standard);
for ( String keyword1: Keywords.KEYWORDS1 )
{
keywordRules.addWord(keyword1, keywords1);
}
for ( String keyword2: Keywords.KEYWORDS2 )
{
keywordRules.addWord(keyword2, keywords2);
}
rules.add(keywordRules);

rules.add(new SingleLineRule("F", ": ", keywords2));

IRule[] result = new IRule[rules.size()];
rules.toArray(result);
setRules(result);

My WordDetector class just checks if the character is return Character.isJavaIdentifierPart(c);

In the class Keywords, there are the keywords in static string arrays.

What am I doing wrong?
Re: syntax highlighting [message #606462 is a reply to message #606461] Fri, 13 August 2010 06:32 Go to previous message
Hades is currently offline HadesFriend
Messages: 15
Registered: July 2010
Junior Member
I solved the problem.

Character.isJavaIdentifierPart(c)

returns false if ":" is typed.
Previous Topic:syntax highlighting
Next Topic:Export-Package
Goto Forum:
  


Current Time: Tue Apr 23 02:19:36 GMT 2024

Powered by FUDForum. Page generated in 0.02997 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top