Skip to content
This repository has been archived by the owner on Nov 26, 2023. It is now read-only.

Commit

Permalink
move js to ecma to avoid jsx problems
Browse files Browse the repository at this point in the history
  • Loading branch information
elgiano committed Oct 27, 2022
1 parent 53d55ba commit 024f5fb
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 74 deletions.
31 changes: 31 additions & 0 deletions queries/ecma/injections.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
;; extends
((decorator
(call_expression
function: ((identifier) @_name
(#eq? @_name "Component"))
arguments: (arguments
(object
(pair
key: ((property_identifier) @_prop
(#eq? @_prop "template"))
value: ((template_string) @html (#offset! @html 0 1 0 -1))
)
))
)
))

((decorator
(call_expression
function: ((identifier) @_name
(#eq? @_name "Component"))
arguments: (arguments
(object
(pair
key: ((property_identifier) @_prop
(#eq? @_prop "styles"))
value: (array
((template_string) @css (#offset! @css 0 1 0 -1)))
)
))
)
))
7 changes: 4 additions & 3 deletions queries/html/highlights.scm
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
;; extends
(attribute
((attribute_name) @_name
(#lua-match? @_name "%[.*%]"))) @keyword
(#lua-match? @_name "%[.*%]")) @keyword)

(attribute
((attribute_name) @_name
(#lua-match? @_name "%(.*%)"))) @keyword
(#lua-match? @_name "%(.*%)")) @keyword)

(attribute
((attribute_name) @_name
(#lua-match? @_name "^%*.*"))) @keyword
(#lua-match? @_name "^%*.*")) @keyword)
16 changes: 4 additions & 12 deletions queries/html/injections.scm
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
; [state]="myState$ | async"
;; extends
(attribute
((attribute_name) @_name
(#lua-match? @_name "%[.*%]"))
(#lua-match? @_name "[%[%(].*[%)%]]"))
(quoted_attribute_value
(attribute_value) @angular))

; (myEvent)="handle($event)"
(attribute
((attribute_name) @_name
(#lua-match? @_name "%(.*%)"))
(#lua-match? @_name "^%*"))
(quoted_attribute_value
((attribute_value) @angular)))

; *ngIf="blorgy"
(attribute
((attribute_name) @_name
(#lua-match? @_name "^%*.*"))
(quoted_attribute_value
((attribute_value) @angular)))

; {{ someBinding }}
(element
((text) @angular
(#lua-match? @angular "%{%{.*%}%}")
(#offset! @angular 0 2 0 -2)))

58 changes: 0 additions & 58 deletions queries/javascript/injections.scm

This file was deleted.

1 change: 0 additions & 1 deletion queries/typescript/injections.scm

This file was deleted.

0 comments on commit 024f5fb

Please sign in to comment.