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

move js to ecma to avoid jsx problems #4

Merged
merged 1 commit into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.