tinymist/crates/tinymist-query/Cargo.toml
ParaN3xus 3b6de80a2f
fix: correct parent_last_loc for heading children in folding ranges (#2123)
This PR fixes #1796 by correcting the parent_last_loc parameter passed
to child elements when processing heading folding ranges.

This is because heading's `lsp_range` only covers the line it is on, but
it has children. This causes the `parent_last_loc` passed when
recursively calling the `calc_folding_range` function to be incorrect:
it is expected to be the end of the line before the next sibling
heading, but actually it is the end of the current heading's line. This
further prevents the correction of the heading's `folding_range` from
working properly, ultimately causing the returned `folding_range` to
retain the original `lsp_range`, which is just the heading line itself.

The fix uses the already-calculated `folding_range.end_line` for
headings when determining the `parent_last_loc` for child elements,
ensuring consistency between the parent's actual folding boundary and
the boundary passed to its children.
2025-09-24 00:24:31 +08:00

75 lines
1.9 KiB
TOML

[package]
name = "tinymist-query"
description = "Language queries for tinymist."
categories = ["compilers", "command-line-utilities"]
keywords = ["api", "language", "typst"]
authors.workspace = true
version.workspace = true
license.workspace = true
edition.workspace = true
homepage.workspace = true
repository.workspace = true
rust-version.workspace = true
[dependencies]
anyhow.workspace = true
base64.workspace = true
biblatex.workspace = true
comemo.workspace = true
dashmap.workspace = true
dirs.workspace = true
ena.workspace = true
ecow.workspace = true
hayagriva.workspace = true
itertools.workspace = true
indexmap.workspace = true
log.workspace = true
lsp-types.workspace = true
parking_lot.workspace = true
percent-encoding.workspace = true
rayon.workspace = true
regex.workspace = true
rpds.workspace = true
rust_iso639.workspace = true
rust_iso3166.workspace = true
rustc-hash.workspace = true
serde.workspace = true
serde_json.workspace = true
serde_yaml.workspace = true
siphasher.workspace = true
strum.workspace = true
toml.workspace = true
ttf-parser.workspace = true
typlite = { workspace = true, default-features = false, features = [
"no-content-hint",
] }
tinymist-world = { workspace = true }
tinymist-project = { workspace = true, features = ["lsp"] }
tinymist-analysis.workspace = true
tinymist-derive.workspace = true
tinymist-std.workspace = true
tinymist-l10n.workspace = true
tinymist-lint.workspace = true
typst.workspace = true
typst-macros.workspace = true
typst-shim.workspace = true
typst-timing.workspace = true
unscanny.workspace = true
walkdir.workspace = true
yaml-rust2.workspace = true
[dev-dependencies]
serde.workspace = true
serde_json.workspace = true
typst-assets = { workspace = true, features = ["fonts"] }
tinymist-tests = { workspace = true }
sha2 = { version = "0.10" }
hex = { version = "0.4" }
[features]
local-registry = ["tinymist-world/system"]
system = ["tinymist-project/system"]
[lints]
workspace = true