diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory/Editor/IDocumentLine.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory/Editor/IDocumentLine.cs index 0471509fdd..5be25cd028 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory/Editor/IDocumentLine.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory/Editor/IDocumentLine.cs @@ -51,5 +51,10 @@ namespace ICSharpCode.NRefactory.Editor /// Gets the next line. Returns null if this is the last line in the document. /// IDocumentLine NextLine { get; } + + /// + /// Gets whether the line was deleted. + /// + bool IsDeleted { get; } } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory/Editor/ReadOnlyDocument.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory/Editor/ReadOnlyDocument.cs index 0d5e810065..40c61085e7 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory/Editor/ReadOnlyDocument.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory/Editor/ReadOnlyDocument.cs @@ -84,6 +84,17 @@ namespace ICSharpCode.NRefactory.Editor this.endOffset = doc.GetEndOffset(lineNumber); } + public override int GetHashCode() + { + return doc.GetHashCode() ^ lineNumber; + } + + public override bool Equals(object obj) + { + ReadOnlyDocumentLine other = obj as ReadOnlyDocumentLine; + return other != null && doc == other.doc && lineNumber == other.lineNumber; + } + public int Offset { get { return offset; } } @@ -129,6 +140,10 @@ namespace ICSharpCode.NRefactory.Editor return new ReadOnlyDocumentLine(doc, lineNumber + 1); } } + + public bool IsDeleted { + get { return false; } + } } int GetStartOffset(int lineNumber)