public HighlightWordTagger(ITextView view, ITextBuffer sourceBuffer, ITextSearchService textSearchService, ITextStructureNavigator textStructureNavigator) { this.View = view; this.fileFullPath = GetFileFullPath(view); this.SourceBuffer = sourceBuffer; this.TextSearchService = textSearchService; this.TextStructureNavigator = textStructureNavigator; this.highlightedEntities = Enumerable.Empty <HighlightedEntity>(); this.highlightedSpans = new NormalizedSnapshotSpanCollection(); HighlightedEntitySet.GetInstance().entityChanged += OnHighlightedEntityChanged; this.View.Caret.PositionChanged += CaretPositionChanged; this.View.LayoutChanged += ViewLayoutChanged; }
public static HighlightedEntitySet GetInstance() { return(instance ?? (instance = new HighlightedEntitySet())); }