Summary
Add Svelte support via tree-sitter + Svelte Language Server, leveraging existing TypeScript infrastructure.
Tooling
What to implement
Phase 1: Script block extraction
Phase 2: Template component references (follow-up)
Language notes
- Svelte components are single files with
<script>, markup, and <style> sections
<script context="module"> runs once per module (not per instance) — different scoping
export let in <script> declares component props
$: reactive statements re-run when dependencies change — these should be tracked
- Svelte 5 introduces
$state(), $derived(), $effect() runes — new patterns for the extractor
- The Svelte language server (
svelteserver) is an npm package: npm install -g svelte-language-server
Context
Svelte is a top-5 web framework with growing adoption. Like Vue, Svelte components contain TypeScript/JavaScript logic that the existing TS extractor handles. The main value-add is SFC structure recognition and component reference tracking.
Summary
Add Svelte support via tree-sitter + Svelte Language Server, leveraging existing TypeScript infrastructure.
Tooling
tree-sitter-sveltesvelte-language-serverWhat to implement
Phase 1: Script block extraction
tree-sitter-svelteas an npm dependencysrc/indexer/extractors/svelte.ts:<script>and<script context="module">blocks<script>content to the existing TypeScript/JavaScript extractor for symbol and call-ref extractionexport let propNameas prop/interface symbols$:reactive declarations as computed symbolsimportstatements from<script>as file importssvelteinSourceIndexStageEXTRACTORS map andParserPoolLANG_PACKAGESsvelteservertosrc/indexer/lsp/registry.ts:{ command: 'svelteserver', args: ['--stdio'] }.svelteto walkertests/fixtures/svelte/Phase 2: Template component references (follow-up)
<ComponentName />usage in the template markup as call refson:eventhandler bindings as refsbind:propandslotreferencesLanguage notes
<script>, markup, and<style>sections<script context="module">runs once per module (not per instance) — different scopingexport letin<script>declares component props$:reactive statements re-run when dependencies change — these should be tracked$state(),$derived(),$effect()runes — new patterns for the extractorsvelteserver) is an npm package:npm install -g svelte-language-serverContext
Svelte is a top-5 web framework with growing adoption. Like Vue, Svelte components contain TypeScript/JavaScript logic that the existing TS extractor handles. The main value-add is SFC structure recognition and component reference tracking.