Example #1
0
        public override bool Equals(ITrackingSpan tspan1, ITrackingSpan tspan2)
        {
            SnapshotSpan span1 = tspan1.GetSpan(tspan1.TextBuffer.CurrentSnapshot);
            SnapshotSpan span2 = tspan2.GetSpan(tspan2.TextBuffer.CurrentSnapshot);

            return(span1.Equals(span2));
        }
Example #2
0
                public bool TryUseCache(SnapshotSpan span, out List <ClassifiedSpan> classifications)
                {
                    lock (_gate)
                    {
                        // currently, it is using SnapshotSpan even though holding onto it could be
                        // expensive. reason being it should be very soon sync-ed to latest snapshot.
                        if (_classifications != null && _span.Equals(span))
                        {
                            classifications = _classifications;
                            return(true);
                        }

                        this.Clear();
                        classifications = null;
                        return(false);
                    }
                }