Delimiter Highlighting

SyntaxEditor for Silverlight Forum

Posted 2 years ago by Blair Leggett
Version: 14.1.0230

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



Comments (2)

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

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 2 years ago by Blair Leggett

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 0233) was released 10 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.