Repository navigation
Conversation
Adds .vue and .svelte indexing by extracting script blocks and parsing them with JS/TS parsers, including line remapping for original files. Also wires extension routing, pre-scan symbol collection, package language enums/docs, and parser coverage tests. Closes #709
|
@Zhey-on is attempting to deploy a commit to the shashankss1205's projects Team on Vercel. A member of the Team first needs to authorize it. |
mannyyang
added a commit
to datatorag/CodeGraphContext
that referenced
this pull request
Apr 9, 2026
Replace the inline Vue hack (regex + temp file) with dedicated SFC parsers based on CodeGraphContext#712: - sfc_common.py: SharedSingleFileComponentTreeSitterParser base class - Multi-block support (<script> + <script setup>) - lang="ts" detection → routes to TypeScript parser - Line offset remapping → line numbers point to original .vue file - No temp files — parses script content in-memory - Dedicated pre_scan for cross-file import resolution - vue.py: VueTreeSitterParser subclass - svelte.py: SvelteTreeSitterParser subclass (new language support) Removed: _extract_vue_script, temp file creation in parse_file Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
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
This PR adds first-class support for Vue and Svelte single-file components.
.vueand.svelterouting in the graph builder<script>blocksWhy this approach
Vue and Svelte files mix template markup with script code. Instead of trying to parse every SFC construct as a new language model, this keeps code analysis focused on script sections and reuses the mature JS/TS logic that is already in the project.
Validation
./tests/run_tests.sh fast-> passed (69 passed, 2 skipped)pytest -q tests/unit/parsers/test_sfc_parsers.pypython3 scripts/test_all_parsers.pyCloses #709