fix(extraction): capture Vue script call references#465
Merged
colbymchenry merged 2 commits intoMay 27, 2026
Conversation
c9c9fd2 to
d2be136
Compare
The fix in src/extraction/tree-sitter.ts is not Vue-specific — the same bug existed for any top-level `const x = foo()` in plain TS/JS. Update the CHANGELOG to reflect the broader scope, and add a non-Vue regression test alongside the existing "Exported Variable Extraction" suite so the generalized fix is locked in. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes Vue SFC call extraction so calls inside script block initializer and method bodies are indexed correctly.
This covers two patterns reported in #425:
<script setup>top-level initializers, for exampleconst token = getTokenMp()methods: { save() { getTokenMp() } }The extractor still avoids creating noisy synthetic nodes for object-literal methods, but now walks their bodies so call references are not dropped.
Fixes #425.
Testing
npx -y -p node@22 -p npm@10 npm exec -- vitest run __tests__/extraction.test.ts -t "Vue Extraction"npx -y -p node@22 -p npm@10 npm exec -- vitest run __tests__/extraction.test.ts __tests__/pr19-improvements.test.ts __tests__/graph.test.tsnpx -y -p node@22 -p npm@10 npm run buildnpx -y -p node@22 -p npm@10 npm test