Skip to content

Commit

Permalink
feat: add cva query
Browse files Browse the repository at this point in the history
Close #58.
  • Loading branch information
luckasRanarison committed Nov 16, 2024
1 parent cfd8275 commit e1c7e59
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion queries/javascript/class.scm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
(member_expression
object: (identifier) @_object.ident)
]
(#any-of? @_ident "clsx" "classnames" "tw" "css")
(#any-of? @_ident "clsx" "classnames" "tw" "css" "cva")
(#eq? @_object.ident "tw")
arguments: [
((arguments
Expand Down
2 changes: 1 addition & 1 deletion queries/typescript/class.scm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
(member_expression
object: (identifier) @_object.ident)
]
(#any-of? @_ident "clsx" "classnames" "tw" "css")
(#any-of? @_ident "clsx" "classnames" "tw" "css" "cva")
(#eq? @_object.ident "tw")
arguments: [
((arguments
Expand Down
1 change: 1 addition & 0 deletions tests/queries/javascript/test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
cva("flex");
clsx("p-4", "text-center");
classnames("bg-red-500", "uppercase");
tw`${"font-semibold"} font-mono text-sm`;
Expand Down
9 changes: 5 additions & 4 deletions tests/queries/javascript_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ runner.test({
provider = "treesitter",
file = "tests/queries/javascript/test.js",
ranges = {
{ 0, 5, 0, 25 },
{ 1, 11, 1, 36 },
{ 2, 3, 2, 39 },
{ 3, 9, 3, 34 },
{ 0, 4, 0, 10 },
{ 1, 5, 1, 25 },
{ 2, 11, 2, 36 },
{ 3, 3, 3, 39 },
{ 4, 9, 4, 34 },
},
})

Expand Down

0 comments on commit e1c7e59

Please sign in to comment.