diff options
| author | NTBBloodbath <bloodbathalchemist@protonmail.com> | 2024-03-17 07:27:42 -0400 |
|---|---|---|
| committer | ObserverOfTime <chronobserver@disroot.org> | 2024-03-18 00:46:59 +0200 |
| commit | c4e0f290d744ceede4ec0c464a5f985e821b1502 (patch) | |
| tree | a7c68b0b1d0b576762507ef61491581ee57593c4 /queries | |
| parent | bot(lockfile): update c_sharp, glimmer, hyprlang, meson, mlir, ocaml, ocaml_i... (diff) | |
| download | nvim-treesitter-c4e0f290d744ceede4ec0c464a5f985e821b1502.tar nvim-treesitter-c4e0f290d744ceede4ec0c464a5f985e821b1502.tar.gz nvim-treesitter-c4e0f290d744ceede4ec0c464a5f985e821b1502.tar.bz2 nvim-treesitter-c4e0f290d744ceede4ec0c464a5f985e821b1502.tar.lz nvim-treesitter-c4e0f290d744ceede4ec0c464a5f985e821b1502.tar.xz nvim-treesitter-c4e0f290d744ceede4ec0c464a5f985e821b1502.tar.zst nvim-treesitter-c4e0f290d744ceede4ec0c464a5f985e821b1502.zip | |
feat(http): switch to new parser version
fix(http): use `@variable.member` for fields
fix(http): keep the comment injection
fix(http): keep `method` capture as `@function.method`
docs(README.md): update HTTP parser maintainers list
feat(http): remove redundant captures
cleanup(http): remove unneedeed highlighting captures
Diffstat (limited to 'queries')
| -rw-r--r-- | queries/http/highlights.scm | 31 | ||||
| -rw-r--r-- | queries/http/injections.scm | 10 |
2 files changed, 32 insertions, 9 deletions
diff --git a/queries/http/highlights.scm b/queries/http/highlights.scm index a9c4dc079..8d9d0e640 100644 --- a/queries/http/highlights.scm +++ b/queries/http/highlights.scm @@ -1,5 +1,5 @@ -; Schemes -(scheme) @type +; Keywords +(scheme) @module ; Methods (method) @function.method @@ -7,13 +7,24 @@ ; Constants (const_spec) @constant +; Headers +(header + name: (name) @constant) + ; Variables -(identifier) @variable +(variable_declaration + name: (identifier) @variable) ; Fields (pair name: (identifier) @variable.member) +; URL / Host +(host) @string.special.url + +(path + (identifier) @string.special.url) + ; Parameters (query_param (key) @variable.parameter) @@ -24,17 +35,19 @@ "?" "&" "@" + "<" ] @operator ; Literals -(string) @string - (target_url) @string.special.url +(http_version) @constant + +(string) @string + (number) @number -; (boolean) @boolean -(null) @constant.builtin +(boolean) @boolean ; Punctuation [ @@ -44,5 +57,9 @@ ":" @punctuation.delimiter +; external JSON body +(external_body + file_path: (path) @string.special.path) + ; Comments (comment) @comment @spell diff --git a/queries/http/injections.scm b/queries/http/injections.scm index a0cc1b4e9..68268afcb 100644 --- a/queries/http/injections.scm +++ b/queries/http/injections.scm @@ -1,11 +1,17 @@ +; Comments ((comment) @injection.content (#set! injection.language "comment")) +; Body ((json_body) @injection.content (#set! injection.language "json")) ((xml_body) @injection.content (#set! injection.language "xml")) -; ((graphql_body) @injection.content -; (#set! injection.language "graphql")) ; Not used as of now.. +((graphql_body) @injection.content + (#set! injection.language "graphql")) + +; Lua scripting +((script_variable) @injection.content + (#set! injection.language "lua")) |
