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 #552660] 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?

[Updated on: Fri, 13 August 2010 06:22]

Report message to a moderator

Re: syntax highlighting [message #552668 is a reply to message #552660] 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:Is there a way to know a quick fix was selected?
Next Topic:syntax highlighting
Goto Forum:
  


Current Time: Sat Apr 27 04:11:49 GMT 2024

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

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

Back to the top