Line-based import scanning in deps graph #217

Open
opened 2026-11-21 12:36:55 +00:00 by johannes · 0 comments
Owner

Location: crates/hx-lens/src/deps.rs (module header, import scanner)
What is hacky: Imports are found by line scanning, not parsing. Runtime-built imports and multi-line use {..} groups are missed.
Proper fix: Use tree-sitter queries for import extraction.
Original comment: "ponytail: line-based import scanning, not tree-sitter. Misses imports built at runtime and multi-line use {..} groups spanning many lines (Rust is crate-level anyway). Upgrade to tree-sitter queries if selection misses show up in practice."

Found by the comment audit: the comment excusing this was deleted (see scripts/lint-comments.sh).

Location: crates/hx-lens/src/deps.rs (module header, import scanner) What is hacky: Imports are found by line scanning, not parsing. Runtime-built imports and multi-line `use {..}` groups are missed. Proper fix: Use tree-sitter queries for import extraction. Original comment: "ponytail: line-based import scanning, not tree-sitter. Misses imports built at runtime and multi-line `use {..}` groups spanning many lines (Rust is crate-level anyway). Upgrade to tree-sitter queries if selection misses show up in practice." Found by the comment audit: the comment excusing this was deleted (see scripts/lint-comments.sh).
johannes added the lens label 2026-11-21 12:36:55 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: johannes/hx#217