mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-11-23 20:56:42 +00:00
refactor: simplify and document lsp_typst_boundary crate (#1049)
This commit is contained in:
parent
5db1cf984a
commit
497a1e0aea
18 changed files with 205 additions and 233 deletions
|
|
@ -34,7 +34,7 @@ impl SyntaxRequest for SelectionRangeRequest {
|
|||
) -> Option<Self::Response> {
|
||||
let mut ranges = Vec::new();
|
||||
for position in self.positions {
|
||||
let typst_offset = lsp_to_typst::position(position, position_encoding, source)?;
|
||||
let typst_offset = to_typst_position(position, position_encoding, source)?;
|
||||
let tree = LinkedNode::new(source.root());
|
||||
let leaf = tree.leaf_at_compat(typst_offset + 1)?;
|
||||
ranges.push(range_for_node(source, position_encoding, &leaf));
|
||||
|
|
@ -49,7 +49,7 @@ fn range_for_node(
|
|||
position_encoding: PositionEncoding,
|
||||
node: &LinkedNode,
|
||||
) -> SelectionRange {
|
||||
let range = typst_to_lsp::range(node.range(), source, position_encoding);
|
||||
let range = to_lsp_range(node.range(), source, position_encoding);
|
||||
SelectionRange {
|
||||
range,
|
||||
parent: node
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue