Skip to content

fix(treesitter): capture TypeScript arrow function definitions - #15

Merged
odvcencio merged 1 commit into
mainfrom
feature/typescript-arrow-function-tags-20260823
Aug 24, 2026
Merged

fix(treesitter): capture TypeScript arrow function definitions#15
odvcencio merged 1 commit into
mainfrom
feature/typescript-arrow-function-tags-20260823

Conversation

@odvcencio

Copy link
Copy Markdown
Owner

Summary

  • supplement the resolved TypeScript tags query with arrow functions bound by variable declarators
  • preserve all existing inferred and curated captures
  • cover the exported arrow definition, ordinary function definition, and both call references

Evidence

  • exact baseline: b13ba83
  • baseline focused test fails because fetchUser is absent from symbols
  • feature focused test passes for 20 consecutive runs
  • live indexing changes the sample from 1 to 2 symbols and resolves the fetchUser -> normalize call edge
  • production logic is copied verbatim from the preserved reviewed response; only the test plumbing was adapted to existing Canopy APIs

Validation

  • go test ./pkg/lang/treesitter -run ^TestTypeScriptArrowFunctionDefinition$ -count=20
  • 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
  • gitleaks on both changed files: no findings

- Extend TypeScript tags queries to capture identifiers bound to arrow functions without replacing existing inferred or curated captures.
- Add regression coverage for exported arrow functions, ordinary functions, and call references.

Buckley-Change-Hash: sha256:a49b6bf799c4125a3a27f42b479a8cfbb7f59c4d5899a358dd41392992cec0ec
Buckley-Change-Stats: files=2 insertions=62 deletions=4 binaries=0
@odvcencio
odvcencio marked this pull request as ready for review August 24, 2026 02:38
@odvcencio
odvcencio merged commit 1b47566 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