aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgegoune <dev@clog.rocks>2021-11-04 13:56:26 +0200
committerStephan Seitz <stephan.seitz@fau.de>2021-11-12 21:52:50 +0100
commita93c5b80d724f40da649f7e351234531e0e9fcb2 (patch)
treec2c2b2060fbaaae5c894a16747eb7ea088cc7d8d
parentfeat: get node at cursor of other win (diff)
downloadnvim-treesitter-a93c5b80d724f40da649f7e351234531e0e9fcb2.tar
nvim-treesitter-a93c5b80d724f40da649f7e351234531e0e9fcb2.tar.gz
nvim-treesitter-a93c5b80d724f40da649f7e351234531e0e9fcb2.tar.bz2
nvim-treesitter-a93c5b80d724f40da649f7e351234531e0e9fcb2.tar.lz
nvim-treesitter-a93c5b80d724f40da649f7e351234531e0e9fcb2.tar.xz
nvim-treesitter-a93c5b80d724f40da649f7e351234531e0e9fcb2.tar.zst
nvim-treesitter-a93c5b80d724f40da649f7e351234531e0e9fcb2.zip
feat: add http parser
All credit goes to @NTBBloodbath. See: https://github.com/NTBBloodbath/rest.nvim/issues/75#issuecomment-960447966 Co-authored-by: NTBBloodbath <bloodbathalchemist@protonmail.com>
-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