mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-11 07:50:07 -04:00
feat(http): more comprehensive highlights
This commit is contained in:
parent
eff88f4e8b
commit
2d5c122af9
3 changed files with 68 additions and 2 deletions
21
tests/query/injections/http/injections.http
Normal file
21
tests/query/injections/http/injections.http
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
### post-request script
|
||||
GET https://jsonplaceholder.typicode.com/posts/3
|
||||
|
||||
# @lang=lua
|
||||
> {%
|
||||
local body = vim.json.decode(response.body)
|
||||
client.global.set("postId", body.id)
|
||||
-- ^ @lua
|
||||
%}
|
||||
|
||||
|
||||
### run request with variable
|
||||
|
||||
GET https://jsonplaceholder.typicode.com/posts/{{postId}}
|
||||
|
||||
> {%
|
||||
client.global.set("auth_token", response.body.jwt);
|
||||
// ^ @javascript
|
||||
%}
|
||||
|
||||
### vim: ft=http
|
||||
Loading…
Add table
Add a link
Reference in a new issue