From c44a63ffdc213a5b56685a34502a00f56a2d061e Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Thu, 20 Apr 2023 05:20:02 -0400 Subject: [PATCH] feat(http): update parser queries from upstream --- README.md | 2 +- lockfile.json | 2 +- queries/http/highlights.scm | 67 ++++++++++++++++++++++++++++++------- queries/http/injections.scm | 6 ++++ 4 files changed, 62 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 7fcbc801d..fde2cb3df 100644 --- a/README.md +++ b/README.md @@ -246,7 +246,7 @@ We are looking for maintainers to add more parsers and to write query files for - [x] [hocon](https://github.com/antosha417/tree-sitter-hocon) (maintained by @antosha417) - [x] [html](https://github.com/tree-sitter/tree-sitter-html) (maintained by @TravonteD) - [x] [htmldjango](https://github.com/interdependence/tree-sitter-htmldjango) (experimental, maintained by @ObserverOfTime) -- [x] [http](https://github.com/rest-nvim/tree-sitter-http) (maintained by @NTBBloodbath) +- [x] [http](https://github.com/rest-nvim/tree-sitter-http) (maintained by @amaanq) - [x] [ini](https://github.com/justinmk/tree-sitter-ini) (experimental, maintained by @theHamsta) - [x] [java](https://github.com/tree-sitter/tree-sitter-java) (maintained by @p00f) - [x] [javascript](https://github.com/tree-sitter/tree-sitter-javascript) (maintained by @steelsojka) diff --git a/lockfile.json b/lockfile.json index 6292b5cb9..6c95f6535 100644 --- a/lockfile.json +++ b/lockfile.json @@ -219,7 +219,7 @@ "revision": "b2dba02eddab66be669022320273d0dfe1ff923d" }, "http": { - "revision": "2c6c44574031263326cb1e51658bbc0c084326e7" + "revision": "f41d3e97ad148f0b2c2d913e3834ccd5816fdc02" }, "ini": { "revision": "1a0ce072ebf3afac7d5603d9a95bb7c9a6709b44" diff --git a/queries/http/highlights.scm b/queries/http/highlights.scm index f5a08813b..e89b4dc7f 100644 --- a/queries/http/highlights.scm +++ b/queries/http/highlights.scm @@ -1,19 +1,60 @@ -; inherits: json +; Keywords -; Display errors -(ERROR) @error +(scheme) @keyword + +; Methods + +(method) @method + +; Constants + +(const_spec) @constant + +; Variables + +(identifier) @variable + +; Fields + +(pair name: (identifier) @field) + +; Parameters + +(query_param (key) @parameter) + +; Operators + +[ + "=" + "?" + "&" + "@" +] @operator + +; Literals + +(string) @string + +(target_url) @string @text.uri + +(number) @number + +; (boolean) @boolean + +(null) @constant.builtin + +; Punctuation + +[ "{{" "}}" ] @punctuation.bracket + +[ + ":" +] @punctuation.delimiter ; Comments -(comment) @comment -(request - method: (method) @keyword - url: (url) @text.uri) +(comment) @comment @spell -(header - name: (name) @constant - value: (value)) +; Errors -; rest.nvim Neovim plugin specific features -(external_body - json_file: (json_file) @text.uri) @keyword +(ERROR) @error diff --git a/queries/http/injections.scm b/queries/http/injections.scm index 4bb7d675d..db35379f7 100644 --- a/queries/http/injections.scm +++ b/queries/http/injections.scm @@ -1 +1,7 @@ (comment) @comment + +(json_body) @json + +; (xml_body) @xml + +; (graphql_body) @graphql Not used as of now..