feat(http): switch to new parser version (#7063)

This commit is contained in:
Alejandro 2024-08-21 03:08:45 -04:00 committed by GitHub
parent 6699eae8ba
commit 0fd6d32482
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 39 additions and 38 deletions

View file

@ -315,7 +315,7 @@
"revision": "ea71012d3fe14dd0b69f36be4f96bdfe9155ebae" "revision": "ea71012d3fe14dd0b69f36be4f96bdfe9155ebae"
}, },
"http": { "http": {
"revision": "5ae6c7cfa62a7d7325c26171a1de4f6b866702b5" "revision": "b88cd0c7dba0128b8f28fcb25cca13eea0d193b3"
}, },
"hurl": { "hurl": {
"revision": "fba6ed8db3a009b9e7d656511931b181a3ee5b08" "revision": "fba6ed8db3a009b9e7d656511931b181a3ee5b08"

View file

@ -1,50 +1,36 @@
; Keywords
(scheme) @module
; Methods ; Methods
(method) @function.method (method) @function.method
; Headers ; Headers
(header (header
name: (name) @constant) name: (_) @constant)
; Variables ; Variables
(variable_declaration (variable_declaration
name: (identifier) @variable) 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 ; Operators
[ (comment
"=" "=" @operator)
"?"
"&" (variable_declaration
"@" "=" @operator)
"<"
] @operator ; keywords
(comment
"@" @keyword
name: (_) @keyword)
; Literals ; Literals
(target_url) @string.special.url (request
url: (_) @string.special.url)
(http_version) @constant (http_version) @constant
(string) @string ; Response
(status_code) @number
(number) @number (status_text) @string
(boolean) @boolean
; Punctuation ; Punctuation
[ [
@ -52,11 +38,15 @@
"}}" "}}"
] @punctuation.bracket ] @punctuation.bracket
":" @punctuation.delimiter (header
":" @punctuation.delimiter)
; external JSON body ; external JSON body
(external_body (external_body
file_path: (path) @string.special.path) path: (_) @string.special.path)
; Comments ; Comments
(comment) @comment @spell [
(comment)
(request_separator)
] @comment @spell

View file

@ -9,9 +9,20 @@
((xml_body) @injection.content ((xml_body) @injection.content
(#set! injection.language "xml")) (#set! injection.language "xml"))
((graphql_body) @injection.content ((graphql_data) @injection.content
(#set! injection.language "graphql")) (#set! injection.language "graphql"))
; Lua scripting ; Script (default to javascript)
((script_variable) @injection.content ((script) @injection.content
(#set! injection.language "lua")) (#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)))