feat: add Vue SFC, JSX, and TSX JSX highlighting support#2
Merged
HelgeSverre merged 2 commits intomainfrom Feb 28, 2026
Merged
Conversation
- 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>
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
Adds tree-sitter based syntax highlighting and outline support for Vue, JSX, and enhanced TSX files.
JSX (
.jsx)LanguageId::Jsxusingtree-sitter-javascriptgrammar with combined JS + JSX highlight queriesTSX JSX highlights
queries/tsx/highlights.scmwith JSX-specific captures (@tagfor elements,@propertyfor attributes,@punctuation.specialfor expression braces)Vue SFC (
.vue)LanguageId::Vueusing HTML grammar with multi-pass language injection<script lang="ts">for TypeScript injection (defaults to JavaScript)<style>blocks, HTML highlighting for<template>blocks<template>,<script>,<style>as top-level sectionsTesting
test_vue_sfc_highlighting,test_vue_sfc_javascript_default,test_tsx_query_compiles