Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » Implementing IPartitionTokenScanner With Multi-Line Tokens
Implementing IPartitionTokenScanner With Multi-Line Tokens [message #515176] Thu, 18 February 2010 00:58
Andrew Lindesay is currently offline Andrew LindesayFriend
Messages: 1
Registered: February 2010
Junior Member

(I hope I have the right forum)

I am implementing a class which conforms to IPartitionTokenScanner as part of implementing source-highlghting. It is generally working well with one little exception which I don't really entirely understand from reading the java-doc and Googling for information.

In my case, the text partitions can by multi-line which is working just fine when the document first loads as the scanner is able to traverse the lines from the start of the document looking for the partitions. The problem arises when the user edits some text in the middle of a multi-line partition. In this case, the 'IPartitionTokenScanner' has the method 'setPartialRange' invoked with an offset and length of the one line which was changed rather than the start of the token on some prior line.

When I think about this behaviour, it makes sense or the system would need to ask the 'IPartitionTokenScanner' to scan all of the text for every change which would be quite slow. I just wonder, what am I supposed to do to signal the partition? Should I accept that this scan is being requested in the middle of an existing partition and try to work back to the start of the partition somehow? Should it return tokens with offset and length that cover the larger partition or just the line that was requested?


Andrew Lindesay
Previous Topic:TableViewer and RGB
Next Topic:[DataBinding] Databinding support for Dialogs
Goto Forum:

Current Time: Tue Jun 19 16:30:02 GMT 2018

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

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

Back to the top