File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -106,14 +106,27 @@ public EditableText ApplyEdit(TextEdit textEdit)
106106
107107 // TODO Add a method that takes multiple edits, checks if they are unique and applies them.
108108
109+ /// <summary>
110+ /// Checks if the range falls within the bounds of the text.
111+ /// </summary>
112+ /// <param name="range"></param>
113+ /// <returns></returns>
109114 public bool IsValidRange ( Range range )
110115 {
116+ if ( range == null )
117+ {
118+ throw new ArgumentNullException ( nameof ( range ) ) ;
119+ }
120+
111121 return range . Start . Line <= Lines . Length
112122 && range . End . Line <= Lines . Length
113123 && range . Start . Column <= Lines [ range . Start . Line - 1 ] . Length
114124 && range . End . Column <= Lines [ range . End . Line - 1 ] . Length + 1 ;
115125 }
116126
127+ /// <summary>
128+ /// Returns the text representation of the object.
129+ /// </summary>
117130 public override string ToString ( )
118131 {
119132 return Text ;
You can’t perform that action at this time.
0 commit comments