mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
feat(http): switch to new parser version (#7063)
This commit is contained in:
parent
6699eae8ba
commit
0fd6d32482
3 changed files with 39 additions and 38 deletions
|
|
@ -315,7 +315,7 @@
|
|||
"revision": "ea71012d3fe14dd0b69f36be4f96bdfe9155ebae"
|
||||
},
|
||||
"http": {
|
||||
"revision": "5ae6c7cfa62a7d7325c26171a1de4f6b866702b5"
|
||||
"revision": "b88cd0c7dba0128b8f28fcb25cca13eea0d193b3"
|
||||
},
|
||||
"hurl": {
|
||||
"revision": "fba6ed8db3a009b9e7d656511931b181a3ee5b08"
|
||||
|
|
|
|||
|
|
@ -1,50 +1,36 @@
|
|||
; Keywords
|
||||
(scheme) @module
|
||||
|
||||
; Methods
|
||||
(method) @function.method
|
||||
|
||||
; Headers
|
||||
(header
|
||||
name: (name) @constant)
|
||||
name: (_) @constant)
|
||||
|
||||
; Variables
|
||||
(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)
|
||||
|
||||
; Operators
|
||||
[
|
||||
"="
|
||||
"?"
|
||||
"&"
|
||||
"@"
|
||||
"<"
|
||||
] @operator
|
||||
(comment
|
||||
"=" @operator)
|
||||
|
||||
(variable_declaration
|
||||
"=" @operator)
|
||||
|
||||
; keywords
|
||||
(comment
|
||||
"@" @keyword
|
||||
name: (_) @keyword)
|
||||
|
||||
; Literals
|
||||
(target_url) @string.special.url
|
||||
(request
|
||||
url: (_) @string.special.url)
|
||||
|
||||
(http_version) @constant
|
||||
|
||||
(string) @string
|
||||
; Response
|
||||
(status_code) @number
|
||||
|
||||
(number) @number
|
||||
|
||||
(boolean) @boolean
|
||||
(status_text) @string
|
||||
|
||||
; Punctuation
|
||||
[
|
||||
|
|
@ -52,11 +38,15 @@
|
|||
"}}"
|
||||
] @punctuation.bracket
|
||||
|
||||
":" @punctuation.delimiter
|
||||
(header
|
||||
":" @punctuation.delimiter)
|
||||
|
||||
; external JSON body
|
||||
(external_body
|
||||
file_path: (path) @string.special.path)
|
||||
path: (_) @string.special.path)
|
||||
|
||||
; Comments
|
||||
(comment) @comment @spell
|
||||
[
|
||||
(comment)
|
||||
(request_separator)
|
||||
] @comment @spell
|
||||
|
|
|
|||
|
|
@ -9,9 +9,20 @@
|
|||
((xml_body) @injection.content
|
||||
(#set! injection.language "xml"))
|
||||
|
||||
((graphql_body) @injection.content
|
||||
((graphql_data) @injection.content
|
||||
(#set! injection.language "graphql"))
|
||||
|
||||
; Lua scripting
|
||||
((script_variable) @injection.content
|
||||
(#set! injection.language "lua"))
|
||||
; Script (default to javascript)
|
||||
((script) @injection.content
|
||||
(#offset! @injection.content 0 2 0 -2)
|
||||
(#set! injection.language "javascript"))
|
||||
|
||||
; Script with other languages
|
||||
((comment
|
||||
name: (_) @_name
|
||||
(#eq? @_name "lang")
|
||||
value: (_) @injection.language)
|
||||
.
|
||||
(_
|
||||
(script) @injection.content
|
||||
(#offset! @injection.content 0 2 0 -2)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue