1234567891011121314151617181920212223242526272829303132333435363738(************************************************************************)(* * The Coq Proof Assistant / The Coq Development Team *)(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)(* <O___,, * (see CREDITS file for the list of authors) *)(* \VV/ **************************************************************)(* // * This file is distributed under the terms of the *)(* * GNU Lesser General Public License Version 2.1 *)(* * (see LICENSE file for the text of the license) *)(************************************************************************)(************************************************************************)(* Coq Language Server Protocol *)(* Copyright 2022-2023 Inria -- Dual License LGPL 2.1 / GPL3+ *)(* Written by: Emilio J. Gallego Arias *)(************************************************************************)letto_range~lines(p:Loc.t):Types.Range.t=letLoc.{line_nb;line_nb_last;bol_pos;bol_pos_last;bp;ep;_}=pinletstart_line=line_nb-1inletend_line=line_nb_last-1in(* cols *)letstart_col=bp-bol_posinletend_col=ep-bol_pos_lastinletstart_col=Utf8.char_of_byte~line:(Array.getlinesstart_line)~byte:start_colinletend_col=Utf8.char_of_byte~line:(Array.getlinesend_line)~byte:end_colinTypes.Range.{start={line=start_line;character=start_col;offset=bp};end_={line=end_line;character=end_col;offset=ep}}letto_orange~lines=Option.map(to_range~lines)