
Hi Michael,
At a minimum, you need to make a syntax language class that registers a tagger provider, which will create/return a tagger class you define. This would need to be in the syntax language:
this.RegisterService(new CodeDocumentTaggerProvider<YourTagger>(typeof(YourTagger)));
YourTagger is a class that should inherit CollectionTagger<IClassificationTag> and have a constructor like:
public YourTagger(ICodeDocument document) : base("YourTagger", null, document, true) {}
Once you use that syntax language then you can add classification tags to the tagger and they should show up in editor as long as you've registered an IHighlightingStyle in the AmbientHighlightingStyleRegistry for the custom ClassificationType you will use. To get the tagger from code for a document, do something like this:
YourTagger tagger = null;
if (editor.Document.Properties.TryGetValue(typeof(YourTagger), out tagger)) {
var versionRange = new TextSnapshotRange(editor.ActiveView.CurrentSnapshot, 1, 4).ToVersionRange(
TextRangeTrackingModes.ExpandFirstEdge | TextRangeTrackingModes.DeleteWhenZeroLength);
var tag = new ClassificationTag(ClassificationTypes.Keyword);
tagger.Add(new TagVersionRange<ClassificationTag>(versionRange, tag));
}
That example shows how to mark a range (1-4) of text with a Keyword classification type. As long as that classification type has been registered with a style (like the normal blue one), then it will render blue.
Hope that helps!