Skip to content

feat(picker): add symbol tree guides and aligned locations - #333

Merged
fcoury-oai merged 1 commit into
mainfrom
fcoury/document-symbol-picker-tree
Aug 23, 2026
Merged

fcoury-oai merged 1 commit into
mainfrom
fcoury/document-symbol-picker-tree

Conversation

@fcoury-oai

Copy link
Copy Markdown
Collaborator

Why

#331 preserved long symbol names, but document symbols still appear as a flat list and their line:column values cluster beside the longest name. That hides real symbol hierarchy and makes positions difficult to scan, especially beside the source preview.

What changed

  • Render theme-aware ├╴, └╴, and │ guides from actual document-symbol parent IDs, with cached ancestry, correct async-batch invalidation, and ASCII fallbacks.
  • Align line and column numbers independently in a right-justified position gutter without overlapping previews; preserve primary labels when the viewport is narrow.
  • Add default-on [picker] tree_guides = true. Disabling it hides only the guides; aligned positions remain, and workspace symbols always stay flat.
  • Cover nested payloads, sibling and ancestor branches, preview boundaries, filtering, batched updates, narrow viewports, disabled guides, and ASCII terminals.
├╴ impl Dashboard        5: 6
│ ├╴ first_child         6: 8
│ └╴ second_child        7: 8
├╴ long_tail           110: 4
└╴ main                112: 4

How to Test

  1. Open a Rust file containing nested impl methods or modules and symbols on both short and three-digit line numbers. Invoke Document Symbols with Ctrl-t; expect real hierarchy connectors, vertically aligned colons and column numbers, and a position gutter that ends exactly at the preview divider.
  2. Filter to a nested symbol and narrow the terminal. Expect ancestry guides to remain correct, long symbol names to stay visible, and positions to disappear before names are truncated.
  3. Set [picker] tree_guides = false, reopen Red, and invoke Document Symbols again. Expect a flat list with the same aligned position gutter. Open Workspace Symbols and confirm it remains flat and still includes file paths.
  4. Set [picker.icons] style = "ascii" and reopen Document Symbols; expect |- and `- connectors instead of Unicode box-drawing characters.
  5. Run cargo test --lib document_symbol, cargo test --lib picker_tree_guides, and cargo test --test lsp_lazy --test self_check; expect the hierarchy, configuration, LSP, and bundled-plugin checks to pass.

Validated locally with 2,399 passing library tests, 48 LSP integration tests, both bundled-plugin checks, the 12,000-file picker benchmark, and warning-free all-target/all-feature Clippy.

@fcoury-oai
fcoury-oai merged commit def39e6 into main Aug 23, 2026
12 checks passed
@fcoury-oai
fcoury-oai deleted the fcoury/document-symbol-picker-tree branch August 23, 2026 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant