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 )); }
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); }
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); }
public abstract bool EqualsIgnoringLocation(TableItem other);