Delimiter Highlighting

SyntaxEditor for Silverlight Forum

Posted 9 months ago by Blair Leggett
Version: 14.1.0230
Avatar

Where can I find a good example of hooking up delimiter (bracket) highlighting using the default structure matcher and delimiter highlighting tagger?

 

Thanks!

Comments (2)

Answer - Posted 9 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Blair,

We do this kind of thing in our C# add-on language:

// Register a structure matcher 
this.RegisterStructureMatcher(new StructureMatcher() {
	CloseCurlyBraceTokenId = CSharpTokenId.CloseCurlyBrace,
	CloseParenthesisTokenId = CSharpTokenId.CloseParenthesis,
	CloseSquareBraceTokenId = CSharpTokenId.CloseSquareBrace,
	OpenCurlyBraceTokenId = CSharpTokenId.OpenCurlyBrace,
	OpenParenthesisTokenId = CSharpTokenId.OpenParenthesis,
	OpenSquareBraceTokenId = CSharpTokenId.OpenSquareBrace,
});

// Register a tagger that can identify delimiters to highlight from a structure matcher
this.RegisterService(new TextViewTaggerProvider<DelimiterHighlightTagger>(typeof(DelimiterHighlightTagger)));

Our Getting Started #14 QuickStart also shows an example.


Actipro Software Support

Posted 9 months ago by Blair Leggett
Avatar

Yeah. That gave me the framework I needed. Now I just need to tweak the highlight style and I should be good!

The latest build of this product (v2018.1 build 0232) 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.