Skip to main content


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 21:11 Go to next message
James Phillpotts is currently offline James PhillpottsFriend
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 14:39 Go to previous message
James Phillpotts is currently offline James PhillpottsFriend
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 14:40]

Report message to a moderator

Previous Topic:[Databinding] Caret position with undo/redo
Next Topic:Simple export in SVG ?
Goto Forum:
  


Current Time: Thu Mar 28 08:58:56 GMT 2024

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

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

Back to the top