Exemplo n.º 1
0
        private static ITrackingPoint CreateTrackingPoint(TableItem item, ITextSnapshot snapshot)
        {
            if (snapshot.Length == 0)
            {
                return(snapshot.CreateTrackingPoint(0, PointTrackingMode.Negative));
            }

            var position = item.GetOriginalPosition();

            if (position.Line >= snapshot.LineCount)
            {
                return(snapshot.CreateTrackingPoint(snapshot.Length, PointTrackingMode.Positive));
            }

            var adjustedLine = Math.Max(position.Line, 0);
            var textLine     = snapshot.GetLineFromLineNumber(adjustedLine);

            if (position.Character >= textLine.Length)
            {
                return(snapshot.CreateTrackingPoint(textLine.End, PointTrackingMode.Positive));
            }

            var adjustedColumn = Math.Max(position.Character, 0);

            return(snapshot.CreateTrackingPoint(
                       textLine.Start + adjustedColumn,
                       PointTrackingMode.Positive
                       ));
        }
Exemplo n.º 2
0
        public override bool EqualsIgnoringLocation(TableItem other)
        {
            if (!(other is TodoTableItem otherTodoItem))
            {
                return(false);
            }

            var data      = Data;
            var otherData = otherTodoItem.Data;

            return(data.DocumentId == otherData.DocumentId && data.Message == otherData.Message);
        }
Exemplo n.º 3
0
        public override bool EqualsIgnoringLocation(TableItem other)
        {
            if (!(other is DiagnosticTableItem otherDiagnosticItem))
            {
                return(false);
            }

            var diagnostic      = Data;
            var otherDiagnostic = otherDiagnosticItem.Data;

            // everything same except location
            return(diagnostic.Id == otherDiagnostic.Id &&
                   diagnostic.ProjectId == otherDiagnostic.ProjectId &&
                   diagnostic.DocumentId == otherDiagnostic.DocumentId &&
                   diagnostic.Category == otherDiagnostic.Category &&
                   diagnostic.Severity == otherDiagnostic.Severity &&
                   diagnostic.WarningLevel == otherDiagnostic.WarningLevel &&
                   diagnostic.Message == otherDiagnostic.Message);
        }
Exemplo n.º 4
0
 public abstract bool EqualsIgnoringLocation(TableItem other);