/// Converts a character index `position` into a line and column tuple.
Converts a character index `position` into a line and column tuple.
Converts a character index ` position ` into a line and column tuple .
pub fn line_column(db: &dyn crate::Db, filename: Filename, position: Offset) -> LineColumn {
    let table = line_table(db, filename);
    match table.line_endings.binary_search(&position) {
        Ok(line0) | Err(line0) => {
            let line_start = table.line_start(line0);
            LineColumn::new0(line0, position - line_start)
        }
    }
}
pub fn line_column ( db : & dyn crate :: Db , filename : Filename , position : Offset ) -> LineColumn { let table = line_table ( db , filename ) ; match table . line_endings . binary_search ( & position ) { Ok ( line0 ) | Err ( line0 ) => { let line_start = table . line_start ( line0 ) ; LineColumn :: new0 ( line0 , position - line_start ) } } }
Converts a character index `position` into a line and column tuple.
Converts a character index ` position ` into a line and column tuple .
db
&dyn crate::Db
filename
Filename
position
Offset