Skip to content

Add Vue and Svelte single-file component support#712

Open
Zhey-on wants to merge 1 commit intoCodeGraphContext:mainfrom
Zhey-on:feat/issue-709-vue-svelte
Open

Add Vue and Svelte single-file component support#712
Zhey-on wants to merge 1 commit intoCodeGraphContext:mainfrom
Zhey-on:feat/issue-709-vue-svelte

Conversation

@Zhey-on
Copy link
Copy Markdown
Contributor

@Zhey-on Zhey-on commented Mar 13, 2026

Summary

This PR adds first-class support for Vue and Svelte single-file components.

  • Added .vue and .svelte routing in the graph builder
  • Implemented dedicated Vue/Svelte parsers that extract <script> blocks
  • Reused existing JavaScript/TypeScript parsers for script analysis
  • Preserved original file line numbers with offset remapping
  • Added SFC pre-scan support so symbol resolution works across files
  • Updated language aliases, tool language enums, docs, and parser smoke tests

Why 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.py
  • python3 scripts/test_all_parsers.py

Closes #709

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 CodeGraphContext#709
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 13, 2026

@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.

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.

Add support for Svelte and Vue

1 participant