Beispiel #1
0
 private void HandleClassificationTagsChanged(object sender, BatchedTagsChangedEventArgs e)
 {
     if (!_initialized)
     {
         var snapshot = TextBuffer.CurrentSnapshot;
         OnTagsChanged(new SnapshotSpanEventArgs(new SnapshotSpan(snapshot, 0, snapshot.Length)));
     }
     else
     {
     }
 }
Beispiel #2
0
        void TagAggregator_BatchedTagsChanged(object sender, BatchedTagsChangedEventArgs e)
        {
            Dispatcher.VerifyAccess();
            HashSet <ITextViewLine> checkedLines = null;

            foreach (var mappingSpan in e.Spans)
            {
                foreach (var span in mappingSpan.GetSpans(wpfTextViewHost.TextView.TextSnapshot))
                {
                    Update(span, ref checkedLines);
                }
            }
        }
        private void OnBatchedTagsChanged(object sender, BatchedTagsChangedEventArgs e)
        {
            var tempEvent = ClassificationChanged;

            if (tempEvent != null)
            {
                foreach (var mappingSpan in e.Spans)
                {
                    foreach (var span in mappingSpan.GetSpans(_textBuffer))
                    {
                        tempEvent(this, new ClassificationChangedEventArgs(span));
                    }
                }
            }
        }
        void TagAggregator_BatchedTagsChanged(object sender, BatchedTagsChangedEventArgs e)
        {
            wpfTextView.VisualElement.Dispatcher.VerifyAccess();
            if (wpfTextView.IsClosed || tagAggregator != sender)
            {
                return;
            }
            List <SnapshotSpan> intersectionSpans = null;
            var textViewLines = wpfTextView.TextViewLines;

            foreach (var mappingSpan in e.Spans)
            {
                foreach (var span in mappingSpan.GetSpans(wpfTextView.TextSnapshot))
                {
                    var intersection = textViewLines.FormattedSpan.Intersection(span);
                    if (intersection != null)
                    {
                        if (intersectionSpans == null)
                        {
                            intersectionSpans = new List <SnapshotSpan>();
                        }
                        var lineStart = intersection.Value.Start.GetContainingLine();
                        ITextSnapshotLine lineEnd;
                        if (intersection.Value.End <= lineStart.EndIncludingLineBreak)
                        {
                            lineEnd = lineStart;
                        }
                        else
                        {
                            lineEnd = intersection.Value.End.GetContainingLine();
                        }
                        intersectionSpans.Add(new SnapshotSpan(lineStart.Start, lineEnd.EndIncludingLineBreak));
                    }
                }
            }
            if (intersectionSpans != null)
            {
                UpdateRange(new NormalizedSnapshotSpanCollection(intersectionSpans));
            }
        }
Beispiel #5
0
        private void DeveroomTagAggregatorOnBatchedTagsChanged(object sender, BatchedTagsChangedEventArgs batchedTagsChangedEventArgs)
        {
            var snapshot = Buffer.CurrentSnapshot;
            var spans    = batchedTagsChangedEventArgs.Spans.SelectMany(mappingSpan => mappingSpan.GetSpans(snapshot), (mappingSpan, mappedTagSpan) => mappedTagSpan);

            var start = int.MaxValue;
            var end   = 0;

            foreach (var sourceSpan in spans)
            {
                start = Math.Min(start, sourceSpan.Start.Position);
                end   = Math.Max(end, sourceSpan.End.Position);
            }

            if (start == int.MaxValue || end <= start)
            {
                return;
            }

            var span = new SnapshotSpan(snapshot, start, end - start);

            RaiseChanged(span);
        }
        private void OnTagsChanged(object sender, BatchedTagsChangedEventArgs e)
        {
            if (_textView.IsClosed)
            {
                return;
            }

            using var _ = CodeAnalysis.PooledObjects.ArrayBuilder <SnapshotSpan> .GetInstance(out var builder);

            foreach (var mappingSpan in e.Spans)
            {
                var normalizedSpan = mappingSpan.GetSpans(_textView.TextSnapshot);
                builder.AddRange(normalizedSpan);
            }

            var changedSnapshotSpans = builder.ToImmutable();

            if (changedSnapshotSpans.Length == 0)
            {
                return;
            }

            var startOfChangedSpan = changedSnapshotSpans.Min(span => span.Start);
            var endOfChangedSpan   = changedSnapshotSpans.Max(span => span.End);
            var changedSpan        = new SnapshotSpan(startOfChangedSpan, endOfChangedSpan);

            _glyphManager.RemoveGlyphs(changedSpan);

            foreach (var line in _textView.TextViewLines.GetTextViewLinesIntersectingSpan(changedSpan))
            {
                if (line.IsValid)
                {
                    RefreshGlyphsOver(line);
                }
            }
        }
Beispiel #7
0
 protected virtual void HandleClassifierTagsChanged(object sender, BatchedTagsChangedEventArgs e)
 {
     throw new NotImplementedException();
 }
Beispiel #8
0
		void TagAggregator_BatchedTagsChanged(object sender, BatchedTagsChangedEventArgs e) {
			Dispatcher.VerifyAccess();
			HashSet<ITextViewLine> checkedLines = null;
			foreach (var mappingSpan in e.Spans) {
				foreach (var span in mappingSpan.GetSpans(wpfTextViewHost.TextView.TextSnapshot))
					Update(span, ref checkedLines);
			}
		}
Beispiel #9
0
 private void OnTagsChanged(object sender, BatchedTagsChangedEventArgs e)
 {
     UpdateChanges();
 }
Beispiel #10
0
 private void OnTagsChanged(object source, BatchedTagsChangedEventArgs e)
 {
     UpdateMarks();
 }
 void OnBatchedTagsChanged(object sender, BatchedTagsChangedEventArgs e) {
     UpdateDiagnostics();
 }
Beispiel #12
0
 protected virtual void HandleClassifierTagsChanged(object sender, BatchedTagsChangedEventArgs e)
 {
     throw new NotImplementedException();
 }
		void TagAggregator_BatchedTagsChanged(object sender, BatchedTagsChangedEventArgs e) {
			wpfTextView.VisualElement.Dispatcher.VerifyAccess();
			if (wpfTextView.IsClosed || tagAggregator != sender)
				return;
			List<SnapshotSpan> intersectionSpans = null;
			var textViewLines = wpfTextView.TextViewLines;
			foreach (var mappingSpan in e.Spans) {
				foreach (var span in mappingSpan.GetSpans(wpfTextView.TextSnapshot)) {
					var intersection = textViewLines.FormattedSpan.Intersection(span);
					if (intersection != null) {
						if (intersectionSpans == null)
							intersectionSpans = new List<SnapshotSpan>();
						var lineStart = intersection.Value.Start.GetContainingLine();
						ITextSnapshotLine lineEnd;
						if (intersection.Value.End <= lineStart.EndIncludingLineBreak)
							lineEnd = lineStart;
						else
							lineEnd = intersection.Value.End.GetContainingLine();
						intersectionSpans.Add(new SnapshotSpan(lineStart.Start, lineEnd.EndIncludingLineBreak));
					}
				}
			}
			if (intersectionSpans != null)
				UpdateRange(new NormalizedSnapshotSpanCollection(intersectionSpans));
		}
		void GlyphTextMarkerTagAggregator_BatchedTagsChanged(object sender, BatchedTagsChangedEventArgs e) {
			TextView.VisualElement.Dispatcher.VerifyAccess();
			if (TextView.IsClosed)
				return;
			List<SnapshotSpan> intersectionSpans = null;
			foreach (var mappingSpan in e.Spans) {
				foreach (var span in mappingSpan.GetSpans(TextView.TextSnapshot)) {
					var intersection = TextView.TextViewLines.FormattedSpan.Intersection(span);
					if (intersection != null) {
						if (intersectionSpans == null)
							intersectionSpans = new List<SnapshotSpan>();
						intersectionSpans.Add(intersection.Value);
					}
				}
			}
			if (intersectionSpans != null)
				UpdateRange(new NormalizedSnapshotSpanCollection(intersectionSpans));
		}
Beispiel #15
0
 private void OnTagsChanged(object source, BatchedTagsChangedEventArgs e)
 {
     UpdateMarks();
 }
Beispiel #16
0
 void OnBatchedTagsChanged(object sender, BatchedTagsChangedEventArgs e)
 {
     UpdateDiagnostics();
 }
 private void OnBatchedTagsChanged(object sender, BatchedTagsChangedEventArgs e) => this.ShowErrorTagContentAtCaret();
Beispiel #18
0
 private void OnTagsChanged(object sender, BatchedTagsChangedEventArgs e)
 {
     UpdateChanges();
 }