Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » adding a 'int getOffset()' to ICharacterScanner?
adding a 'int getOffset()' to ICharacterScanner? [message #467427] Thu, 03 May 2007 13:51 Go to next message
Eclipse UserFriend
Originally posted by: jweeks.neuraldk.org

I wonder if anyone else can see the benefit of adding a method getOffset()
to ICharacterScanner, which would return the current offset into the
document being parsed.

I suggest this because any syntax highlighting rule (implementing IRule) is
provided an ICharacterScanner class, and performs syntax highlighting on a
document. Alternatively, a plug-in may also wish to create an outline,
which would also involve parsing the document. If there was a method of
saving off important offsets from the IRule parsing, and providing them to
the outliner, then a fair amount of document processing time might be
eliminated.

Thoughts?

Thanks,
Jeff
Re: adding a 'int getOffset()' to ICharacterScanner? [message #467468 is a reply to message #467427] Fri, 04 May 2007 06:10 Go to previous message
Eclipse UserFriend
Does getTokenOffset from ITokenScanner give you that functionality? The RuleBasedScanner implements both of these, so that might be a workaround.

I do think that a getOffset() is likely to be more useful generally than a getColumn(), though. The normal way of extending functionality would be to derive an interface, like ICharacterScanner2 and extend that ICharacterScanner. You could then modify the RuleBasedScanner to implement that and expose the functionality that way.

You should probably file an enhancement request against JFace/Text or similar; and if you supply the code changes, it's more likely to be done (if you don't supply a patch, it's more likely to never be done).

Unfortunately, the 3.3 lockdown is in full swing, so it wouldn't get in time for the 3.3 build, but maybe for 3.4.

Alex.
Previous Topic:Shell transparency?
Next Topic:updating a viewer of a view from another view
Goto Forum:
  


Current Time: Sun May 18 04:42:35 EDT 2025

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

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

Back to the top