Function mz_lsp_server::backend::offset_to_position
source ยท fn offset_to_position(offset: usize, rope: &Rope) -> Option<Position>
Expand description
This function is a helper function that converts an offset in the file to a (line, column).
It is useful when translating an ofsset returned by mz_sql_parser::parser::parse_statements to an (x,y) position in the text to represent the error in the correct token.