feat: add Hurl

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
Co-authored-by: Pham Huy Hoang <hoangtun0810@gmail.com>

---------

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
Co-authored-by: Pham Huy Hoang <hoangtun0810@gmail.com>
This commit is contained in:
Jacob Pfeifer 2023-07-11 02:18:26 -04:00 committed by GitHub
parent 330da0ff07
commit d186a9e95a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 186 additions and 0 deletions

View file

@ -236,6 +236,9 @@
"http": {
"revision": "6824a247d1326079aab4fa9f9164e9319678081d"
},
"hurl": {
"revision": "0eca909c8338364992e04c4862ac6afc5342cbb8"
},
"ini": {
"revision": "1a0ce072ebf3afac7d5603d9a95bb7c9a6709b44"
},

View file

@ -737,6 +737,14 @@ list.http = {
maintainers = { "@amaanq" },
}
list.hurl = {
install_info = {
url = "https://github.com/pfeiferj/tree-sitter-hurl",
files = { "src/parser.c" },
},
maintainers = { "@pfeiferj" },
}
list.ini = {
install_info = {
url = "https://github.com/justinmk/tree-sitter-ini",

20
queries/hurl/folds.scm Normal file
View file

@ -0,0 +1,20 @@
; fold.scm
[
(comment)
(entry)
(request)
(response)
(header)
(request_section)
(body)
(response_section)
(multipart_form_data_section)
(cookies_section)
(captures_section)
(asserts_section)
(options_section)
(basic_auth_section)
(json_object)
(json_array)
] @fold

133
queries/hurl/highlights.scm Normal file
View file

@ -0,0 +1,133 @@
; highlights.scm
[
"[QueryStringParams]"
"[FormParams]"
"[MultipartFormData]"
"[Cookies]"
"[Captures]"
"[Asserts]"
"[Options]"
"[BasicAuth]"
(key_string)
(json_key_string)
] @property
[
"\\"
(regex_escaped_char)
(quoted_string_escaped_char)
(key_string_escaped_char)
(value_string_escaped_char)
(oneline_string_escaped_char)
(multiline_string_escaped_char)
(filename_escaped_char)
(json_string_escaped_char)
] @string.escape
[
"status"
"url"
"header"
"cookie"
"body"
"xpath"
"jsonpath"
"regex"
"variable"
"duration"
"sha256"
"md5"
"bytes"
] @function.builtin
[
"null"
"cacert"
"compressed"
"location"
"insecure"
"path-as-is"
"proxy"
"max-redirs"
"retry"
"retry-interval"
"retry-max-count"
(variable_option "variable")
"verbose"
"very-verbose"
] @constant.builtin
(boolean) @boolean
(variable_name) @variable
[
"not"
"equals"
"notEquals"
"greaterThan"
"greaterThanOrEquals"
"lessThan"
"lessThanOrEquals"
"startsWith"
"endsWith"
"contains"
"matches"
"exists"
"includes"
"isInteger"
"isFloat"
"isBoolean"
"isString"
"isCollection"
] @keyword.operator
[
"=="
"!="
">"
">="
"<"
"<="
] @operator
[
(integer)
(status)
] @number
[
(float)
(json_number)
] @float
[ ":" "," ] @punctuation.delimiter
[ "[" "]" "{" "}" "{{" "}}" ] @punctuation.bracket
[
(value_string)
(quoted_string)
(json_string)
] @string
[
"base64,"
"file,"
"hex,"
(file_value)
(version)
] @string.special
(regex) @string.regex
(multiline_string_type) @type
(comment) @comment @spell
(filter) @attribute
(method) @type.builtin

14
queries/hurl/indents.scm Normal file
View file

@ -0,0 +1,14 @@
; indents.scm
[
(json_object)
(json_array)
] @indent.begin
[
"}"
"]"
] @indent.branch
(xml_tag) @indent.begin
(xml_close_tag) @indent.branch

View file

@ -0,0 +1,7 @@
; injections.scm
(json_value) @json
(xml) @html
(multiline_string
(multiline_string_type) @language
(multiline_string_content) @content)

View file

@ -6,6 +6,7 @@ vim.filetype.add {
extension = {
conf = "hocon",
cmm = "t32",
hurl = "hurl",
ncl = "nickel",
tig = "tiger",
usd = "usd",