Change color only for user defined function/class identifier

SyntaxEditor for WPF Forum

Posted 1 year ago by Vadim Tsedrik
Version: 21.1.2
Avatar

Hello,

could you help me to proceed with the following problem?

I need to change the color of the identifier of any user-defined functions and classes.

Thanks

Comments (1)

Posted 1 year ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

The way to override default syntax highlighting from a lexer in SyntaxEditor is to use classification tags.  You effectively make a new IClassificationType that is associated with an IHighlightingStyle in the style registry.  The style would have an alternate foreground color to be used for the text.  Then you make a tagger that applies that IClassificationType over various appropriate text ranges that should receive that alternate foreground color.  Some of our adornments-related samples show the concept of classification types.  The tricky part of the whole thing is knowing where those identifiers are, so that you can tag the text ranges.


Actipro Software Support

The latest build of this product (v22.1.3) was released 27 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.