Identify code snippet fields for automation

SyntaxEditor for WPF Forum

Posted 3 years ago by Xinen Lee
Avatar

Hi, 

I'm using code snippets on top of syntax highlighting. I'm trying to expose whether a token is a CodeSnippetField or CodeSnippetDependantField. However I see that the CodeSnippetFieldTagger is internal - thus I can't identify if the token is a CodeSnippetField or CodeSnippetDependantField.

Is it possible for actipro to give users a way to identify this token?

thanks!

Comments (5)

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

Hello,

Code snippets aren't really related in any way to tokens.  Both tokens and code snippets affect syntax highlighting though.  If you make a tag aggregator for CodeSnippetFieldTag and examine the CodeSnippetFieldTag instances for the document, each one of those tags tells you via an IsDependent property whether it is a dependent field or not.


Actipro Software Support

Posted 3 years ago by Xinen Lee
Avatar

Hi, thanks for your explanation. However CodeSnippetFieldTag class is internal and I can't access it.

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

Hi Xinen,

Sorry you are correct.  The other thing you can do is aggregate the lower-level IClassificationTag and look at the ClassificationType of each tagged range.  For code snippet fields, those will be DisplayItemClassificationTypeProvider.CodeSnippetDependentField or DisplayItemClassificationTypes.CodeSnippetField.

[Modified 3 years ago]


Actipro Software Support

Posted 3 years ago by Xinen Lee
Avatar

Almost there... but DisplayItemClassificationTypes class is also internal

Posted 3 years ago by Xinen Lee
Avatar

Oh, okay I've found it through DisplayItemClassificationTypeProvider thanks!

The latest build of this product (v2019.1 build 0684) was released 17 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.