Delimiter Highlighting

SyntaxEditor for Silverlight Forum

Posted 6 years 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 6 years 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 6 years 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 (v18.1 build 0233) was released 4 years ago, which was after the last post in this thread.