summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Pfeifer <jacob@pfeifer.dev>2023-07-11 02:18:26 -0400
committerGitHub <noreply@github.com>2023-07-11 02:18:26 -0400
commitd186a9e95a478fa60e1bef86790c8787e7440d0e (patch)
treecd384c0bc77c22ec0c918b50c2781d4715819596
parentci: bump actions to latest (diff)
downloadnvim-treesitter-d186a9e95a478fa60e1bef86790c8787e7440d0e.tar
nvim-treesitter-d186a9e95a478fa60e1bef86790c8787e7440d0e.tar.gz
nvim-treesitter-d186a9e95a478fa60e1bef86790c8787e7440d0e.tar.bz2
nvim-treesitter-d186a9e95a478fa60e1bef86790c8787e7440d0e.tar.lz
nvim-treesitter-d186a9e95a478fa60e1bef86790c8787e7440d0e.tar.xz
nvim-treesitter-d186a9e95a478fa60e1bef86790c8787e7440d0e.tar.zst
nvim-treesitter-d186a9e95a478fa60e1bef86790c8787e7440d0e.zip
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>
-rw-r--r--lockfile.json3
-rw-r--r--lua/nvim-treesitter/parsers.lua8
-rw-r--r--queries/hurl/folds.scm20
-rw-r--r--queries/hurl/highlights.scm133
-rw-r--r--queries/hurl/indents.scm14
-rw-r--r--queries/hurl/injections.scm7
-rw-r--r--scripts/minimal_init.lua1
7 files changed, 186 insertions, 0 deletions
diff --git a/lockfile.json b/lockfile.json
index 00dca9132..48265531e 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -236,6 +236,9 @@
"http": {
"revision": "6824a247d1326079aab4fa9f9164e9319678081d"
},
+ "hurl": {
+ "revision": "0eca909c8338364992e04c4862ac6afc5342cbb8"
+ },
"ini": {
"revision": "1a0ce072ebf3afac7d5603d9a95bb7c9a6709b44"
},
diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua
index ed8e5718d..a9e2f48c8 100644
--- a/lua/nvim-treesitter/parsers.lua
+++ b/lua/nvim-treesitter/parsers.lua
@@ -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",
diff --git a/queries/hurl/folds.scm b/queries/hurl/folds.scm
new file mode 100644
index 000000000..d7b8cd6cd
--- /dev/null
+++ b/queries/hurl/folds.scm
@@ -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
diff --git a/queries/hurl/highlights.scm b/queries/hurl/highlights.scm
new file mode 100644
index 000000000..a32f1965b
--- /dev/null
+++ b/queries/hurl/highlights.scm
@@ -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
+
diff --git a/queries/hurl/indents.scm b/queries/hurl/indents.scm
new file mode 100644
index 000000000..232cfc01a
--- /dev/null
+++ b/queries/hurl/indents.scm
@@ -0,0 +1,14 @@
+; indents.scm
+
+[
+ (json_object)
+ (json_array)
+] @indent.begin
+
+[
+ "}"
+ "]"
+] @indent.branch
+
+(xml_tag) @indent.begin
+(xml_close_tag) @indent.branch
diff --git a/queries/hurl/injections.scm b/queries/hurl/injections.scm
new file mode 100644
index 000000000..933633e03
--- /dev/null
+++ b/queries/hurl/injections.scm
@@ -0,0 +1,7 @@
+; injections.scm
+(json_value) @json
+(xml) @html
+
+(multiline_string
+ (multiline_string_type) @language
+ (multiline_string_content) @content)
diff --git a/scripts/minimal_init.lua b/scripts/minimal_init.lua
index e650a0dd8..f7a7ee590 100644
--- a/scripts/minimal_init.lua
+++ b/scripts/minimal_init.lua
@@ -6,6 +6,7 @@ vim.filetype.add {
extension = {
conf = "hocon",
cmm = "t32",
+ hurl = "hurl",
ncl = "nickel",
tig = "tiger",
usd = "usd",