Skip to content

feat: add .astro file support#15

Open
zlegein wants to merge 1 commit into
CSCSoftware:masterfrom
zlegein:master
Open

feat: add .astro file support#15
zlegein wants to merge 1 commit into
CSCSoftware:masterfrom
zlegein:master

Conversation

@zlegein
Copy link
Copy Markdown

@zlegein zlegein commented May 20, 2026

Index Astro files by parsing their TypeScript frontmatter (content between --- fences) using the TSX grammar. Line numbers are preserved by replacing template lines with blank lines before parsing, so all reported positions match the original file.

Changes:

  • parser/tree-sitter.ts: add 'astro' to SupportedLanguage, EXTENSION_MAP, and GRAMMAR_MAP (uses TypeScript.tsx); add extractAstroFrontmatter(); update parseFile() to extract frontmatter before parsing .astro files
  • parser/languages/index.ts: add 'astro' config (reuses TypeScript config)
  • commands/init.ts: add '.astro' to CODE_EXTENSIONS

Index Astro files by parsing their TypeScript frontmatter (content
between --- fences) using the TSX grammar. Line numbers are preserved
by replacing template lines with blank lines before parsing, so all
reported positions match the original file.

Changes:
- parser/tree-sitter.ts: add 'astro' to SupportedLanguage, EXTENSION_MAP,
  and GRAMMAR_MAP (uses TypeScript.tsx); add extractAstroFrontmatter();
  update parseFile() to extract frontmatter before parsing .astro files
- parser/languages/index.ts: add 'astro' config (reuses TypeScript config)
- commands/init.ts: add '.astro' to CODE_EXTENSIONS

Co-authored-by: Cursor <cursoragent@cursor.com>
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