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)
106
106
107
107
// TODO Add a method that takes multiple edits, checks if they are unique and applies them.
108
108
109
+ /// <summary>
110
+ /// Checks if the range falls within the bounds of the text.
111
+ /// </summary>
112
+ /// <param name="range"></param>
113
+ /// <returns></returns>
109
114
public bool IsValidRange ( Range range )
110
115
{
116
+ if ( range == null )
117
+ {
118
+ throw new ArgumentNullException ( nameof ( range ) ) ;
119
+ }
120
+
111
121
return range . Start . Line <= Lines . Length
112
122
&& range . End . Line <= Lines . Length
113
123
&& range . Start . Column <= Lines [ range . Start . Line - 1 ] . Length
114
124
&& range . End . Column <= Lines [ range . End . Line - 1 ] . Length + 1 ;
115
125
}
116
126
127
+ /// <summary>
128
+ /// Returns the text representation of the object.
129
+ /// </summary>
117
130
public override string ToString ( )
118
131
{
119
132
return Text ;
You can’t perform that action at this time.
0 commit comments