
I implemented a Tagger by inheriting CollectionTagger<IIntraLineSpacerTag>,and call this.Add() method to add the IIntraLineSpacerTag I implemented.
Then it also implements an IntraLineAdornmentManagerBase<IEditorView, MyIntraLineSpacerTag>.
After I inject them all into Editor.Language, add MyIntraLineSpacerTag through Tagger, AddAdornment in IntraLineAdornmentManager will not trigger.
foreach (ITextViewLine viewLine in e.AddedOrUpdatedViewLines) {
foreach (TagSnapshotRange<TTag> tagRange in viewLine.GetIntraLineSpacerTags<TTag>()) {
if ((tagRange.Tag != null) && (tagRange.Tag.Key != null))
this.AddAdornment(viewLine, tagRange);
}
}
I found by looking at the source code that after adding tags, the OnViewTextAreaLayout event will be triggered, but viewLine.GetIntraLineSpacerTags<TTag>() cannot get any tags. I have confirmed that the range of my Tag is within the range of viewLine.
What could cause this situation?