Performance, turning off features to speed things up.

SyntaxEditor for WPF Forum

Posted 10 years ago by Simon Sprott
Version: 14.2.0610


Our editor needs to be able to work with pretty big files, in order to make this  possible we offer the ability to turn on/off some features.

These pretty much come down to turning off syntax highlighting and grammar parsing,

We are working with the XML addin, and the way we are turning these off is by unregistering the XmlTokenTaggerProvider to turn off syntaxHighlighting

and unregistering IParser to turn off grammar parsing.

This approach mostly works but seems a bit clumsy, is their a neater way?


If this is a valid approach then we hit 2 problems,

  • When we unregister the XmlTokenTaggerProvider the syntax highlighting persists on screen until its scrolled away and back (when its re-registered it comes on straight away), can we manualy force a refresh?
  • When we unregister the parser the parserdata remains (this is easily cleared manually which removes the outlining) but when its re-registered a parse is NOT initiated so the outlining is not re-created (a change to the document causes a parse and the outlining to come back), can we manually force this?



Comments (1)

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Simon,

I believe that what you are doing is the only way to disable those features.  Other than you can probably unregister the ILexer service as an alternative to unregistering the tagger provider.  Either one ends up with similar results of disabling syntax highlighting.

For the syntax highlighting, does it refresh if you call editor.InvalidateViews()?

For the parser, nothing on the document is watching to see if a parser is registered after the document has already been used.  However you can call document.QueueParseRequest() to manually trigger a new parse.  That's what gets called on text changes.

Actipro Software Support

The latest build of this product (v24.1.2) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.