Skip to content

fix(treesitter): index Rust type aliases - #17

Merged
odvcencio merged 1 commit into
mainfrom
feature/rust-type-alias-tags-20260823
Aug 24, 2026
Merged

fix(treesitter): index Rust type aliases#17
odvcencio merged 1 commit into
mainfrom
feature/rust-type-alias-tags-20260823

Conversation

@odvcencio

Copy link
Copy Markdown
Owner

Summary

  • supplement the inferred Rust tags query with type_item alias definitions
  • preserve all existing inferred Rust definitions and references
  • cover the alias, ordinary function definition, and call reference

Evidence

  • exact baseline: 3e2cdb5
  • bounded matrix probe 1, Python async function and calls, passed
  • probe 2 stopped the matrix: Rust UserId alias was absent while normalize and main definitions and the normalize call remained
  • the Rust AST query for type_item and type_identifier matches UserId directly
  • live indexing changes the sample from 2 to 3 symbols while preserving the main -> normalize call edge
  • production and regression logic come from preserved response 1; integration changed only malformed hunk and new-file mechanics

Validation

  • go test ./pkg/lang/treesitter -run ^TestRustTypeAliasDefinition$ -count=20
  • focused Ruby, JavaScript, TypeScript, and Rust tag tests
  • go test ./pkg/lang/treesitter -count=1
  • go test -race ./pkg/lang/treesitter -count=1
  • go test ./pkg/index ./pkg/xref ./cmd/canopy -count=1
  • go test ./... -count=1
  • go test -race ./... -count=1
  • git diff --check
  • commit-range gitleaks scan: no findings

- Capture Rust `type_item` aliases as type definitions so exported aliases appear in symbol indexes.
- Add regression coverage confirming Rust type aliases, function definitions, and call references are all detected.

Buckley-Change-Hash: sha256:f45dc00b98067c8c04bc7224bf64084427b811fc578725ec246dd960448c9751
Buckley-Change-Stats: files=2 insertions=41 deletions=0 binaries=0
@odvcencio
odvcencio marked this pull request as ready for review August 24, 2026 03:03
@odvcencio
odvcencio merged commit 70836d6 into main Aug 24, 2026
1 check passed
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