Skip to content

feat: add Vue SFC, JSX, and TSX JSX highlighting support#2

Merged
HelgeSverre merged 2 commits intomainfrom
feature/vue-jsx-tsx-support
Feb 28, 2026
Merged

feat: add Vue SFC, JSX, and TSX JSX highlighting support#2
HelgeSverre merged 2 commits intomainfrom
feature/vue-jsx-tsx-support

Conversation

@HelgeSverre
Copy link
Owner

Summary

Adds tree-sitter based syntax highlighting and outline support for Vue, JSX, and enhanced TSX files.

JSX (.jsx)

  • New LanguageId::Jsx using tree-sitter-javascript grammar with combined JS + JSX highlight queries
  • Outline support via existing JS/TS symbol extractor

TSX JSX highlights

  • New dedicated queries/tsx/highlights.scm with JSX-specific captures (@tag for elements, @property for attributes, @punctuation.special for expression braces)

Vue SFC (.vue)

  • New LanguageId::Vue using HTML grammar with multi-pass language injection
  • Detects <script lang="ts"> for TypeScript injection (defaults to JavaScript)
  • CSS injection for <style> blocks, HTML highlighting for <template> blocks
  • Outline panel shows <template>, <script>, <style> as top-level sections

Testing

  • All 1,000+ tests pass, clippy clean
  • New tests: test_vue_sfc_highlighting, test_vue_sfc_javascript_default, test_tsx_query_compiles

HelgeSverre and others added 2 commits February 19, 2026 16:36
- Add LanguageId::Jsx with tree-sitter-javascript grammar + JSX highlight queries
- Add LanguageId::Vue using HTML grammar with multi-pass language injection
  - Detects <script lang="ts"> for TypeScript injection
  - CSS injection for <style> blocks
  - HTML highlighting for <template> blocks
- Add dedicated queries/tsx/highlights.scm with JSX element/attribute captures
- Add Vue outline extraction showing <template>, <script>, <style> sections
- Route JSX files to existing JS/TS outline extractor

Amp-Thread-ID: https://ampcode.com/threads/T-019c75ec-9c9d-7429-9096-0f4d967f5da1
Co-authored-by: Amp <amp@ampcode.com>
@HelgeSverre HelgeSverre merged commit 52fb0f0 into main Feb 28, 2026
1 check failed
@HelgeSverre HelgeSverre deleted the feature/vue-jsx-tsx-support branch February 28, 2026 12:47
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