aboutsummaryrefslogtreecommitdiff
path: root/queries
diff options
context:
space:
mode:
Diffstat (limited to 'queries')
-rw-r--r--queries/bash.scm56
-rw-r--r--queries/c.scm81
-rw-r--r--queries/cpp.scm74
-rw-r--r--queries/css.scm76
-rw-r--r--queries/dockerfile.scm56
-rw-r--r--queries/go.scm148
-rw-r--r--queries/html.scm13
-rw-r--r--queries/javascript.scm36
-rw-r--r--queries/lua.scm172
-rw-r--r--queries/markdown.scm47
-rw-r--r--queries/php.scm136
-rw-r--r--queries/python.scm137
-rw-r--r--queries/sql.scm440
-rw-r--r--queries/tsx.scm76
-rw-r--r--queries/typescript.scm71
15 files changed, 1619 insertions, 0 deletions
diff --git a/queries/bash.scm b/queries/bash.scm
new file mode 100644
index 0000000..ad9a404
--- /dev/null
+++ b/queries/bash.scm
@@ -0,0 +1,56 @@
1[
2 (string)
3 (raw_string)
4 (heredoc_body)
5 (heredoc_start)
6] @string
7
8(command_name) @function
9
10(variable_name) @property
11
12[
13 "case"
14 "do"
15 "done"
16 "elif"
17 "else"
18 "esac"
19 "export"
20 "fi"
21 "for"
22 "function"
23 "if"
24 "in"
25 "select"
26 "then"
27 "unset"
28 "until"
29 "while"
30] @keyword
31
32(comment) @comment
33
34(function_definition name: (word) @function)
35
36(file_descriptor) @number
37
38[
39 (command_substitution)
40 (process_substitution)
41 (expansion)
42]@embedded
43
44[
45 "$"
46 "&&"
47 ">"
48 ">>"
49 "<"
50 "|"
51] @operator
52
53(
54 (command (_) @constant)
55 (#match? @constant "^-")
56) \ No newline at end of file
diff --git a/queries/c.scm b/queries/c.scm
new file mode 100644
index 0000000..c04efe1
--- /dev/null
+++ b/queries/c.scm
@@ -0,0 +1,81 @@
1(identifier) @variable
2
3((identifier) @constant
4 (#match? @constant "^[A-Z][A-Z\\d_]*$"))
5
6"break" @keyword
7"case" @keyword
8"const" @keyword
9"continue" @keyword
10"default" @keyword
11"do" @keyword
12"else" @keyword
13"enum" @keyword
14"extern" @keyword
15"for" @keyword
16"if" @keyword
17"inline" @keyword
18"return" @keyword
19"sizeof" @keyword
20"static" @keyword
21"struct" @keyword
22"switch" @keyword
23"typedef" @keyword
24"union" @keyword
25"volatile" @keyword
26"while" @keyword
27
28"#define" @keyword
29"#elif" @keyword
30"#else" @keyword
31"#endif" @keyword
32"#if" @keyword
33"#ifdef" @keyword
34"#ifndef" @keyword
35"#include" @keyword
36(preproc_directive) @keyword
37
38"--" @operator
39"-" @operator
40"-=" @operator
41"->" @operator
42"=" @operator
43"!=" @operator
44"*" @operator
45"&" @operator
46"&&" @operator
47"+" @operator
48"++" @operator
49"+=" @operator
50"<" @operator
51"==" @operator
52">" @operator
53"||" @operator
54
55"." @delimiter
56";" @delimiter
57
58(string_literal) @string
59(system_lib_string) @string
60
61(null) @constant
62(number_literal) @number
63(char_literal) @number
64
65(field_identifier) @property
66(statement_identifier) @label
67(type_identifier) @type
68(primitive_type) @type
69(sized_type_specifier) @type
70
71(call_expression
72 function: (identifier) @function)
73(call_expression
74 function: (field_expression
75 field: (field_identifier) @function))
76(function_declarator
77 declarator: (identifier) @function)
78(preproc_function_def
79 name: (identifier) @function.special)
80
81(comment) @comment \ No newline at end of file
diff --git a/queries/cpp.scm b/queries/cpp.scm
new file mode 100644
index 0000000..fedc40a
--- /dev/null
+++ b/queries/cpp.scm
@@ -0,0 +1,74 @@
1; Inherit C queries
2(function_declarator (identifier) @function)
3(call_expression (identifier) @function)
4(parameter_declaration (primitive_type) @type)
5(parameter_declaration (identifier) @variable)
6(declaration (primitive_type) @type)
7(declaration (identifier) @variable)
8(string_literal) @string
9(number_literal) @number
10(char_literal) @string
11(comment) @comment
12(field_identifier) @property
13((identifier) @boolean (#eq? @boolean "true"))
14((identifier) @boolean (#eq? @boolean "false"))
15(null) @null
16((identifier) @keyword (#match? @keyword "^(static_cast|dynamic_cast|const_cast|reinterpret_cast|friend|inline|decltype|explicit|export|mutable|asm|auto|bool|nullptr)$"))
17
18; C++ specific
19(template_declaration) @type
20(virtual) @keyword
21(this) @keyword
22(class_specifier name: (type_identifier) @type)
23(namespace_definition name: (namespace_identifier) @type)
24(using_declaration (qualified_identifier) @type)
25(destructor_name) @function
26(function_declarator (field_identifier) @function)
27(function_definition declarator: (function_declarator declarator: (field_identifier) @function))
28
29[
30 "return"
31 "if"
32 "else"
33 "for"
34 "while"
35 "do"
36 "switch"
37 "case"
38 "default"
39 "break"
40 "continue"
41 "struct"
42 "enum"
43 "union"
44 "typedef"
45 "extern"
46 "static"
47 "const"
48 "signed"
49 "unsigned"
50 "volatile"
51
52 ; C++ keywords
53 "new"
54 "delete"
55 "operator"
56 "throw"
57 "try"
58 "catch"
59 "class"
60 "constexpr"
61 "template"
62 "typename"
63 "using"
64 "namespace"
65 "public"
66 "private"
67 "protected"
68
69 "#include"
70 "#define"
71 "#ifdef"
72 "#ifndef"
73 "#endif"
74] @keyword \ No newline at end of file
diff --git a/queries/css.scm b/queries/css.scm
new file mode 100644
index 0000000..96ab1c3
--- /dev/null
+++ b/queries/css.scm
@@ -0,0 +1,76 @@
1(comment) @comment
2
3(tag_name) @tag
4(nesting_selector) @tag
5(universal_selector) @tag
6
7"~" @operator
8">" @operator
9"+" @operator
10"-" @operator
11"*" @operator
12"/" @operator
13"=" @operator
14"^=" @operator
15"|=" @operator
16"~=" @operator
17"$=" @operator
18"*=" @operator
19
20"and" @operator
21"or" @operator
22"not" @operator
23"only" @operator
24
25(attribute_selector (plain_value) @string)
26
27((property_name) @variable
28 (#match? @variable "^--"))
29((plain_value) @variable
30 (#match? @variable "^--"))
31
32(class_name) @property
33(id_name) @property
34(namespace_name) @property
35(property_name) @property
36(feature_name) @property
37
38(pseudo_element_selector (tag_name) @attribute)
39(pseudo_class_selector (class_name) @attribute)
40(attribute_name) @attribute
41
42(function_name) @function
43
44"@media" @keyword
45"@import" @keyword
46"@charset" @keyword
47"@namespace" @keyword
48"@supports" @keyword
49"@keyframes" @keyword
50(at_keyword) @keyword
51(to) @keyword
52(from) @keyword
53(important) @keyword
54
55(string_value) @string
56(color_value) @string.special
57
58(integer_value) @number
59(float_value) @number
60(unit) @type
61
62[
63 "#"
64 ","
65 "."
66 ":"
67 "::"
68 ";"
69] @punctuation.delimiter
70
71[
72 "{"
73 ")"
74 "("
75 "}"
76] @punctuation.bracket \ No newline at end of file
diff --git a/queries/dockerfile.scm b/queries/dockerfile.scm
new file mode 100644
index 0000000..7f9dc83
--- /dev/null
+++ b/queries/dockerfile.scm
@@ -0,0 +1,56 @@
1[
2 "FROM"
3 "AS"
4 "RUN"
5 "CMD"
6 "LABEL"
7 "EXPOSE"
8 "ENV"
9 "ADD"
10 "COPY"
11 "ENTRYPOINT"
12 "VOLUME"
13 "USER"
14 "WORKDIR"
15 "ARG"
16 "ONBUILD"
17 "STOPSIGNAL"
18 "HEALTHCHECK"
19 "SHELL"
20 "MAINTAINER"
21 "CROSS_BUILD"
22 (heredoc_marker)
23 (heredoc_end)
24] @keyword
25
26[
27 ":"
28 "@"
29] @operator
30
31(comment) @comment
32
33
34(image_spec
35 (image_tag
36 ":" @punctuation.special)
37 (image_digest
38 "@" @punctuation.special))
39
40[
41 (double_quoted_string)
42 (single_quoted_string)
43 (json_string)
44 (heredoc_line)
45] @string
46
47(expansion
48 [
49 "$"
50 "{"
51 "}"
52 ] @punctuation.special
53) @none
54
55((variable) @constant
56 (#match? @constant "^[A-Z][A-Z_0-9]*$")) \ No newline at end of file
diff --git a/queries/go.scm b/queries/go.scm
new file mode 100644
index 0000000..99e1ca1
--- /dev/null
+++ b/queries/go.scm
@@ -0,0 +1,148 @@
1; Function calls
2
3(call_expression
4 function: (identifier) @function)
5
6(call_expression
7 function: (identifier) @function.builtin
8 (#match? @function.builtin "^(append|cap|close|complex|copy|delete|imag|len|make|new|panic|print|println|real|recover)$"))
9
10(call_expression
11 function: (selector_expression
12 field: (field_identifier) @function.method))
13
14; Function definitions
15
16(function_declaration
17 name: (identifier) @function)
18
19(method_declaration
20 name: (field_identifier) @function.method)
21
22; Identifiers
23
24(type_identifier) @type
25(field_identifier) @property
26(identifier) @variable
27
28; Operators
29
30[
31 "--"
32 "-"
33 "-="
34 ":="
35 "!"
36 "!="
37 "..."
38 "*"
39 "*"
40 "*="
41 "/"
42 "/="
43 "&"
44 "&&"
45 "&="
46 "%"
47 "%="
48 "^"
49 "^="
50 "+"
51 "++"
52 "+="
53 "<-"
54 "<"
55 "<<"
56 "<<="
57 "<="
58 "="
59 "=="
60 ">"
61 ">="
62 ">>"
63 ">>="
64 "|"
65 "|="
66 "||"
67 "~"
68] @operator
69
70; Keywords
71
72[
73 "break"
74 "case"
75 "chan"
76 "const"
77 "continue"
78 "default"
79 "defer"
80 "else"
81 "fallthrough"
82 "for"
83 "func"
84 "go"
85 "goto"
86 "if"
87 "import"
88 "interface"
89 "map"
90 "package"
91 "range"
92 "return"
93 "select"
94 "struct"
95 "switch"
96 "type"
97 "var"
98] @keyword
99
100; Literals
101
102[
103 (interpreted_string_literal)
104 (raw_string_literal)
105 (rune_literal)
106] @string
107
108(escape_sequence) @escape
109
110[
111 (int_literal)
112 (float_literal)
113 (imaginary_literal)
114] @number
115
116[
117 (true)
118 (false)
119 (nil)
120 (iota)
121] @constant.builtin
122
123(comment) @comment
124
125(call_expression
126 function: [
127 (identifier) @name
128 (parenthesized_expression (identifier) @name)
129 (selector_expression field: (field_identifier) @name)
130 (parenthesized_expression (selector_expression field: (field_identifier) @name))
131 ]) @reference.call
132
133(type_spec
134 name: (type_identifier) @name) @definition.type
135
136(type_identifier) @name @reference.type
137
138(package_clause "package" (package_identifier) @name)
139
140(type_declaration (type_spec name: (type_identifier) @name type: (interface_type)))
141
142(type_declaration (type_spec name: (type_identifier) @name type: (struct_type)))
143
144(import_declaration (import_spec) @name)
145
146(var_declaration (var_spec name: (identifier) @name))
147
148(const_declaration (const_spec name: (identifier) @name)) \ No newline at end of file
diff --git a/queries/html.scm b/queries/html.scm
new file mode 100644
index 0000000..ab1399a
--- /dev/null
+++ b/queries/html.scm
@@ -0,0 +1,13 @@
1(tag_name) @tag
2(erroneous_end_tag_name) @tag.error
3(doctype) @constant
4(attribute_name) @attribute
5(attribute_value) @string
6(comment) @comment
7
8[
9 "<"
10 ">"
11 "</"
12 "/>"
13] @punctuation.bracket \ No newline at end of file
diff --git a/queries/javascript.scm b/queries/javascript.scm
new file mode 100644
index 0000000..f58999b
--- /dev/null
+++ b/queries/javascript.scm
@@ -0,0 +1,36 @@
1(function_declaration name: (identifier) @function)
2(method_definition name: (property_identifier) @function)
3(call_expression function: (identifier) @function)
4(call_expression function: (member_expression property: (property_identifier) @function))
5(string) @string
6(number) @number
7(comment) @comment
8[
9 "function"
10 "return"
11 "if"
12 "else"
13 "for"
14 "while"
15 "do"
16 "switch"
17 "case"
18 "default"
19 "break"
20 "continue"
21 "var"
22 "let"
23 "const"
24 "try"
25 "catch"
26 "finally"
27 "class"
28 "extends"
29 "import"
30 "export"
31 "default"
32 "from"
33 "async"
34 "await"
35 "new"
36] @keyword
diff --git a/queries/lua.scm b/queries/lua.scm
new file mode 100644
index 0000000..f5c042c
--- /dev/null
+++ b/queries/lua.scm
@@ -0,0 +1,172 @@
1;;; Highlighting for lua
2
3;;; Builtins
4;; Keywords
5
6[(if_start)
7 (if_then)
8 (if_elseif)
9 (if_else)
10 (if_end)] @keyword.conditional
11
12[(for_start)
13 (for_in)
14 (for_do)
15 (for_end)] @keyword.repeat
16
17[(while_start)
18 (while_do)
19 (while_end)] @keyword.repeat
20
21[(repeat_start)
22 (repeat_until)] @keyword.repeat
23
24(break_statement) @keyword.repeat
25
26[(return_statement)
27 (module_return_statement)] @keyword.return
28
29[(do_start)
30 (do_end)] @keyword
31
32; [
33; "goto"
34; ] @keyword
35
36;; Operators
37
38; TODO: I think I've made a bunch of these nodes.
39; we might be able to just use those!
40
41[
42 "not"
43 "and"
44 "or"] @keyword.operator
45
46["="
47 "~="
48 "=="
49 "<="
50 ">="
51 "<"
52 ">"
53 "+"
54 "-"
55 "%"
56 "/"
57 "//"
58 "*"
59 "^"
60 "&"
61 "~"
62 "|"
63 ">>"
64 "<<"
65 ".."
66 "#"] @operator
67
68
69
70;; Punctuation
71["," "."] @punctuation.delimiter
72
73;; Brackets
74[(left_paren)
75 (right_paren)
76 "["
77 "]"
78 "{"
79 "}"] @punctuation.bracket
80
81;; Variables
82(identifier) @variable
83(
84 (identifier) @variable.builtin
85 (#match? @variable.builtin "self"))
86
87; (preproc_call
88; directive: (preproc_directive) @_u
89; argument: (_) @constant
90; (#eq? @_u "#undef"))
91
92;; Constants
93(boolean) @boolean
94(nil) @constant.builtin
95(ellipsis) @constant ;; "..."
96(local) @keyword
97
98;; Functions
99(function_call_paren) @function.bracket
100
101[
102 (function_start)
103 (function_end)] @keyword.function
104
105(emmy_type) @type
106(emmy_literal) @string
107(emmy_parameter
108 (identifier) @parameter
109 description: (_)? @comment) @comment
110
111(emmy_class) @comment
112(emmy_field name: (_) @property) @comment
113(emmy_function_parameter
114 name: (_) @parameter)
115
116(emmy_type_dictionary_value key: (identifier) @property)
117
118(emmy_note) @comment
119(emmy_see) @comment
120
121; TODO: Make the container so we can still highlight the beginning of the line
122; (emmy_eval_container) @comment
123; (_emmy_eval_container) @comment
124
125(emmy_return) @comment
126
127; TODO: returns
128
129(emmy_header) @comment
130(emmy_ignore) @comment
131(documentation_brief) @comment
132
133(documentation_command) @comment
134
135(function_call
136 [
137 ((identifier)+ @identifier . (identifier) @function.call . (function_call_paren))
138 ((identifier) @function.call.lua . (function_call_paren))])
139
140(function_call
141 prefix: (identifier) @function.call.lua
142 args: (string_argument) @string)
143
144(function_call
145 prefix: (identifier) @function.call.lua
146 args: (table_argument))
147
148; (function [(function_name) (identifier)] @function)
149; (function ["function" "end"] @keyword.function)
150; (local_function [(function_name) (identifier)] @function)
151; (local_function ["function" "end"] @keyword.function)
152; (function_definition ["function" "end"] @keyword.function)
153
154; TODO: Do I have replacements for these.
155; (property_identifier) @property
156; (method) @method
157
158; (function_call (identifier) @function . (arguments))
159; (function_call (field (property_identifier) @function) . (arguments))
160
161;; Parameters
162; (parameters (identifier) @parameter)
163
164;; Nodes
165; (table ["{" "}"] @constructor)
166(comment) @comment
167(string) @string
168(number) @number
169; (label_statement) @label
170
171;; Error
172(ERROR) @error \ No newline at end of file
diff --git a/queries/markdown.scm b/queries/markdown.scm
new file mode 100644
index 0000000..1326e23
--- /dev/null
+++ b/queries/markdown.scm
@@ -0,0 +1,47 @@
1;From nvim-treesitter/nvim-treesitter
2(atx_heading
3 (inline) @text.title)
4
5(setext_heading
6 (paragraph) @text.title)
7
8[
9 (atx_h1_marker)
10 (atx_h2_marker)
11 (atx_h3_marker)
12 (atx_h4_marker)
13 (atx_h5_marker)
14 (atx_h6_marker)
15 (setext_h1_underline)
16 (setext_h2_underline)
17] @punctuation.special
18
19[
20 (link_title)
21 (indented_code_block)
22 (fenced_code_block)
23] @text.literal
24
25(fenced_code_block_delimiter) @punctuation.delimiter
26
27(code_fence_content) @none
28
29(link_destination) @text.uri
30
31(link_label) @text.reference
32
33[
34 (list_marker_plus)
35 (list_marker_minus)
36 (list_marker_star)
37 (list_marker_dot)
38 (list_marker_parenthesis)
39 (thematic_break)
40] @punctuation.special
41
42[
43 (block_continuation)
44 (block_quote_marker)
45] @punctuation.special
46
47(backslash_escape) @string.escape \ No newline at end of file
diff --git a/queries/php.scm b/queries/php.scm
new file mode 100644
index 0000000..fc2a5f6
--- /dev/null
+++ b/queries/php.scm
@@ -0,0 +1,136 @@
1; Keywords
2
3[
4 "and"
5 "as"
6 "break"
7 "case"
8 "catch"
9 "class"
10 "clone"
11 "const"
12 "continue"
13 "declare"
14 "default"
15 "do"
16 "echo"
17 "else"
18 "elseif"
19 "enddeclare"
20 "endfor"
21 "endforeach"
22 "endif"
23 "endswitch"
24 "endwhile"
25 "enum"
26 "exit"
27 "extends"
28 "finally"
29 "fn"
30 "for"
31 "foreach"
32 "function"
33 "global"
34 "goto"
35 "if"
36 "implements"
37 "include"
38 "include_once"
39 "instanceof"
40 "insteadof"
41 "interface"
42 "match"
43 "namespace"
44 "new"
45 "or"
46 "print"
47 "require"
48 "require_once"
49 "return"
50 "switch"
51 "throw"
52 "trait"
53 "try"
54 "use"
55 "while"
56 "xor"
57 (abstract_modifier)
58 (final_modifier)
59 (readonly_modifier)
60 (static_modifier)
61 (visibility_modifier)
62] @keyword
63
64(function_static_declaration "static" @keyword)
65
66; Namespace
67
68(namespace_definition
69 name: (namespace_name
70 (name) @module))
71
72(namespace_name
73 (name) @module)
74
75; Variables
76
77(relative_scope) @variable.builtin
78
79(variable_name) @variable
80
81(method_declaration name: (name) @constructor
82 (#eq? @constructor "__construct"))
83
84((name) @constant
85 (#match? @constant "^_?[A-Z][A-Z\\d_]+$"))
86((name) @constant.builtin
87 (#match? @constant.builtin "^__[A-Z][A-Z\d_]+__$"))
88(const_declaration (const_element (name) @constant))
89
90; Functions
91
92(array_creation_expression "array" @function.builtin)
93(list_literal "list" @function.builtin)
94(exit_statement "exit" @function.builtin "(")
95
96(method_declaration
97 name: (name) @function.method)
98
99(scoped_call_expression
100 name: (name) @function)
101
102(member_call_expression
103 name: (name) @function.method)
104
105(function_definition
106 name: (name) @function)
107
108; Member
109
110(property_element
111 (variable_name) @property)
112
113(member_access_expression
114 name: (variable_name (name)) @property)
115(member_access_expression
116 name: (name) @property)
117
118; Basic tokens
119[
120 (string)
121 (string_content)
122 (encapsed_string)
123 (heredoc)
124 (heredoc_body)
125 (nowdoc_body)
126] @string
127(boolean) @constant.builtin
128(null) @constant.builtin
129(integer) @number
130(float) @number
131(comment) @comment
132
133((name) @variable.builtin
134 (#eq? @variable.builtin "this"))
135
136"$" @operator \ No newline at end of file
diff --git a/queries/python.scm b/queries/python.scm
new file mode 100644
index 0000000..94f28c5
--- /dev/null
+++ b/queries/python.scm
@@ -0,0 +1,137 @@
1; Identifier naming conventions
2
3(identifier) @variable
4
5((identifier) @constructor
6 (#match? @constructor "^[A-Z]"))
7
8((identifier) @constant
9 (#match? @constant "^[A-Z][A-Z_]*$"))
10
11; Function calls
12
13(decorator) @function
14(decorator
15 (identifier) @function)
16
17(call
18 function: (attribute attribute: (identifier) @function.method))
19(call
20 function: (identifier) @function)
21
22; Builtin functions
23
24((call
25 function: (identifier) @function.builtin)
26 (#match?
27 @function.builtin
28 "^(abs|all|any|ascii|bin|bool|breakpoint|bytearray|bytes|callable|chr|classmethod|compile|complex|delattr|dict|dir|divmod|enumerate|eval|exec|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|isinstance|issubclass|iter|len|list|locals|map|max|memoryview|min|next|object|oct|open|ord|pow|print|property|range|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|vars|zip|__import__)$"))
29
30; Function definitions
31
32(function_definition
33 name: (identifier) @function)
34
35(attribute attribute: (identifier) @property)
36(type (identifier) @type)
37
38; Literals
39
40[
41 (none)
42 (true)
43 (false)
44] @constant.builtin
45
46[
47 (integer)
48 (float)
49] @number
50
51(comment) @comment
52(string) @string
53(escape_sequence) @escape
54
55(interpolation
56 "{" @punctuation.special
57 "}" @punctuation.special) @embedded
58
59[
60 "-"
61 "-="
62 "!="
63 "*"
64 "**"
65 "**="
66 "*="
67 "/"
68 "//"
69 "//="
70 "/="
71 "&"
72 "&="
73 "%"
74 "%="
75 "^"
76 "^="
77 "+"
78 "->"
79 "+="
80 "<"
81 "<<"
82 "<<="
83 "<="
84 "<>"
85 "="
86 ":="
87 "=="
88 ">"
89 ">="
90 ">>"
91 ">>="
92 "|"
93 "|="
94 "~"
95 "@="
96 "and"
97 "in"
98 "is"
99 "not"
100 "or"
101 "is not"
102 "not in"
103] @operator
104
105[
106 "as"
107 "assert"
108 "async"
109 "await"
110 "break"
111 "class"
112 "continue"
113 "def"
114 "del"
115 "elif"
116 "else"
117 "except"
118 "exec"
119 "finally"
120 "for"
121 "from"
122 "global"
123 "if"
124 "import"
125 "lambda"
126 "nonlocal"
127 "pass"
128 "print"
129 "raise"
130 "return"
131 "try"
132 "while"
133 "with"
134 "yield"
135 "match"
136 "case"
137] @keyword \ No newline at end of file
diff --git a/queries/sql.scm b/queries/sql.scm
new file mode 100644
index 0000000..d3d6213
--- /dev/null
+++ b/queries/sql.scm
@@ -0,0 +1,440 @@
1(object_reference
2 name: (identifier) @type)
3
4(invocation
5 (object_reference
6 name: (identifier) @function.call))
7
8[
9 (keyword_gist)
10 (keyword_btree)
11 (keyword_hash)
12 (keyword_spgist)
13 (keyword_gin)
14 (keyword_brin)
15 (keyword_array)
16] @function.call
17
18(relation
19 alias: (identifier) @variable)
20
21(field
22 name: (identifier) @field)
23
24(term
25 alias: (identifier) @variable)
26
27((term
28 value: (cast
29 name: (keyword_cast) @function.call
30 parameter: [(literal)]?)))
31
32(literal) @string
33(comment) @comment @spell
34(marginalia) @comment
35
36((literal) @number
37 (#match? @number "^[-+]?%d+$"))
38
39((literal) @float
40 (#match? @float "^[-+]?%d*\.%d*$"))
41
42(parameter) @parameter
43
44[
45 (keyword_true)
46 (keyword_false)
47] @boolean
48
49[
50 (keyword_asc)
51 (keyword_desc)
52 (keyword_terminated)
53 (keyword_escaped)
54 (keyword_unsigned)
55 (keyword_nulls)
56 (keyword_last)
57 (keyword_delimited)
58 (keyword_replication)
59 (keyword_auto_increment)
60 (keyword_default)
61 (keyword_collate)
62 (keyword_concurrently)
63 (keyword_engine)
64 (keyword_always)
65 (keyword_generated)
66 (keyword_preceding)
67 (keyword_following)
68 (keyword_first)
69 (keyword_current_timestamp)
70 (keyword_immutable)
71 (keyword_atomic)
72 (keyword_parallel)
73 (keyword_leakproof)
74 (keyword_safe)
75 (keyword_cost)
76 (keyword_strict)
77] @attribute
78
79[
80 (keyword_materialized)
81 (keyword_recursive)
82 (keyword_temp)
83 (keyword_temporary)
84 (keyword_unlogged)
85 (keyword_external)
86 (keyword_parquet)
87 (keyword_csv)
88 (keyword_rcfile)
89 (keyword_textfile)
90 (keyword_orc)
91 (keyword_avro)
92 (keyword_jsonfile)
93 (keyword_sequencefile)
94 (keyword_volatile)
95] @storageclass
96
97[
98 (keyword_case)
99 (keyword_when)
100 (keyword_then)
101 (keyword_else)
102] @conditional
103
104[
105 (keyword_select)
106 (keyword_from)
107 (keyword_where)
108 (keyword_index)
109 (keyword_join)
110 (keyword_primary)
111 (keyword_delete)
112 (keyword_create)
113 (keyword_insert)
114 (keyword_merge)
115 (keyword_distinct)
116 (keyword_replace)
117 (keyword_update)
118 (keyword_into)
119 (keyword_overwrite)
120 (keyword_matched)
121 (keyword_values)
122 (keyword_value)
123 (keyword_attribute)
124 (keyword_set)
125 (keyword_left)
126 (keyword_right)
127 (keyword_outer)
128 (keyword_inner)
129 (keyword_full)
130 (keyword_order)
131 (keyword_partition)
132 (keyword_group)
133 (keyword_with)
134 (keyword_without)
135 (keyword_as)
136 (keyword_having)
137 (keyword_limit)
138 (keyword_offset)
139 (keyword_table)
140 (keyword_tables)
141 (keyword_key)
142 (keyword_references)
143 (keyword_foreign)
144 (keyword_constraint)
145 (keyword_force)
146 (keyword_use)
147 (keyword_for)
148 (keyword_if)
149 (keyword_exists)
150 (keyword_column)
151 (keyword_columns)
152 (keyword_cross)
153 (keyword_lateral)
154 (keyword_natural)
155 (keyword_alter)
156 (keyword_drop)
157 (keyword_add)
158 (keyword_view)
159 (keyword_end)
160 (keyword_is)
161 (keyword_using)
162 (keyword_between)
163 (keyword_window)
164 (keyword_no)
165 (keyword_data)
166 (keyword_type)
167 (keyword_rename)
168 (keyword_to)
169 (keyword_schema)
170 (keyword_owner)
171 (keyword_authorization)
172 (keyword_all)
173 (keyword_any)
174 (keyword_some)
175 (keyword_returning)
176 (keyword_begin)
177 (keyword_commit)
178 (keyword_rollback)
179 (keyword_transaction)
180 (keyword_only)
181 (keyword_like)
182 (keyword_similar)
183 (keyword_over)
184 (keyword_change)
185 (keyword_modify)
186 (keyword_after)
187 (keyword_before)
188 (keyword_range)
189 (keyword_rows)
190 (keyword_groups)
191 (keyword_exclude)
192 (keyword_current)
193 (keyword_ties)
194 (keyword_others)
195 (keyword_zerofill)
196 (keyword_format)
197 (keyword_fields)
198 (keyword_row)
199 (keyword_sort)
200 (keyword_compute)
201 (keyword_comment)
202 (keyword_location)
203 (keyword_cached)
204 (keyword_uncached)
205 (keyword_lines)
206 (keyword_stored)
207 (keyword_virtual)
208 (keyword_partitioned)
209 (keyword_analyze)
210 (keyword_explain)
211 (keyword_verbose)
212 (keyword_truncate)
213 (keyword_rewrite)
214 (keyword_optimize)
215 (keyword_vacuum)
216 (keyword_cache)
217 (keyword_language)
218 (keyword_called)
219 (keyword_conflict)
220 (keyword_declare)
221 (keyword_filter)
222 (keyword_function)
223 (keyword_input)
224 (keyword_name)
225 (keyword_oid)
226 (keyword_oids)
227 (keyword_precision)
228 (keyword_regclass)
229 (keyword_regnamespace)
230 (keyword_regproc)
231 (keyword_regtype)
232 (keyword_restricted)
233 (keyword_return)
234 (keyword_returns)
235 (keyword_separator)
236 (keyword_setof)
237 (keyword_stable)
238 (keyword_support)
239 (keyword_tblproperties)
240 (keyword_trigger)
241 (keyword_unsafe)
242 (keyword_admin)
243 (keyword_connection)
244 (keyword_cycle)
245 (keyword_database)
246 (keyword_encrypted)
247 (keyword_increment)
248 (keyword_logged)
249 (keyword_none)
250 (keyword_owned)
251 (keyword_password)
252 (keyword_reset)
253 (keyword_role)
254 (keyword_sequence)
255 (keyword_start)
256 (keyword_restart)
257 (keyword_tablespace)
258 (keyword_until)
259 (keyword_user)
260 (keyword_valid)
261 (keyword_action)
262 (keyword_definer)
263 (keyword_invoker)
264 (keyword_security)
265 (keyword_extension)
266 (keyword_version)
267 (keyword_out)
268 (keyword_inout)
269 (keyword_variadic)
270 (keyword_session)
271 (keyword_isolation)
272 (keyword_level)
273 (keyword_serializable)
274 (keyword_repeatable)
275 (keyword_read)
276 (keyword_write)
277 (keyword_committed)
278 (keyword_uncommitted)
279 (keyword_deferrable)
280 (keyword_names)
281 (keyword_zone)
282 (keyword_immediate)
283 (keyword_deferred)
284 (keyword_constraints)
285 (keyword_snapshot)
286 (keyword_characteristics)
287 (keyword_off)
288 (keyword_follows)
289 (keyword_precedes)
290 (keyword_each)
291 (keyword_instead)
292 (keyword_of)
293 (keyword_initially)
294 (keyword_old)
295 (keyword_new)
296 (keyword_referencing)
297 (keyword_statement)
298 (keyword_execute)
299 (keyword_procedure)
300 (keyword_copy)
301 (keyword_delimiter)
302 (keyword_encoding)
303 (keyword_escape)
304 (keyword_force_not_null)
305 (keyword_force_null)
306 (keyword_force_quote)
307 (keyword_freeze)
308 (keyword_header)
309 (keyword_match)
310 (keyword_program)
311 (keyword_quote)
312 (keyword_stdin)
313 (keyword_extended)
314 (keyword_main)
315 (keyword_plain)
316 (keyword_storage)
317 (keyword_compression)
318] @keyword
319
320[
321 (keyword_restrict)
322 (keyword_unbounded)
323 (keyword_unique)
324 (keyword_cascade)
325 (keyword_delayed)
326 (keyword_high_priority)
327 (keyword_low_priority)
328 (keyword_ignore)
329 (keyword_nothing)
330 (keyword_check)
331 (keyword_option)
332 (keyword_local)
333 (keyword_cascaded)
334 (keyword_wait)
335 (keyword_nowait)
336 (keyword_metadata)
337 (keyword_incremental)
338 (keyword_bin_pack)
339 (keyword_noscan)
340 (keyword_stats)
341 (keyword_statistics)
342 (keyword_maxvalue)
343 (keyword_minvalue)
344] @type.qualifier
345
346[
347 (keyword_int)
348 (keyword_null)
349 (keyword_boolean)
350 (keyword_binary)
351 (keyword_varbinary)
352 (keyword_image)
353 (keyword_bit)
354 (keyword_inet)
355 (keyword_character)
356 (keyword_smallserial)
357 (keyword_serial)
358 (keyword_bigserial)
359 (keyword_smallint)
360 (keyword_mediumint)
361 (keyword_bigint)
362 (keyword_tinyint)
363 (keyword_decimal)
364 (keyword_float)
365 (keyword_double)
366 (keyword_numeric)
367 (keyword_real)
368 (double)
369 (keyword_money)
370 (keyword_smallmoney)
371 (keyword_char)
372 (keyword_nchar)
373 (keyword_varchar)
374 (keyword_nvarchar)
375 (keyword_varying)
376 (keyword_text)
377 (keyword_string)
378 (keyword_uuid)
379 (keyword_json)
380 (keyword_jsonb)
381 (keyword_xml)
382 (keyword_bytea)
383 (keyword_enum)
384 (keyword_date)
385 (keyword_datetime)
386 (keyword_time)
387 (keyword_datetime2)
388 (keyword_datetimeoffset)
389 (keyword_smalldatetime)
390 (keyword_timestamp)
391 (keyword_timestamptz)
392 (keyword_geometry)
393 (keyword_geography)
394 (keyword_box2d)
395 (keyword_box3d)
396 (keyword_interval)
397] @type.builtin
398
399[
400 (keyword_in)
401 (keyword_and)
402 (keyword_or)
403 (keyword_not)
404 (keyword_by)
405 (keyword_on)
406 (keyword_do)
407 (keyword_union)
408 (keyword_except)
409 (keyword_intersect)
410] @keyword.operator
411
412[
413 "+"
414 "-"
415 "*"
416 "/"
417 "%"
418 "^"
419 ":="
420 "="
421 "<"
422 "<="
423 "!="
424 ">="
425 ">"
426 "<>"
427 (op_other)
428 (op_unary_other)
429] @operator
430
431[
432 "("
433 ")"
434] @punctuation.bracket
435
436[
437 ";"
438 ","
439 "."
440] @punctuation.delimiter \ No newline at end of file
diff --git a/queries/tsx.scm b/queries/tsx.scm
new file mode 100644
index 0000000..d5207a0
--- /dev/null
+++ b/queries/tsx.scm
@@ -0,0 +1,76 @@
1(function_declaration name: (identifier) @function)
2(method_definition name: (property_identifier) @function)
3(call_expression function: (identifier) @function)
4(call_expression function: (member_expression property: (property_identifier) @function))
5
6(type_identifier) @type
7(predefined_type) @type
8
9(string) @string
10(number) @number
11(comment) @comment
12(regex) @string
13(template_string) @string
14
15(true) @boolean
16(false) @boolean
17(null) @null
18
19(property_signature name: (property_identifier) @property)
20(public_field_definition name: (property_identifier) @property)
21
22[
23 "function"
24 "return"
25 "if"
26 "else"
27 "for"
28 "while"
29 "do"
30 "switch"
31 "case"
32 "default"
33 "break"
34 "continue"
35 "var"
36 "let"
37 "const"
38 "try"
39 "catch"
40 "finally"
41 "class"
42 "extends"
43 "implements"
44 "import"
45 "export"
46 "from"
47 "async"
48 "await"
49 "new"
50 "interface"
51 "type"
52 "enum"
53 "public"
54 "private"
55 "protected"
56 "readonly"
57 "declare"
58 "module"
59 "namespace"
60 "abstract"
61 "as"
62 "keyof"
63 "typeof"
64 "instanceof"
65 "void"
66 "debugger"
67 "yield"
68] @keyword
69
70(this) @keyword
71(super) @keyword
72
73(jsx_opening_element name: (_) @function)
74(jsx_closing_element name: (_) @function)
75(jsx_self_closing_element name: (_) @function)
76(jsx_attribute (property_identifier) @property)
diff --git a/queries/typescript.scm b/queries/typescript.scm
new file mode 100644
index 0000000..c8db11e
--- /dev/null
+++ b/queries/typescript.scm
@@ -0,0 +1,71 @@
1(function_declaration name: (identifier) @function)
2(method_definition name: (property_identifier) @function)
3(call_expression function: (identifier) @function)
4(call_expression function: (member_expression property: (property_identifier) @function))
5
6(type_identifier) @type
7(predefined_type) @type
8
9(string) @string
10(number) @number
11(comment) @comment
12(regex) @string
13(template_string) @string
14
15(true) @boolean
16(false) @boolean
17(null) @null
18
19(property_signature name: (property_identifier) @property)
20(public_field_definition name: (property_identifier) @property)
21
22[
23 "function"
24 "return"
25 "if"
26 "else"
27 "for"
28 "while"
29 "do"
30 "switch"
31 "case"
32 "default"
33 "break"
34 "continue"
35 "var"
36 "let"
37 "const"
38 "try"
39 "catch"
40 "finally"
41 "class"
42 "extends"
43 "implements"
44 "import"
45 "export"
46 "from"
47 "async"
48 "await"
49 "new"
50 "interface"
51 "type"
52 "enum"
53 "public"
54 "private"
55 "protected"
56 "readonly"
57 "declare"
58 "module"
59 "namespace"
60 "abstract"
61 "as"
62 "keyof"
63 "typeof"
64 "instanceof"
65 "void"
66 "debugger"
67 "yield"
68] @keyword
69
70(this) @keyword
71(super) @keyword