Skip to content

Commit bbcd676

Browse files
fix(queries): update queries
now `@lang` also matches with post-request scripts in request without body
1 parent b88cd0c commit bbcd676

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

queries/injections.scm

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,22 @@
1919

2020
; Script with other languages
2121
((comment
22-
name: (_) @_name
23-
(#eq? @_name "lang")
24-
value: (_) @injection.language)
25-
.
26-
(_
27-
(script) @injection.content
28-
(#offset! @injection.content 0 2 0 -2)))
22+
name: (_) @_name
23+
(#eq? @_name "lang")
24+
value: (_) @injection.language)
25+
.
26+
(_
27+
(script) @injection.content
28+
(#offset! @injection.content 0 2 0 -2)))
29+
30+
; post-request scripts for requests without body
31+
((request
32+
!body
33+
(comment
34+
name: (_) @_name
35+
(#eq? @_name "lang")
36+
value: (_) @injection.language) .)
37+
.
38+
(res_handler_script
39+
(script) @injection.content
40+
(#offset! @injection.content 0 2 0 -2)))

0 commit comments

Comments
 (0)