mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-17 10:50:06 -04:00
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>
This commit is contained in:
parent
fba03a304e
commit
a93c5b80d7
2 changed files with 42 additions and 0 deletions
|
|
@ -762,6 +762,15 @@ list.llvm = {
|
||||||
maintainers = { "@benwilliamgraham" },
|
maintainers = { "@benwilliamgraham" },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
list.http = {
|
||||||
|
install_info = {
|
||||||
|
url = "https://github.com/NTBBloodbath/tree-sitter-http",
|
||||||
|
branch = "main",
|
||||||
|
files = { "src/parser.c" },
|
||||||
|
},
|
||||||
|
maintainers = { "@NTBBloodbath" },
|
||||||
|
}
|
||||||
|
|
||||||
local M = {
|
local M = {
|
||||||
list = list,
|
list = list,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
33
queries/http/highlights.scm
Normal file
33
queries/http/highlights.scm
Normal file
|
|
@ -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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue