Tuple <ITextSnapshotLine, ITrackingPoint> GetLineAndTrackingPoint(ITextView textView, InlineCommentTag tag)
        {
            var diffModel = (textView as IWpfTextView)?.TextViewModel as IDifferenceTextViewModel;
            var snapshot  = textView.TextSnapshot;

            if (diffModel?.ViewType == DifferenceViewType.InlineView)
            {
                snapshot = tag.DiffChangeType == DiffChangeType.Delete ?
                           diffModel.Viewer.DifferenceBuffer.LeftBuffer.CurrentSnapshot :
                           diffModel.Viewer.DifferenceBuffer.RightBuffer.CurrentSnapshot;
            }

            var line          = snapshot.GetLineFromLineNumber(tag.LineNumber);
            var trackingPoint = snapshot.CreateTrackingPoint(line.Start.Position, PointTrackingMode.Positive);

            ExpandCollapsedRegions(textView, line.Extent);
            peekBroker.TriggerPeekSession(textView, trackingPoint, InlineCommentPeekRelationship.Instance.Name);

            usageTracker.IncrementPRReviewDiffViewInlineCommentOpen().Forget();

            return(Tuple.Create(line, trackingPoint));
        }
Пример #2
0
 public Task IncrementPRReviewDiffViewInlineCommentOpen() => inner.IncrementPRReviewDiffViewInlineCommentOpen();