/// <nodoc /> public static Range ToRange(this LineAndColumn lineAndColumn, LineMap lineMap, int?length) { var start = lineAndColumn.ToPosition(); // Compute the absolute end of the range by getting the absolute start and offseting that with the length var absoluteStart = lineMap.Map[lineAndColumn.Line - 1] + lineAndColumn.Character - 1; var absoluteEnd = absoluteStart + length ?? 0; var end = LineInfo.FromLineMap(lineMap, absoluteEnd).ToPosition(); return(new Range { Start = start, End = end }); }