Hello,
Just installed the latest release and noticed that one of my taggers has stopped working. Calling OnTagsChanged no longer appears to trigger GetTags.
Nick.
Hello,
Just installed the latest release and noticed that one of my taggers has stopped working. Calling OnTagsChanged no longer appears to trigger GetTags.
Nick.
(on .NET 4.0 / Win7)
Hi Nick,
What version did you have before this and what base class is your tagger?
I was running the previous release (I was up to date before installing the latest). The GetTags function never gets hit.
public class DifferencesTagger : TaggerBase<IClassificationTag>
{
...
private void HighlightDifferences()
{
if (view == null)
return;
// Notify that tags changed
this.OnTagsChanged(new TagsChangedEventArgs(new TextSnapshotRange(view.SyntaxEditor.Document.CurrentSnapshot, view.SyntaxEditor.Document.CurrentSnapshot.TextRange)));
}
//return the text ranges which should be highlighted
public override IEnumerable<TagSnapshotRange<IClassificationTag>> GetTags(NormalizedTextSnapshotRangeCollection snapshotRanges, object parameter)
{
if (parameter != null && m_Diffs != null)
{
var snr = (ActiproSoftware.Text.TextSnapshotRange)parameter;
foreach (ChangeEvent ce in m_Diffs)
{
var node = ((HL7Message)m_Parent.Message).GetSubComponentFromPath(ce.Path, false);
if (node != null)
{
int index = node.Offset - m_Parent.GetTagOffset(node.Offset);
if (snr.StartOffset <= index && snr.EndOffset >= index)
{
yield return new TagSnapshotRange<IClassificationTag>(
new TextSnapshotRange(this.view.CurrentSnapshot, TextRange.FromSpan(index, ce.CurrentValue.Length)),
new ClassificationTag(m_Parent.HighlightOnlyDeleted ? wordHighlightClassificationTypeDeleted : (ce.ChangeType == ChangeType.Added) ? wordHighlightClassificationTypeAdded : wordHighlightClassificationType));
}
}
}
}
}
}
[Modified 12 years ago]
Hi Nick,
I just compared build 570 with 571 (latest) and nothing was changed in TaggerBase or any of the other tag-related classes in the Text assembly. In the SyntaxEditor assembly though we did change the TextViewTagAggregator to begin-invoke the TagsChanged event instead of invoking TagsChanged. But that seems to be the only change made between the two builds in the tagging area.
[Modified 12 years ago]
I've just tracked it down I think. I had multiple taggers, and it appeared that only the first one was being registered. When I compared them, they all had the same first paramater value in their constructors:
public SomeTagger(IEditorView view)
: base("Custom", ...
All my taggers had the text "Custom". I've now changed them to make them all unique, and this appears to have fixed the problem.
Nick.
Please log in to a validated account to post comments.