Skip to content

fix(treesitter): recognize JavaScript arrow function definitions - #16

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

fix(treesitter): recognize JavaScript arrow function definitions#16
odvcencio merged 1 commit into
mainfrom
feature/javascript-arrow-function-tags-20260823

Conversation

@odvcencio

Copy link
Copy Markdown
Owner

Summary

  • supplement the resolved JavaScript tags query with arrow functions bound by variable declarators
  • preserve existing inferred JavaScript definitions and calls
  • cover the exported arrow definition, ordinary function definition, and both call references

Evidence

  • exact baseline: 1b47566
  • baseline focused test fails because fetchUser is absent while normalize remains indexed
  • 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
  • implementation and assertions come from the preserved corrected response; integration changed only hunk placement and final-newline mechanics

Validation

  • go test ./pkg/lang/treesitter -run ^TestJavaScriptArrowFunctionDefinition$ -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
  • commit-range gitleaks scan: no findings

- Add a supplemental JavaScript tags query for arrow functions assigned to variables
- Cover exported arrow functions, regular functions, and call references with a regression test

Buckley-Change-Hash: sha256:4c1586ff3b489f59756eecf5092f4cf15878aecc9b40fc851c1772a7480e8d09
Buckley-Change-Stats: files=2 insertions=44 deletions=0 binaries=0
@odvcencio
odvcencio marked this pull request as ready for review August 24, 2026 02:52
@odvcencio
odvcencio merged commit 3e2cdb5 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