aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lua/nvim-treesitter/parsers.lua9
-rw-r--r--queries/http/highlights.scm33
2 files changed, 42 insertions, 0 deletions
diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua
index 71ca152e0..44ef78ed9 100644
--- a/lua/nvim-treesitter/parsers.lua
+++ b/lua/nvim-treesitter/parsers.lua
@@ -762,6 +762,15 @@ list.llvm = {
maintainers = { "@benwilliamgraham" },
}
+list.http = {
+ install_info = {
+ url = "https://github.com/NTBBloodbath/tree-sitter-http",
+ branch = "main",
+ files = { "src/parser.c" },
+ },
+ maintainers = { "@NTBBloodbath" },
+}
+
local M = {
list = list,
}
diff --git a/queries/http/highlights.scm b/queries/http/highlights.scm
new file mode 100644
index 000000000..c1fc5b9cd
--- /dev/null
+++ b/queries/http/highlights.scm
@@ -0,0 +1,33 @@
+; Display errors
+(ERROR) @error
+
+; Comments
+(comment) @comment
+
+(request
+ method: (method) @keyword
+ url: (url) @TSURI)
+
+(header
+ name: (name) @constant
+ value: (value))
+
+; JSON
+(json_pair
+ key: (_) @keyword)
+
+(json_string) @string
+
+(json_number) @number
+
+(json_boolean) @boolean
+
+(json_null) @constant
+
+(json_escape_sequence) @TSStringEscape
+
+(json_body) @keyword
+
+; rest.nvim Neovim plugin specific features
+(external_body
+ json_file: (json_file) @TSURI) @keyword