mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-06 05:20:00 -04:00
Add a basic styled-components injection
I've never written this sort of code before but I was able to get this to work with the help of copy and paste and using nvim-treesitter/playground. I had a hard time trying to understand how to indent this style of code so I let vim do it with `=` and 2 spaces seems to match other files I looked at. This works for a basic example, like this: ``` const Layout = styled.div` position: absolute; inset: 0; display: grid; grid-template-rows: 100px 1fr 3rem; ` ```
This commit is contained in:
parent
b5d05aaac8
commit
058e050315
1 changed files with 16 additions and 11 deletions
|
|
@ -2,20 +2,25 @@
|
|||
(comment) @comment
|
||||
|
||||
(call_expression
|
||||
function: ((identifier) @language)
|
||||
arguments: ((template_string) @content
|
||||
(#offset! @content 0 1 0 -1)))
|
||||
function: ((identifier) @language)
|
||||
arguments: ((template_string) @content
|
||||
(#offset! @content 0 1 0 -1)))
|
||||
|
||||
(call_expression
|
||||
function: ((identifier) @_name
|
||||
(#eq? @_name "gql"))
|
||||
arguments: ((template_string) @graphql
|
||||
(#offset! @graphql 0 1 0 -1)))
|
||||
function: ((identifier) @_name
|
||||
(#eq? @_name "gql"))
|
||||
arguments: ((template_string) @graphql
|
||||
(#offset! @graphql 0 1 0 -1)))
|
||||
|
||||
(call_expression
|
||||
function: ((identifier) @_name
|
||||
(#eq? @_name "hbs"))
|
||||
arguments: ((template_string) @glimmer
|
||||
(#offset! @glimmer 0 1 0 -1)))
|
||||
function: ((identifier) @_name
|
||||
(#eq? @_name "hbs"))
|
||||
arguments: ((template_string) @glimmer
|
||||
(#offset! @glimmer 0 1 0 -1)))
|
||||
|
||||
(call_expression
|
||||
function: (member_expression
|
||||
object: (identifier) @_name (#eq? @_name "styled"))
|
||||
arguments: ((template_string) @css (#offset! @css 0 1 0 -1)))
|
||||
|
||||
(regex_pattern) @regex
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue