on master help sign in
Add Hurl Support (#6450)
c22ebfeErasin Wang
book/src/generated/lang-support.md+1
@@ -59,6 +59,7 @@
59| heex | ✓ | ✓ | | `elixir-ls` |
59| heex | ✓ | ✓ | | `elixir-ls` |
60| hosts | ✓ | | | |
60| hosts | ✓ | | | |
61| html | ✓ | | | `vscode-html-language-server` |
61| html | ✓ | | | `vscode-html-language-server` |
62+| hurl | ✓ | | ✓ | |
62| idris | | | | `idris2-lsp` |
63| idris | | | | `idris2-lsp` |
63| iex | ✓ | | | |
64| iex | ✓ | | | |
64| ini | ✓ | | | |
65| ini | ✓ | | | |
languages.toml+14
@@ -2422,3 +2422,17 @@ language-server = { command = "nimlangserver" }
2422[[grammar]]
2422[[grammar]]
2423name = "nim"
2423name = "nim"
2424source = { git = "https://github.com/aMOPel/tree-sitter-nim", rev = "240239b232550e431d67de250d1b5856209e7f06" }
2424source = { git = "https://github.com/aMOPel/tree-sitter-nim", rev = "240239b232550e431d67de250d1b5856209e7f06" }
2425+
2426+[[language]]
2427+name = "hurl"
2428+scope = "source.hurl"
2429+injection-regex = "hurl"
2430+file-types = ["hurl"]
2431+roots = []
2432+comment-token = "#"
2433+indent = { tab-width = 2, unit = " " }
2434+
2435+[[grammar]]
2436+name = "hurl"
2437+source = { git = "https://github.com/pfeiferj/tree-sitter-hurl", rev = "264c42064b61ee21abe88d0061f29a0523352e22" }
2438+
runtime/queries/hurl/highlights.scmnew file+127
@@ -0,0 +1,127 @@
1+[
2+ "[QueryStringParams]"
3+ "[FormParams]"
4+ "[MultipartFormData]"
5+ "[Cookies]"
6+ "[Captures]"
7+ "[Asserts]"
8+ "[Options]"
9+ "[BasicAuth]"
10+] @attribute
11+
12+(comment) @comment
13+
14+[
15+ (key_string)
16+ (json_key_string)
17+] @variable.other.member
18+
19+(value_string) @string
20+(quoted_string) @string
21+(json_string) @string
22+(file_value) @string.special.path
23+(regex) @string.regex
24+
25+[
26+ "\\"
27+ (regex_escaped_char)
28+ (quoted_string_escaped_char)
29+ (key_string_escaped_char)
30+ (value_string_escaped_char)
31+ (oneline_string_escaped_char)
32+ (multiline_string_escaped_char)
33+ (filename_escaped_char)
34+ (json_string_escaped_char)
35+] @constant.character.escape
36+
37+(method) @type.builtin
38+(multiline_string_type) @type
39+
40+[
41+ "status"
42+ "url"
43+ "header"
44+ "cookie"
45+ "body"
46+ "xpath"
47+ "jsonpath"
48+ "regex"
49+ "variable"
50+ "duration"
51+ "sha256"
52+ "md5"
53+ "bytes"
54+] @function.builtin
55+
56+(filter) @attribute
57+
58+(version) @string.special
59+[
60+ "null"
61+ "cacert"
62+ "location"
63+ "insecure"
64+ "max-redirs"
65+ "retry"
66+ "retry-interval"
67+ "retry-max-count"
68+ (variable_option "variable")
69+ "verbose"
70+ "very-verbose"
71+] @constant.builtin
72+
73+(boolean) @constant.builtin.boolean
74+
75+(variable_name) @variable
76+
77+[
78+ "not"
79+ "equals"
80+ "=="
81+ "notEquals"
82+ "!="
83+ "greaterThan"
84+ ">"
85+ "greaterThanOrEquals"
86+ ">="
87+ "lessThan"
88+ "<"
89+ "lessThanOrEquals"
90+ "<="
91+ "startsWith"
92+ "endsWith"
93+ "contains"
94+ "matches"
95+ "exists"
96+ "includes"
97+ "isInteger"
98+ "isFloat"
99+ "isBoolean"
100+ "isString"
101+ "isCollection"
102+] @keyword.operator
103+
104+(integer) @constant.numeric.integer
105+(float) @constant.numeric.float
106+(status) @constant.numeric
107+(json_number) @constant.numeric.float
108+
109+[
110+ ":"
111+ ","
112+] @punctuation.delimiter
113+
114+[
115+ "["
116+ "]"
117+ "{"
118+ "}"
119+ "{{"
120+ "}}"
121+] @punctuation.special
122+
123+[
124+ "base64,"
125+ "file,"
126+ "hex,"
127+] @string.special
runtime/queries/hurl/indents.scmnew file+11
@@ -0,0 +1,11 @@
1+[
2+ (json_object)
3+ (json_array)
4+ (xml_tag)
5+] @indent
6+
7+[
8+ "}"
9+ "]"
10+ (xml_close_tag)
11+] @outdent
runtime/queries/hurl/injections.scmnew file+14
@@ -0,0 +1,14 @@
1+((comment) @injection.content
2+ (#set! injection.language "comment"))
3+
4+((json_value) @injection.content
5+ (#set! injection.language "json"))
6+
7+((xml) @injection.content
8+ (#set! injection.language "xml"))
9+
10+((multiline_string
11+ (multiline_string_type) @injection.language
12+ (multiline_string_content) @injection.content)
13+ (#set! injection.include-children)
14+ (#set! injection.combined))