diff options
| author | Riley Bruins <ribru17@hotmail.com> | 2024-11-02 19:55:35 -0700 |
|---|---|---|
| committer | Christian Clason <ch.clason+github@icloud.com> | 2024-11-22 08:56:14 +0100 |
| commit | 2d5c122af9c3c842d74a137446dae8ff349206ac (patch) | |
| tree | 750f103b5b55eae65d2671287d7947e29382496b /tests | |
| parent | bot(lockfile): update nu, perl, robot, scala, sql, teal (diff) | |
| download | nvim-treesitter-2d5c122af9c3c842d74a137446dae8ff349206ac.tar nvim-treesitter-2d5c122af9c3c842d74a137446dae8ff349206ac.tar.gz nvim-treesitter-2d5c122af9c3c842d74a137446dae8ff349206ac.tar.bz2 nvim-treesitter-2d5c122af9c3c842d74a137446dae8ff349206ac.tar.lz nvim-treesitter-2d5c122af9c3c842d74a137446dae8ff349206ac.tar.xz nvim-treesitter-2d5c122af9c3c842d74a137446dae8ff349206ac.tar.zst nvim-treesitter-2d5c122af9c3c842d74a137446dae8ff349206ac.zip | |
feat(http): more comprehensive highlights
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/query/highlights/http/test.http | 33 | ||||
| -rw-r--r-- | tests/query/injections/http/injections.http | 21 |
2 files changed, 54 insertions, 0 deletions
diff --git a/tests/query/highlights/http/test.http b/tests/query/highlights/http/test.http new file mode 100644 index 000000000..00fca50ab --- /dev/null +++ b/tests/query/highlights/http/test.http @@ -0,0 +1,33 @@ +@ENDPOINT=http://localhost:8080/api +# <- @character.special +# ^^^^^^^ @variable +# ^ @operator +# ^^^^^^^^^^^^^^^^^^^^^^^^^ @string + +### GET USERS +GET {{ENDPOINT}}/users HTTP/1.1 +# ^^ @punctuation.bracket +# ^^^^^^^^ @variable +# ^^ @punctuation.bracket +# ^^^^^^ @string.special.url +# ^^^^^^^^ @string.special + +### GET USERS by Offset +GET {{ENDPOINT}}/users?offset=30 HTTP/1.1 +# <- @function.method + +### POST login +POST {{ENDPOINT}}/auth/login HTTP/1.1 +Content-Type: application/json + +{ + "username": "admin", + "password": "password" +} + +### Log Out +POST {{ENDPOINT}}/auth/logout HTTP/1.1 +Content-Type: application/json +# ^^^^^^^^^^ @constant +# ^ @punctuation.delimiter +# vim: ft=http diff --git a/tests/query/injections/http/injections.http b/tests/query/injections/http/injections.http new file mode 100644 index 000000000..0f339cb6f --- /dev/null +++ b/tests/query/injections/http/injections.http @@ -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 |
