Created
July 5, 2024 22:31
-
-
Save AlansCodeLog/9c6b02a7f31806ad38188f8d34514bf7 to your computer and use it in GitHub Desktop.
Treesitter Query to Get Vue Syntax Highlighting in Storybook Stories
This file contains 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
; extends | |
( | |
(export_statement | |
declaration: (lexical_declaration (variable_declarator | |
type: (type_annotation | |
(type_identifier) @idenStory (#eq? @idenStory "Story") | |
) | |
value: (object | |
(pair | |
key: (property_identifier) @idenRender (#eq? @idenRender "render") | |
value: (_ | |
body: (_ (object (pair | |
key: (property_identifier) @idenTemplate (#eq? @idenTemplate "template") | |
value: ( | |
; remove quotes | |
(template_string) @injection.content (#offset! @injection.content 0 1 0 -1) | |
) | |
(#set! injection.language "vue") | |
(#set! injection.include-children) | |
))) | |
) | |
) | |
) | |
)) | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment