ts-wasms 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/LICENSE +21 -0
  2. package/README +2 -0
  3. package/out/bash/highlights.scm +56 -0
  4. package/out/bash/tree-sitter-bash.wasm +0 -0
  5. package/out/c/highlights.scm +81 -0
  6. package/out/c/tags.scm +9 -0
  7. package/out/c/tree-sitter-c.wasm +0 -0
  8. package/out/c-sharp/highlights.scm +213 -0
  9. package/out/c-sharp/tags.scm +23 -0
  10. package/out/c-sharp/tree-sitter-c_sharp.wasm +0 -0
  11. package/out/cpp/highlights.scm +70 -0
  12. package/out/cpp/injections.scm +3 -0
  13. package/out/cpp/tags.scm +15 -0
  14. package/out/cpp/tree-sitter-cpp.wasm +0 -0
  15. package/out/css/highlights.scm +76 -0
  16. package/out/css/tree-sitter-css.wasm +0 -0
  17. package/out/dart/folds.scm +8 -0
  18. package/out/dart/highlights.scm +224 -0
  19. package/out/dart/tree-sitter-dart.wasm +0 -0
  20. package/out/elisp/highlights.scm +72 -0
  21. package/out/elisp/tags.scm +5 -0
  22. package/out/elisp/tree-sitter-elisp.wasm +0 -0
  23. package/out/elixir/highlights.scm +223 -0
  24. package/out/elixir/injections.scm +55 -0
  25. package/out/elixir/tags.scm +54 -0
  26. package/out/elixir/tree-sitter-elixir.wasm +0 -0
  27. package/out/embedded-template/highlights.scm +12 -0
  28. package/out/embedded-template/injections-ejs.scm +7 -0
  29. package/out/embedded-template/injections-erb.scm +7 -0
  30. package/out/embedded-template/injections-etlua.scm +7 -0
  31. package/out/embedded-template/tree-sitter-embedded_template.wasm +0 -0
  32. package/out/go/highlights.scm +123 -0
  33. package/out/go/tags.scm +42 -0
  34. package/out/go/tree-sitter-go.wasm +0 -0
  35. package/out/haskell/highlights.scm +443 -0
  36. package/out/haskell/injections.scm +76 -0
  37. package/out/haskell/locals.scm +4 -0
  38. package/out/haskell/tree-sitter-haskell.wasm +0 -0
  39. package/out/html/highlights.scm +13 -0
  40. package/out/html/injections.scm +7 -0
  41. package/out/html/tree-sitter-html.wasm +0 -0
  42. package/out/java/highlights.scm +149 -0
  43. package/out/java/tags.scm +20 -0
  44. package/out/java/tree-sitter-java.wasm +0 -0
  45. package/out/javascript/highlights-jsx.scm +8 -0
  46. package/out/javascript/highlights-params.scm +12 -0
  47. package/out/javascript/highlights.scm +204 -0
  48. package/out/javascript/injections.scm +31 -0
  49. package/out/javascript/locals.scm +23 -0
  50. package/out/javascript/tags.scm +99 -0
  51. package/out/javascript/tree-sitter-javascript.wasm +0 -0
  52. package/out/json/highlights.scm +16 -0
  53. package/out/json/tree-sitter-json.wasm +0 -0
  54. package/out/kotlin/highlights.scm +380 -0
  55. package/out/kotlin/tree-sitter-kotlin.wasm +0 -0
  56. package/out/objc/folds.scm +20 -0
  57. package/out/objc/highlights.scm +216 -0
  58. package/out/objc/indents.scm +1 -0
  59. package/out/objc/injections.scm +10 -0
  60. package/out/objc/locals.scm +1 -0
  61. package/out/objc/tree-sitter-objc.wasm +0 -0
  62. package/out/php/tree-sitter-php.wasm +0 -0
  63. package/out/php_only/tree-sitter-php_only.wasm +0 -0
  64. package/out/python/highlights.scm +137 -0
  65. package/out/python/tags.scm +14 -0
  66. package/out/python/tree-sitter-python.wasm +0 -0
  67. package/out/regex/highlights.scm +63 -0
  68. package/out/regex/tree-sitter-regex.wasm +0 -0
  69. package/out/ruby/highlights.scm +154 -0
  70. package/out/ruby/locals.scm +27 -0
  71. package/out/ruby/tags.scm +64 -0
  72. package/out/ruby/tree-sitter-ruby.wasm +0 -0
  73. package/out/rust/highlights.scm +161 -0
  74. package/out/rust/injections.scm +9 -0
  75. package/out/rust/tags.scm +60 -0
  76. package/out/rust/tree-sitter-rust.wasm +0 -0
  77. package/out/scala/highlights.scm +260 -0
  78. package/out/scala/indents.scm +30 -0
  79. package/out/scala/locals.scm +30 -0
  80. package/out/scala/tags.scm +66 -0
  81. package/out/scala/tree-sitter-scala.wasm +0 -0
  82. package/out/swift/folds.scm +35 -0
  83. package/out/swift/highlights.scm +336 -0
  84. package/out/swift/indents.scm +123 -0
  85. package/out/swift/injections.scm +10 -0
  86. package/out/swift/locals.scm +23 -0
  87. package/out/swift/outline.scm +66 -0
  88. package/out/swift/tags.scm +51 -0
  89. package/out/swift/textobjects.scm +19 -0
  90. package/out/swift/tree-sitter-swift.wasm +0 -0
  91. package/out/tsx/tree-sitter-tsx.wasm +0 -0
  92. package/out/typescript/tree-sitter-typescript.wasm +0 -0
  93. package/out/vue/tree-sitter-vue.wasm +0 -0
  94. package/package.json +64 -0
@@ -0,0 +1,149 @@
1
+ ; Variables
2
+
3
+ (identifier) @variable
4
+
5
+ ; Methods
6
+
7
+ (method_declaration
8
+ name: (identifier) @function.method)
9
+ (method_invocation
10
+ name: (identifier) @function.method)
11
+ (super) @function.builtin
12
+
13
+ ; Annotations
14
+
15
+ (annotation
16
+ name: (identifier) @attribute)
17
+ (marker_annotation
18
+ name: (identifier) @attribute)
19
+
20
+ "@" @operator
21
+
22
+ ; Types
23
+
24
+ (type_identifier) @type
25
+
26
+ (interface_declaration
27
+ name: (identifier) @type)
28
+ (class_declaration
29
+ name: (identifier) @type)
30
+ (enum_declaration
31
+ name: (identifier) @type)
32
+
33
+ ((field_access
34
+ object: (identifier) @type)
35
+ (#match? @type "^[A-Z]"))
36
+ ((scoped_identifier
37
+ scope: (identifier) @type)
38
+ (#match? @type "^[A-Z]"))
39
+ ((method_invocation
40
+ object: (identifier) @type)
41
+ (#match? @type "^[A-Z]"))
42
+ ((method_reference
43
+ . (identifier) @type)
44
+ (#match? @type "^[A-Z]"))
45
+
46
+ (constructor_declaration
47
+ name: (identifier) @type)
48
+
49
+ [
50
+ (boolean_type)
51
+ (integral_type)
52
+ (floating_point_type)
53
+ (floating_point_type)
54
+ (void_type)
55
+ ] @type.builtin
56
+
57
+ ; Constants
58
+
59
+ ((identifier) @constant
60
+ (#match? @constant "^_*[A-Z][A-Z\\d_]+$"))
61
+
62
+ ; Builtins
63
+
64
+ (this) @variable.builtin
65
+
66
+ ; Literals
67
+
68
+ [
69
+ (hex_integer_literal)
70
+ (decimal_integer_literal)
71
+ (octal_integer_literal)
72
+ (decimal_floating_point_literal)
73
+ (hex_floating_point_literal)
74
+ ] @number
75
+
76
+ [
77
+ (character_literal)
78
+ (string_literal)
79
+ ] @string
80
+ (escape_sequence) @string.escape
81
+
82
+ [
83
+ (true)
84
+ (false)
85
+ (null_literal)
86
+ ] @constant.builtin
87
+
88
+ [
89
+ (line_comment)
90
+ (block_comment)
91
+ ] @comment
92
+
93
+ ; Keywords
94
+
95
+ [
96
+ "abstract"
97
+ "assert"
98
+ "break"
99
+ "case"
100
+ "catch"
101
+ "class"
102
+ "continue"
103
+ "default"
104
+ "do"
105
+ "else"
106
+ "enum"
107
+ "exports"
108
+ "extends"
109
+ "final"
110
+ "finally"
111
+ "for"
112
+ "if"
113
+ "implements"
114
+ "import"
115
+ "instanceof"
116
+ "interface"
117
+ "module"
118
+ "native"
119
+ "new"
120
+ "non-sealed"
121
+ "open"
122
+ "opens"
123
+ "package"
124
+ "permits"
125
+ "private"
126
+ "protected"
127
+ "provides"
128
+ "public"
129
+ "requires"
130
+ "record"
131
+ "return"
132
+ "sealed"
133
+ "static"
134
+ "strictfp"
135
+ "switch"
136
+ "synchronized"
137
+ "throw"
138
+ "throws"
139
+ "to"
140
+ "transient"
141
+ "transitive"
142
+ "try"
143
+ "uses"
144
+ "volatile"
145
+ "when"
146
+ "while"
147
+ "with"
148
+ "yield"
149
+ ] @keyword
@@ -0,0 +1,20 @@
1
+ (class_declaration
2
+ name: (identifier) @name) @definition.class
3
+
4
+ (method_declaration
5
+ name: (identifier) @name) @definition.method
6
+
7
+ (method_invocation
8
+ name: (identifier) @name
9
+ arguments: (argument_list) @reference.call)
10
+
11
+ (interface_declaration
12
+ name: (identifier) @name) @definition.interface
13
+
14
+ (type_list
15
+ (type_identifier) @name) @reference.implementation
16
+
17
+ (object_creation_expression
18
+ type: (type_identifier) @name) @reference.class
19
+
20
+ (superclass (type_identifier) @name) @reference.class
Binary file
@@ -0,0 +1,8 @@
1
+ (jsx_opening_element (identifier) @tag (#match? @tag "^[a-z][^.]*$"))
2
+ (jsx_closing_element (identifier) @tag (#match? @tag "^[a-z][^.]*$"))
3
+ (jsx_self_closing_element (identifier) @tag (#match? @tag "^[a-z][^.]*$"))
4
+
5
+ (jsx_attribute (property_identifier) @attribute)
6
+ (jsx_opening_element (["<" ">"]) @punctuation.bracket)
7
+ (jsx_closing_element (["</" ">"]) @punctuation.bracket)
8
+ (jsx_self_closing_element (["<" "/>"]) @punctuation.bracket)
@@ -0,0 +1,12 @@
1
+ (formal_parameters
2
+ [
3
+ (identifier) @variable.parameter
4
+ (array_pattern
5
+ (identifier) @variable.parameter)
6
+ (object_pattern
7
+ [
8
+ (pair_pattern value: (identifier) @variable.parameter)
9
+ (shorthand_property_identifier_pattern) @variable.parameter
10
+ ])
11
+ ]
12
+ )
@@ -0,0 +1,204 @@
1
+ ; Variables
2
+ ;----------
3
+
4
+ (identifier) @variable
5
+
6
+ ; Properties
7
+ ;-----------
8
+
9
+ (property_identifier) @property
10
+
11
+ ; Function and method definitions
12
+ ;--------------------------------
13
+
14
+ (function_expression
15
+ name: (identifier) @function)
16
+ (function_declaration
17
+ name: (identifier) @function)
18
+ (method_definition
19
+ name: (property_identifier) @function.method)
20
+
21
+ (pair
22
+ key: (property_identifier) @function.method
23
+ value: [(function_expression) (arrow_function)])
24
+
25
+ (assignment_expression
26
+ left: (member_expression
27
+ property: (property_identifier) @function.method)
28
+ right: [(function_expression) (arrow_function)])
29
+
30
+ (variable_declarator
31
+ name: (identifier) @function
32
+ value: [(function_expression) (arrow_function)])
33
+
34
+ (assignment_expression
35
+ left: (identifier) @function
36
+ right: [(function_expression) (arrow_function)])
37
+
38
+ ; Function and method calls
39
+ ;--------------------------
40
+
41
+ (call_expression
42
+ function: (identifier) @function)
43
+
44
+ (call_expression
45
+ function: (member_expression
46
+ property: (property_identifier) @function.method))
47
+
48
+ ; Special identifiers
49
+ ;--------------------
50
+
51
+ ((identifier) @constructor
52
+ (#match? @constructor "^[A-Z]"))
53
+
54
+ ([
55
+ (identifier)
56
+ (shorthand_property_identifier)
57
+ (shorthand_property_identifier_pattern)
58
+ ] @constant
59
+ (#match? @constant "^[A-Z_][A-Z\\d_]+$"))
60
+
61
+ ((identifier) @variable.builtin
62
+ (#match? @variable.builtin "^(arguments|module|console|window|document)$")
63
+ (#is-not? local))
64
+
65
+ ((identifier) @function.builtin
66
+ (#eq? @function.builtin "require")
67
+ (#is-not? local))
68
+
69
+ ; Literals
70
+ ;---------
71
+
72
+ (this) @variable.builtin
73
+ (super) @variable.builtin
74
+
75
+ [
76
+ (true)
77
+ (false)
78
+ (null)
79
+ (undefined)
80
+ ] @constant.builtin
81
+
82
+ (comment) @comment
83
+
84
+ [
85
+ (string)
86
+ (template_string)
87
+ ] @string
88
+
89
+ (regex) @string.special
90
+ (number) @number
91
+
92
+ ; Tokens
93
+ ;-------
94
+
95
+ [
96
+ ";"
97
+ (optional_chain)
98
+ "."
99
+ ","
100
+ ] @punctuation.delimiter
101
+
102
+ [
103
+ "-"
104
+ "--"
105
+ "-="
106
+ "+"
107
+ "++"
108
+ "+="
109
+ "*"
110
+ "*="
111
+ "**"
112
+ "**="
113
+ "/"
114
+ "/="
115
+ "%"
116
+ "%="
117
+ "<"
118
+ "<="
119
+ "<<"
120
+ "<<="
121
+ "="
122
+ "=="
123
+ "==="
124
+ "!"
125
+ "!="
126
+ "!=="
127
+ "=>"
128
+ ">"
129
+ ">="
130
+ ">>"
131
+ ">>="
132
+ ">>>"
133
+ ">>>="
134
+ "~"
135
+ "^"
136
+ "&"
137
+ "|"
138
+ "^="
139
+ "&="
140
+ "|="
141
+ "&&"
142
+ "||"
143
+ "??"
144
+ "&&="
145
+ "||="
146
+ "??="
147
+ ] @operator
148
+
149
+ [
150
+ "("
151
+ ")"
152
+ "["
153
+ "]"
154
+ "{"
155
+ "}"
156
+ ] @punctuation.bracket
157
+
158
+ (template_substitution
159
+ "${" @punctuation.special
160
+ "}" @punctuation.special) @embedded
161
+
162
+ [
163
+ "as"
164
+ "async"
165
+ "await"
166
+ "break"
167
+ "case"
168
+ "catch"
169
+ "class"
170
+ "const"
171
+ "continue"
172
+ "debugger"
173
+ "default"
174
+ "delete"
175
+ "do"
176
+ "else"
177
+ "export"
178
+ "extends"
179
+ "finally"
180
+ "for"
181
+ "from"
182
+ "function"
183
+ "get"
184
+ "if"
185
+ "import"
186
+ "in"
187
+ "instanceof"
188
+ "let"
189
+ "new"
190
+ "of"
191
+ "return"
192
+ "set"
193
+ "static"
194
+ "switch"
195
+ "target"
196
+ "throw"
197
+ "try"
198
+ "typeof"
199
+ "var"
200
+ "void"
201
+ "while"
202
+ "with"
203
+ "yield"
204
+ ] @keyword
@@ -0,0 +1,31 @@
1
+ ; Parse the contents of tagged template literals using
2
+ ; a language inferred from the tag.
3
+
4
+ (call_expression
5
+ function: [
6
+ (identifier) @injection.language
7
+ (member_expression
8
+ property: (property_identifier) @injection.language)
9
+ ]
10
+ arguments: (template_string (string_fragment) @injection.content)
11
+ (#set! injection.combined)
12
+ (#set! injection.include-children))
13
+
14
+
15
+ ; Parse regex syntax within regex literals
16
+
17
+ ((regex_pattern) @injection.content
18
+ (#set! injection.language "regex"))
19
+
20
+ ; Parse JSDoc annotations in comments
21
+
22
+ ((comment) @injection.content
23
+ (#set! injection.language "jsdoc"))
24
+
25
+ ; Parse Ember/Glimmer/Handlebars/HTMLBars/etc. template literals
26
+ ; e.g.: await render(hbs`<SomeComponent />`)
27
+ (call_expression
28
+ function: ((identifier) @_name
29
+ (#eq? @_name "hbs"))
30
+ arguments: ((template_string) @glimmer
31
+ (#offset! @glimmer 0 1 0 -1)))
@@ -0,0 +1,23 @@
1
+ ; Scopes
2
+ ;-------
3
+
4
+ [
5
+ (statement_block)
6
+ (function_expression)
7
+ (arrow_function)
8
+ (function_declaration)
9
+ (method_definition)
10
+ ] @local.scope
11
+
12
+ ; Definitions
13
+ ;------------
14
+
15
+ (pattern/identifier) @local.definition
16
+
17
+ (variable_declarator
18
+ name: (identifier) @local.definition)
19
+
20
+ ; References
21
+ ;------------
22
+
23
+ (identifier) @local.reference
@@ -0,0 +1,99 @@
1
+ (
2
+ (comment)* @doc
3
+ .
4
+ (method_definition
5
+ name: (property_identifier) @name) @definition.method
6
+ (#not-eq? @name "constructor")
7
+ (#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
8
+ (#select-adjacent! @doc @definition.method)
9
+ )
10
+
11
+ (
12
+ (comment)* @doc
13
+ .
14
+ [
15
+ (class
16
+ name: (_) @name)
17
+ (class_declaration
18
+ name: (_) @name)
19
+ ] @definition.class
20
+ (#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
21
+ (#select-adjacent! @doc @definition.class)
22
+ )
23
+
24
+ (
25
+ (comment)* @doc
26
+ .
27
+ [
28
+ (function_expression
29
+ name: (identifier) @name)
30
+ (function_declaration
31
+ name: (identifier) @name)
32
+ (generator_function
33
+ name: (identifier) @name)
34
+ (generator_function_declaration
35
+ name: (identifier) @name)
36
+ ] @definition.function
37
+ (#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
38
+ (#select-adjacent! @doc @definition.function)
39
+ )
40
+
41
+ (
42
+ (comment)* @doc
43
+ .
44
+ (lexical_declaration
45
+ (variable_declarator
46
+ name: (identifier) @name
47
+ value: [(arrow_function) (function_expression)]) @definition.function)
48
+ (#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
49
+ (#select-adjacent! @doc @definition.function)
50
+ )
51
+
52
+ (
53
+ (comment)* @doc
54
+ .
55
+ (variable_declaration
56
+ (variable_declarator
57
+ name: (identifier) @name
58
+ value: [(arrow_function) (function_expression)]) @definition.function)
59
+ (#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
60
+ (#select-adjacent! @doc @definition.function)
61
+ )
62
+
63
+ (assignment_expression
64
+ left: [
65
+ (identifier) @name
66
+ (member_expression
67
+ property: (property_identifier) @name)
68
+ ]
69
+ right: [(arrow_function) (function_expression)]
70
+ ) @definition.function
71
+
72
+ (pair
73
+ key: (property_identifier) @name
74
+ value: [(arrow_function) (function_expression)]) @definition.function
75
+
76
+ (
77
+ (call_expression
78
+ function: (identifier) @name) @reference.call
79
+ (#not-match? @name "^(require)$")
80
+ )
81
+
82
+ (call_expression
83
+ function: (member_expression
84
+ property: (property_identifier) @name)
85
+ arguments: (_) @reference.call)
86
+
87
+ (new_expression
88
+ constructor: (_) @name) @reference.class
89
+
90
+ (export_statement value: (assignment_expression left: (identifier) @name right: ([
91
+ (number)
92
+ (string)
93
+ (identifier)
94
+ (undefined)
95
+ (null)
96
+ (new_expression)
97
+ (binary_expression)
98
+ (call_expression)
99
+ ]))) @definition.constant
@@ -0,0 +1,16 @@
1
+ (pair
2
+ key: (_) @string.special.key)
3
+
4
+ (string) @string
5
+
6
+ (number) @number
7
+
8
+ [
9
+ (null)
10
+ (true)
11
+ (false)
12
+ ] @constant.builtin
13
+
14
+ (escape_sequence) @escape
15
+
16
+ (comment) @comment
Binary file