diff --git a/ICSharpCode.NRefactory.CSharp/Ast/AstNode.cs b/ICSharpCode.NRefactory.CSharp/Ast/AstNode.cs index 411579d8be..cca4d85391 100644 --- a/ICSharpCode.NRefactory.CSharp/Ast/AstNode.cs +++ b/ICSharpCode.NRefactory.CSharp/Ast/AstNode.cs @@ -651,7 +651,7 @@ namespace ICSharpCode.NRefactory.CSharp /// Returns true, if the given coordinates (line, column) are in the node. /// /// - /// True, if the given coordinates are between StartLocation and EndLocation (inclusive); otherwise, false. + /// True, if the given coordinates are between StartLocation and EndLocation (exclusive); otherwise, false. /// public bool Contains (int line, int column) { @@ -669,6 +669,28 @@ namespace ICSharpCode.NRefactory.CSharp return this.StartLocation <= location && location < this.EndLocation; } + /// + /// Returns true, if the given coordinates (line, column) are in the node. + /// + /// + /// True, if the given coordinates are between StartLocation and EndLocation (inclusive); otherwise, false. + /// + public bool IsInside (int line, int column) + { + return IsInside (new TextLocation (line, column)); + } + + /// + /// Returns true, if the given coordinates are in the node. + /// + /// + /// True, if location is between StartLocation and EndLocation (inclusive); otherwise, false. + /// + public bool IsInside (TextLocation location) + { + return this.StartLocation <= location && location <= this.EndLocation; + } + public override void AddAnnotation (object annotation) { if (this.IsNull)