pub fn position_to_offset(source: &str, position: Position) -> Option<usize>
Convert an LSP position into a byte offset. Returns None if the position is past the end of the source.