Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » Reevaluate syntax highlighting for entire document
Reevaluate syntax highlighting for entire document [message #929875] Mon, 01 October 2012 17:11 Go to next message
James Phillpotts is currently offline James Phillpotts
Messages: 2
Registered: October 2012
Junior Member
Hi,

I've got a plugin I've written that provides an Editor for Cucumber-JVM .feature files (using the Gherkin language). The first line of the file can declare a i18n language. I have got the syntax highlighting using this value, but when the value is changed, the old language's highlighting continues to be applied until the editor is closed and reopened.

I've been looking through documentation and examples on using presentation reconcilers, damagers and repairers - but to re-evaluate the entire document I'm not sure what I should be looking at doing - should I be creating a custom reconciler that on finding damage in the language declaration then calls to all repairers for all tokens of the appropriate type in the document?

Thanks in advance for any pointers,
James
Re: Reevaluate syntax highlighting for entire document [message #930684 is a reply to message #929875] Tue, 02 October 2012 10:39 Go to previous message
James Phillpotts is currently offline James Phillpotts
Messages: 2
Registered: October 2012
Junior Member
The solution I have now come up with involves:

1) Adding a document listener that checks to see if the first line has changed.
2) If so, see if the language has been changed
3) If changed, update the language Predicate Rules for the partition scanner and instruct the document to update structures and fire changed events.

[Updated on: Tue, 02 October 2012 10:40]

Report message to a moderator

Previous Topic:JFace TreeViewer refresh problem
Next Topic:Displaying Special Characters in JFace Error Dialog
Goto Forum:
  


Current Time: Mon Jul 28 20:35:00 EDT 2014

Powered by FUDForum. Page generated in 0.03823 seconds