refactor: simplify and document lsp_typst_boundary crate (#1049)

This commit is contained in:
Myriad-Dreamin 2024-12-22 11:21:04 +08:00 committed by GitHub
parent 5db1cf984a
commit 497a1e0aea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 205 additions and 233 deletions

View file

@ -389,7 +389,7 @@ impl Tokenizer {
range,
} = token;
use crate::typst_to_lsp;
use crate::lsp_typst_boundary;
use lsp_types::Position;
let utf8_start = range.start;
if self.pos_offset > utf8_start {
@ -404,7 +404,7 @@ impl Tokenizer {
return;
}
let position = typst_to_lsp::offset_to_position(utf8_start, self.encoding, &self.source);
let position = lsp_typst_boundary::to_lsp_position(utf8_start, self.encoding, &self.source);
let delta = self.curr_pos.delta(&position);