Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Semantic highlighting
Semantic highlighting [message #68186] Wed, 15 July 2009 21:37 Go to next message
Stan is currently offline Stan
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
Re: Semantic highlighting [message #68266 is a reply to message #68186] Thu, 16 July 2009 16:28 Go to previous message
Stan is currently offline Stan
Messages: 20
Registered: July 2009
Junior Member
I'll reply to myself as I think I've figured it out -- I should've figured
it out sooner :). Implementing the getDamageRegion method of the damager
to return variable portions of the document (instead of always one line)
was all I needed...
Re: Semantic highlighting [message #599457 is a reply to message #68186] Thu, 16 July 2009 16:28 Go to previous message
Stan is currently offline Stan
Messages: 20
Registered: July 2009
Junior Member
I'll reply to myself as I think I've figured it out -- I should've figured
it out sooner :). Implementing the getDamageRegion method of the damager
to return variable portions of the document (instead of always one line)
was all I needed...
Previous Topic:Exported product and new plugin discovey problem
Next Topic:Headless signing just our JARs
Goto Forum:
  


Current Time: Thu Aug 28 09:34:45 EDT 2014

Powered by FUDForum. Page generated in 0.02213 seconds