Skip to content
Discussion options

You must be logged in to vote

You can use oxc_data_structures with the rope feature flag:
https://github.com/oxc-project/oxc/blob/main/crates/oxc_data_structures/src/rope.rs#L7

Example from the language_server:

pub fn offset_to_position(rope: &Rope, offset: u32, source_text: &str) -> Position {
let (line, column) = get_line_column(rope, offset, source_text);
Position::new(line, column)
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by liuhq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants