ts-wasms 1.0.2 → 1.0.4

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 (125) hide show
  1. package/README.md +33 -0
  2. package/out/bash/tree-sitter-bash.wasm +0 -0
  3. package/out/c/tree-sitter-c.wasm +0 -0
  4. package/out/c-sharp/tree-sitter-c_sharp.wasm +0 -0
  5. package/out/clojure/highlights.scm +29 -0
  6. package/out/clojure/tree-sitter-clojure.wasm +0 -0
  7. package/out/clojurescript/highlights.scm +29 -0
  8. package/out/clojurescript/tree-sitter-clojure.wasm +0 -0
  9. package/out/commonlisp/tags.scm +122 -0
  10. package/out/commonlisp/tree-sitter-commonlisp.wasm +0 -0
  11. package/out/cpp/tree-sitter-cpp.wasm +0 -0
  12. package/out/css/tree-sitter-css.wasm +0 -0
  13. package/out/dart/tree-sitter-dart.wasm +0 -0
  14. package/out/elisp/tree-sitter-elisp.wasm +0 -0
  15. package/out/elixir/tree-sitter-elixir.wasm +0 -0
  16. package/out/elm/highlights.scm +76 -0
  17. package/out/elm/injections.scm +4 -0
  18. package/out/elm/locals.scm +15 -0
  19. package/out/elm/tags.scm +19 -0
  20. package/out/elm/tree-sitter-elm.wasm +0 -0
  21. package/out/embedded-template/tree-sitter-embedded_template.wasm +0 -0
  22. package/out/erlang/highlights.scm +230 -0
  23. package/out/erlang/tree-sitter-erlang.wasm +0 -0
  24. package/out/go/tree-sitter-go.wasm +0 -0
  25. package/out/graphql/tree-sitter-graphql.wasm +0 -0
  26. package/out/haskell/tree-sitter-haskell.wasm +0 -0
  27. package/out/hcl/tree-sitter-hcl.wasm +0 -0
  28. package/out/hcl-terraform/tree-sitter-terraform.wasm +0 -0
  29. package/out/html/tree-sitter-html.wasm +0 -0
  30. package/out/java/tree-sitter-java.wasm +0 -0
  31. package/out/javascript/tree-sitter-javascript.wasm +0 -0
  32. package/out/json/tree-sitter-json.wasm +0 -0
  33. package/out/julia/highlights.scm +375 -0
  34. package/out/julia/injections.scm +42 -0
  35. package/out/julia/locals.scm +71 -0
  36. package/out/julia/tree-sitter-julia.wasm +0 -0
  37. package/out/kotlin/tree-sitter-kotlin.wasm +0 -0
  38. package/out/lua/highlights.scm +201 -0
  39. package/out/lua/injections.scm +12 -0
  40. package/out/lua/locals.scm +32 -0
  41. package/out/lua/tags.scm +36 -0
  42. package/out/lua/tree-sitter-lua.wasm +0 -0
  43. package/out/markdown/highlights.scm +52 -0
  44. package/out/markdown/injections.scm +12 -0
  45. package/out/markdown/tree-sitter-markdown.wasm +0 -0
  46. package/out/markdown-inline/highlights.scm +37 -0
  47. package/out/markdown-inline/injections.scm +2 -0
  48. package/out/markdown-inline/tree-sitter-markdown_inline.wasm +0 -0
  49. package/out/nix/highlights.scm +99 -0
  50. package/out/nix/injections.scm +39 -0
  51. package/out/nix/locals.scm +33 -0
  52. package/out/nix/tags.scm +16 -0
  53. package/out/nix/tree-sitter-nix.wasm +0 -0
  54. package/out/objc/tree-sitter-objc.wasm +0 -0
  55. package/out/ocaml/highlights.scm +148 -0
  56. package/out/ocaml/locals.scm +24 -0
  57. package/out/ocaml/tags.scm +170 -0
  58. package/out/ocaml/tree-sitter-ocaml.wasm +0 -0
  59. package/out/ocaml-interface/highlights.scm +148 -0
  60. package/out/ocaml-interface/locals.scm +24 -0
  61. package/out/ocaml-interface/tags.scm +170 -0
  62. package/out/ocaml-interface/tree-sitter-ocaml_interface.wasm +0 -0
  63. package/out/ocaml-type/highlights.scm +148 -0
  64. package/out/ocaml-type/locals.scm +24 -0
  65. package/out/ocaml-type/tags.scm +170 -0
  66. package/out/ocaml-type/tree-sitter-ocaml_type.wasm +0 -0
  67. package/out/perl/folds.scm +27 -0
  68. package/out/perl/highlights.scm +162 -0
  69. package/out/perl/injections.scm +14 -0
  70. package/out/perl/matchup.scm +30 -0
  71. package/out/perl/tree-sitter-perl.wasm +0 -0
  72. package/out/php/highlights.scm +203 -0
  73. package/out/php/injections-text.scm +3 -0
  74. package/out/php/injections.scm +10 -0
  75. package/out/php/tags.scm +40 -0
  76. package/out/php/tree-sitter-php.wasm +0 -0
  77. package/out/php-only/highlights.scm +203 -0
  78. package/out/php-only/injections-text.scm +3 -0
  79. package/out/php-only/injections.scm +10 -0
  80. package/out/php-only/tags.scm +40 -0
  81. package/out/{php_only → php-only}/tree-sitter-php_only.wasm +0 -0
  82. package/out/prisma/highlights.scm +39 -0
  83. package/out/prisma/tree-sitter-prisma.wasm +0 -0
  84. package/out/python/tree-sitter-python.wasm +0 -0
  85. package/out/query/tree-sitter-query.wasm +0 -0
  86. package/out/r/highlights.scm +112 -0
  87. package/out/r/locals.scm +18 -0
  88. package/out/r/tags.scm +21 -0
  89. package/out/r/tree-sitter-r.wasm +0 -0
  90. package/out/racket/highlights.scm +108 -0
  91. package/out/racket/locals.scm +34 -0
  92. package/out/racket/tags.scm +12 -0
  93. package/out/racket/tree-sitter-racket.wasm +0 -0
  94. package/out/regex/tree-sitter-regex.wasm +0 -0
  95. package/out/ruby/tree-sitter-ruby.wasm +0 -0
  96. package/out/rust/tree-sitter-rust.wasm +0 -0
  97. package/out/scala/tree-sitter-scala.wasm +0 -0
  98. package/out/scheme/highlights.scm +84 -0
  99. package/out/scheme/tree-sitter-scheme.wasm +0 -0
  100. package/out/scss/highlights.scm +69 -0
  101. package/out/scss/tree-sitter-scss.wasm +0 -0
  102. package/out/sql/tree-sitter-SQL.wasm +0 -0
  103. package/out/swift/tree-sitter-swift.wasm +0 -0
  104. package/out/toml/highlights.scm +53 -0
  105. package/out/toml/tree-sitter-toml.wasm +0 -0
  106. package/out/typescript/highlights.scm +35 -0
  107. package/out/typescript/locals.scm +2 -0
  108. package/out/typescript/tags.scm +23 -0
  109. package/out/typescript/tree-sitter-typescript.wasm +0 -0
  110. package/out/typescript-tsx/highlights.scm +35 -0
  111. package/out/typescript-tsx/locals.scm +2 -0
  112. package/out/typescript-tsx/tags.scm +23 -0
  113. package/out/{tsx → typescript-tsx}/tree-sitter-tsx.wasm +0 -0
  114. package/out/vimdoc/tree-sitter-vimdoc.wasm +0 -0
  115. package/out/vue/tree-sitter-vue.wasm +0 -0
  116. package/out/xml/tree-sitter-xml.wasm +0 -0
  117. package/out/xml-dtd/tree-sitter-dtd.wasm +0 -0
  118. package/out/yaml/tree-sitter-yaml.wasm +0 -0
  119. package/out/zig/folds.scm +23 -0
  120. package/out/zig/highlights.scm +291 -0
  121. package/out/zig/indents.scm +22 -0
  122. package/out/zig/injections.scm +10 -0
  123. package/out/zig/tree-sitter-zig.wasm +0 -0
  124. package/package.json +79 -63
  125. package/README +0 -2
@@ -0,0 +1,32 @@
1
+ ; Scopes
2
+ [
3
+ (chunk)
4
+ (do_statement)
5
+ (while_statement)
6
+ (repeat_statement)
7
+ (if_statement)
8
+ (for_statement)
9
+ (function_declaration)
10
+ (function_definition)
11
+ ] @local.scope
12
+
13
+ ; Definitions
14
+ (assignment_statement
15
+ (variable_list
16
+ (identifier) @local.definition))
17
+
18
+ (function_declaration
19
+ name: (identifier) @local.definition)
20
+
21
+ (for_generic_clause
22
+ (variable_list
23
+ (identifier) @local.definition))
24
+
25
+ (for_numeric_clause
26
+ name: (identifier) @local.definition)
27
+
28
+ (parameters
29
+ (identifier) @local.definition)
30
+
31
+ ; References
32
+ (identifier) @local.reference
@@ -0,0 +1,36 @@
1
+ (function_declaration
2
+ name: [
3
+ (identifier) @name
4
+ (dot_index_expression
5
+ field: (identifier) @name)
6
+ ]) @definition.function
7
+
8
+ (function_declaration
9
+ name: (method_index_expression
10
+ method: (identifier) @name)) @definition.method
11
+
12
+ (assignment_statement
13
+ (variable_list
14
+ .
15
+ name: [
16
+ (identifier) @name
17
+ (dot_index_expression
18
+ field: (identifier) @name)
19
+ ])
20
+ (expression_list
21
+ .
22
+ value: (function_definition))) @definition.function
23
+
24
+ (table_constructor
25
+ (field
26
+ name: (identifier) @name
27
+ value: (function_definition))) @definition.function
28
+
29
+ (function_call
30
+ name: [
31
+ (identifier) @name
32
+ (dot_index_expression
33
+ field: (identifier) @name)
34
+ (method_index_expression
35
+ method: (identifier) @name)
36
+ ]) @reference.call
Binary file
@@ -0,0 +1,52 @@
1
+ ;From nvim-treesitter/nvim-treesitter
2
+ (atx_heading (inline) @text.title)
3
+ (setext_heading (paragraph) @text.title)
4
+
5
+ [
6
+ (atx_h1_marker)
7
+ (atx_h2_marker)
8
+ (atx_h3_marker)
9
+ (atx_h4_marker)
10
+ (atx_h5_marker)
11
+ (atx_h6_marker)
12
+ (setext_h1_underline)
13
+ (setext_h2_underline)
14
+ ] @punctuation.special
15
+
16
+ [
17
+ (link_title)
18
+ (indented_code_block)
19
+ (fenced_code_block)
20
+ ] @text.literal
21
+
22
+ [
23
+ (fenced_code_block_delimiter)
24
+ ] @punctuation.delimiter
25
+
26
+ (code_fence_content) @none
27
+
28
+ [
29
+ (link_destination)
30
+ ] @text.uri
31
+
32
+ [
33
+ (link_label)
34
+ ] @text.reference
35
+
36
+ [
37
+ (list_marker_plus)
38
+ (list_marker_minus)
39
+ (list_marker_star)
40
+ (list_marker_dot)
41
+ (list_marker_parenthesis)
42
+ (thematic_break)
43
+ ] @punctuation.special
44
+
45
+ [
46
+ (block_continuation)
47
+ (block_quote_marker)
48
+ ] @punctuation.special
49
+
50
+ [
51
+ (backslash_escape)
52
+ ] @string.escape
@@ -0,0 +1,12 @@
1
+ (fenced_code_block
2
+ (info_string
3
+ (language) @injection.language)
4
+ (code_fence_content) @injection.content)
5
+
6
+ ((html_block) @injection.content (#set! injection.language "html"))
7
+
8
+ (document . (section . (thematic_break) (_) @injection.content (thematic_break)) (#set! injection.language "yaml"))
9
+
10
+ ([(minus_metadata) (plus_metadata)] @injection.content (#set! injection.language "yml"))
11
+
12
+ ((inline) @injection.content (#set! injection.language "markdown_inline"))
@@ -0,0 +1,37 @@
1
+ ;; From nvim-treesitter/nvim-treesitter
2
+ [
3
+ (code_span)
4
+ (link_title)
5
+ ] @text.literal
6
+
7
+ [
8
+ (emphasis_delimiter)
9
+ (code_span_delimiter)
10
+ ] @punctuation.delimiter
11
+
12
+ (emphasis) @text.emphasis
13
+
14
+ (strong_emphasis) @text.strong
15
+
16
+ [
17
+ (link_destination)
18
+ (uri_autolink)
19
+ ] @text.uri
20
+
21
+ [
22
+ (link_label)
23
+ (link_text)
24
+ (image_description)
25
+ ] @text.reference
26
+
27
+ [
28
+ (backslash_escape)
29
+ (hard_line_break)
30
+ ] @string.escape
31
+
32
+ (image ["!" "[" "]" "(" ")"] @punctuation.delimiter)
33
+ (inline_link ["[" "]" "(" ")"] @punctuation.delimiter)
34
+ (shortcut_link ["[" "]"] @punctuation.delimiter)
35
+
36
+ ; NOTE: extension not enabled by default
37
+ ; (wiki_link ["[" "|" "]"] @punctuation.delimiter)
@@ -0,0 +1,2 @@
1
+ ((html_tag) @injection.content (#set! injection.language "html"))
2
+ ((latex_block) @injection.content (#set! injection.language "latex"))
@@ -0,0 +1,99 @@
1
+ (comment) @comment
2
+
3
+ [
4
+ "if"
5
+ "then"
6
+ "else"
7
+ "let"
8
+ "inherit"
9
+ "in"
10
+ "rec"
11
+ "with"
12
+ "assert"
13
+ "or"
14
+ ] @keyword
15
+
16
+ ((identifier) @variable.builtin
17
+ (#match? @variable.builtin "^(__currentSystem|__currentTime|__langVersion|__nixPath|__nixVersion|__storeDir|builtins|false|null|true)$")
18
+ (#is-not? local))
19
+
20
+ ((identifier) @function.builtin
21
+ (#match? @function.builtin "^(__add|__addErrorContext|__all|__any|__appendContext|__attrNames|__attrValues|__bitAnd|__bitOr|__bitXor|__catAttrs|__ceil|__compareVersions|__concatLists|__concatMap|__concatStringsSep|__deepSeq|__div|__elem|__elemAt|__fetchurl|__filter|__filterSource|__findFile|__flakeRefToString|__floor|__foldl'|__fromJSON|__functionArgs|__genList|__genericClosure|__getAttr|__getContext|__getEnv|__getFlake|__groupBy|__hasAttr|__hasContext|__hashFile|__hashString|__head|__intersectAttrs|__isAttrs|__isBool|__isFloat|__isFunction|__isInt|__isList|__isPath|__isString|__length|__lessThan|__listToAttrs|__mapAttrs|__match|__mul|__parseDrvName|__parseFlakeRef|__partition|__path|__pathExists|__readDir|__readFile|__readFileType|__replaceStrings|__seq|__sort|__split|__splitVersion|__storePath|__stringLength|__sub|__substring|__tail|__toFile|__toJSON|__toPath|__toXML|__trace|__traceVerbose|__tryEval|__typeOf|__unsafeDiscardOutputDependency|__unsafeDiscardStringContext|__unsafeGetAttrPos|__zipAttrsWith|abort|baseNameOf|break|derivation|derivationStrict|dirOf|fetchGit|fetchMercurial|fetchTarball|fetchTree|fromTOML|import|isNull|map|placeholder|removeAttrs|scopedImport|throw|toString)$")
22
+ (#is-not? local))
23
+
24
+ [
25
+ (integer_expression)
26
+ (float_expression)
27
+ ] @number
28
+
29
+ (escape_sequence) @escape
30
+ (dollar_escape) @escape
31
+
32
+ (function_expression
33
+ universal: (identifier) @variable.parameter
34
+ )
35
+
36
+ (formal
37
+ name: (identifier) @variable.parameter
38
+ "?"? @punctuation.delimiter)
39
+
40
+ (select_expression
41
+ attrpath: (attrpath (identifier)) @property)
42
+
43
+ (apply_expression
44
+ function: [
45
+ (variable_expression (identifier)) @function
46
+ (select_expression
47
+ attrpath: (attrpath
48
+ attr: (identifier) @function .))])
49
+
50
+ (unary_expression
51
+ operator: _ @operator)
52
+
53
+ (binary_expression
54
+ operator: _ @operator)
55
+
56
+ (variable_expression (identifier) @variable)
57
+
58
+ (binding
59
+ attrpath: (attrpath (identifier)) @property)
60
+
61
+ (identifier) @property
62
+
63
+ (inherit_from attrs: (inherited_attrs attr: (identifier) @property) )
64
+
65
+ [
66
+ ";"
67
+ "."
68
+ ","
69
+ "="
70
+ ] @punctuation.delimiter
71
+
72
+ [
73
+ "("
74
+ ")"
75
+ "["
76
+ "]"
77
+ "{"
78
+ "}"
79
+ ] @punctuation.bracket
80
+
81
+ (identifier) @variable
82
+
83
+ [
84
+ (string_expression)
85
+ (indented_string_expression)
86
+ ] @string
87
+
88
+ [
89
+ (path_expression)
90
+ (hpath_expression)
91
+ (spath_expression)
92
+ ] @string.special.path
93
+
94
+ (uri_expression) @string.special.uri
95
+
96
+ (interpolation
97
+ "${" @punctuation.special
98
+ (_) @embedded
99
+ "}" @punctuation.special)
@@ -0,0 +1,39 @@
1
+ ; mark arbitary languages with a comment
2
+ ((((comment) @injection.language) .
3
+ (indented_string_expression (string_fragment) @injection.content))
4
+ (#set! injection.combined))
5
+
6
+ ((binding
7
+ attrpath: (attrpath (identifier) @_path)
8
+ expression: (indented_string_expression
9
+ (string_fragment) @injection.content))
10
+ (#match? @_path "(^\\w*Phase|(pre|post)\\w*|(.*\\.)?\\w*([sS]cript|[hH]ook)|(.*\\.)?startup)$")
11
+ (#set! injection.language "bash")
12
+ (#set! injection.combined))
13
+
14
+ ((apply_expression
15
+ function: (apply_expression function: (_) @_func)
16
+ argument: (indented_string_expression (string_fragment) @injection.content))
17
+ (#match? @_func "(^|\\.)writeShellScript(Bin)?$")
18
+ (#set! injection.language "bash")
19
+ (#set! injection.combined))
20
+
21
+ (apply_expression
22
+ (apply_expression
23
+ function: (apply_expression
24
+ function: ((_) @_func)))
25
+ argument: (indented_string_expression (string_fragment) @injection.content)
26
+ (#match? @_func "(^|\\.)runCommand(((No)?(CC))?(Local)?)?$")
27
+ (#set! injection.language "bash")
28
+ (#set! injection.combined))
29
+
30
+ (apply_expression
31
+ function: ((_) @_func)
32
+ argument: (_ (_)* (_ (_)* (binding
33
+ attrpath: (attrpath (identifier) @_path)
34
+ expression: (indented_string_expression
35
+ (string_fragment) @injection.content))))
36
+ (#match? @_func "(^|\\.)writeShellApplication$")
37
+ (#match? @_path "^text$")
38
+ (#set! injection.language "bash")
39
+ (#set! injection.combined))
@@ -0,0 +1,33 @@
1
+ ;; when using @local.reference, tree-sitter seems to
2
+ ;; apply the scope from the identifier it has looked up,
3
+ ;; which makes sense for most languages.
4
+ ;; however, we want to highlight things as function based on their call-site,
5
+ ;; not their definition; therefore using TS's support for tracking locals
6
+ ;; impedes our ability to get the highlighting we want.
7
+ ;;
8
+ ;; also, TS doesn't seem to support scoping as implemented in languages
9
+ ;; with lazy let bindings, which results in syntax highlighting/goto-reference
10
+ ;; results that depend on the order of definitions, which is counter to the
11
+ ;; semantics of Nix.
12
+ ;;
13
+ ;; so for now we'll opt for not having any locals queries.
14
+ ;;
15
+ ;; see: https://github.com/tree-sitter/tree-sitter/issues/918
16
+
17
+ ;(function_expression
18
+ ; universal: (identifier)? @local.definition
19
+ ; formals: (formals (formal name: (identifier) @local.definition)*)
20
+ ; universal: (identifier)? @local.definition
21
+ ; ) @local.scope
22
+ ;
23
+ ;(rec_attrset_expression
24
+ ; bind: (binding
25
+ ; attrpath: (attrpath . (attr_identifier) @local.definition))
26
+ ;) @local.scope
27
+ ;
28
+ ;(let_expression
29
+ ; bind: (binding
30
+ ; attrpath: (attrpath . (attr_identifier) @local.definition))
31
+ ;) @local.scope
32
+ ;
33
+ ;(identifier) @local.reference
@@ -0,0 +1,16 @@
1
+ ;; https://tree-sitter.github.io/tree-sitter/4-code-navigation.html
2
+
3
+ ;;Function definitions
4
+ (binding
5
+ attrpath: (attrpath attr: (identifier)) @name
6
+ expression: (function_expression) @definition.function)
7
+ ;;Function/method calls
8
+ (apply_expression function: (apply_expression function: (variable_expression name: (identifier) @name)) @reference.call)
9
+
10
+ ;; TODO: (if even applicable?)
11
+ ;;Interface definitions @definition.interface
12
+ ;;Interface implementation @reference.implementation
13
+ ;;Class definitions @definition.class
14
+ ;;Class reference @reference.class
15
+ ;;Method definitions @definition.method
16
+ ;;Module definitions @definition.module
Binary file
Binary file
@@ -0,0 +1,148 @@
1
+ ; Punctuation
2
+ ;------------
3
+
4
+ [
5
+ "," "." ";" ":" "=" "|" "~" "?" "+" "-" "!" ">" "&"
6
+ "->" ";;" ":>" "+=" ":=" ".."
7
+ ] @punctuation.delimiter
8
+
9
+ ["(" ")" "[" "]" "{" "}" "[|" "|]" "[<" "[>"] @punctuation.bracket
10
+
11
+ (object_type ["<" ">"] @punctuation.bracket)
12
+
13
+ "%" @punctuation.special
14
+
15
+ (attribute ["[@" "]"] @punctuation.special)
16
+ (item_attribute ["[@@" "]"] @punctuation.special)
17
+ (floating_attribute ["[@@@" "]"] @punctuation.special)
18
+ (extension ["[%" "]"] @punctuation.special)
19
+ (item_extension ["[%%" "]"] @punctuation.special)
20
+ (quoted_extension ["{%" "}"] @punctuation.special)
21
+ (quoted_item_extension ["{%%" "}"] @punctuation.special)
22
+
23
+ ; Keywords
24
+ ;---------
25
+
26
+ [
27
+ "and" "as" "assert" "begin" "class" "constraint" "do" "done" "downto" "effect"
28
+ "else" "end" "exception" "external" "for" "fun" "function" "functor" "if" "in"
29
+ "include" "inherit" "initializer" "lazy" "let" "match" "method" "module"
30
+ "mutable" "new" "nonrec" "object" "of" "open" "private" "rec" "sig" "struct"
31
+ "then" "to" "try" "type" "val" "virtual" "when" "while" "with"
32
+ ] @keyword
33
+
34
+ ; Operators
35
+ ;----------
36
+
37
+ [
38
+ (prefix_operator)
39
+ (sign_operator)
40
+ (pow_operator)
41
+ (mult_operator)
42
+ (add_operator)
43
+ (concat_operator)
44
+ (rel_operator)
45
+ (and_operator)
46
+ (or_operator)
47
+ (assign_operator)
48
+ (hash_operator)
49
+ (indexing_operator)
50
+ (let_operator)
51
+ (let_and_operator)
52
+ (match_operator)
53
+ ] @operator
54
+
55
+ (match_expression (match_operator) @keyword)
56
+
57
+ (value_definition [(let_operator) (let_and_operator)] @keyword)
58
+
59
+ ["*" "#" "::" "<-"] @operator
60
+
61
+ ; Constants
62
+ ;----------
63
+
64
+ (boolean) @constant
65
+
66
+ [(number) (signed_number)] @number
67
+
68
+ [(string) (character)] @string
69
+
70
+ (quoted_string "{" @string "}" @string) @string
71
+
72
+ (escape_sequence) @escape
73
+
74
+ (conversion_specification) @string.special
75
+
76
+ ; Variables
77
+ ;----------
78
+
79
+ [(value_name) (type_variable)] @variable
80
+
81
+ (value_pattern) @variable.parameter
82
+
83
+ ; Properties
84
+ ;-----------
85
+
86
+ [(label_name) (field_name) (instance_variable_name)] @property
87
+
88
+ ; Functions
89
+ ;----------
90
+
91
+ (let_binding
92
+ pattern: (value_name) @function
93
+ (parameter))
94
+
95
+ (let_binding
96
+ pattern: (value_name) @function
97
+ body: [(fun_expression) (function_expression)])
98
+
99
+ (value_specification (value_name) @function)
100
+
101
+ (external (value_name) @function)
102
+
103
+ (method_name) @function.method
104
+
105
+ (application_expression
106
+ function: (value_path (value_name) @function))
107
+
108
+ (infix_expression
109
+ left: (value_path (value_name) @function)
110
+ operator: (concat_operator) @operator
111
+ (#eq? @operator "@@"))
112
+
113
+ (infix_expression
114
+ operator: (rel_operator) @operator
115
+ right: (value_path (value_name) @function)
116
+ (#eq? @operator "|>"))
117
+
118
+ (
119
+ (value_name) @function.builtin
120
+ (#match? @function.builtin "^(raise(_notrace)?|failwith|invalid_arg)$")
121
+ )
122
+
123
+ ; Types
124
+ ;------
125
+
126
+ [(class_name) (class_type_name) (type_constructor)] @type
127
+
128
+ (
129
+ (type_constructor) @type.builtin
130
+ (#match? @type.builtin "^(int|char|bytes|string|float|bool|unit|exn|array|list|option|int32|int64|nativeint|format6|lazy_t)$")
131
+ )
132
+
133
+ [(constructor_name) (tag)] @constructor
134
+
135
+ ; Modules
136
+ ;--------
137
+
138
+ [(module_name) (module_type_name)] @module
139
+
140
+ ; Attributes
141
+ ;-----------
142
+
143
+ (attribute_id) @tag
144
+
145
+ ; Comments
146
+ ;---------
147
+
148
+ [(comment) (line_number_directive) (directive) (shebang)] @comment
@@ -0,0 +1,24 @@
1
+ ; Scopes
2
+ ;-------
3
+
4
+ [
5
+ (let_binding)
6
+ (class_binding)
7
+ (class_function)
8
+ (method_definition)
9
+ (fun_expression)
10
+ (object_expression)
11
+ (for_expression)
12
+ (match_case)
13
+ (attribute_payload)
14
+ ] @local.scope
15
+
16
+ ; Definitions
17
+ ;------------
18
+
19
+ (value_pattern) @local.definition
20
+
21
+ ; References
22
+ ;-----------
23
+
24
+ (value_path . (value_name) @local.reference)