Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Semantic highlighting
Semantic highlighting [message #599400] Thu, 16 July 2009 01:37
Stan is currently offline StanFriend
Messages: 20
Registered: July 2009
Junior Member
I'm trying to implement some semantic highlighting in my editor, by
coloring certain words depending on their meaning in the document (just
like the Java editor will color class members a certain color).

Now, I have my parser generating the list of these words which I'm then
putting into a WordRule in my RuleBasedScanner. This works, except for the
fact that RuleBasedScanner only runs on the current line... so, I get
correct highlighting for the lines I'm editing, but the rest of the
document is sitting un-colored.

I'm not sure how to get the scanner to rescan the whole document? There is
a setRange method available, but calling setRange (doc, 0, doc.length())
does nothing. I'm guessing that whatever calls the scanner to do the
coloring is also re-setting this range to the current line. I'm not sure
where this call occurs, though, and I'd like to override it to re-scan the
whole document every once in a while...

Any suggestions would be much appreciated!
Stan
Previous Topic:Is it possible to substitute a bundle's class with another one coming from a fragment?
Next Topic:Unsatisfied version constraint
Goto Forum:
  


Current Time: Thu Nov 27 23:33:29 GMT 2014

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

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