@aiderdesk/tree-sitter-utils 0.1.0

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 (59) hide show
  1. package/README.md +151 -0
  2. package/dist/cache-manager.d.ts +16 -0
  3. package/dist/cache-manager.d.ts.map +1 -0
  4. package/dist/constants.d.ts +4 -0
  5. package/dist/constants.d.ts.map +1 -0
  6. package/dist/file-utils.d.ts +2 -0
  7. package/dist/file-utils.d.ts.map +1 -0
  8. package/dist/graph-builder.d.ts +13 -0
  9. package/dist/graph-builder.d.ts.map +1 -0
  10. package/dist/index.d.ts +27 -0
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +1070 -0
  13. package/dist/index.js.map +7 -0
  14. package/dist/language-detector.d.ts +5 -0
  15. package/dist/language-detector.d.ts.map +1 -0
  16. package/dist/logger.d.ts +11 -0
  17. package/dist/logger.d.ts.map +1 -0
  18. package/dist/pagerank.d.ts +7 -0
  19. package/dist/pagerank.d.ts.map +1 -0
  20. package/dist/symbol-extractor.d.ts +14 -0
  21. package/dist/symbol-extractor.d.ts.map +1 -0
  22. package/dist/tree-renderer.d.ts +9 -0
  23. package/dist/tree-renderer.d.ts.map +1 -0
  24. package/dist/tree-sitter-analyzer.d.ts +16 -0
  25. package/dist/tree-sitter-analyzer.d.ts.map +1 -0
  26. package/dist/tree-sitter-parser.d.ts +13 -0
  27. package/dist/tree-sitter-parser.d.ts.map +1 -0
  28. package/dist/types.d.ts +57 -0
  29. package/dist/types.d.ts.map +1 -0
  30. package/dist/wasm-downloader.d.ts +7 -0
  31. package/dist/wasm-downloader.d.ts.map +1 -0
  32. package/package.json +62 -0
  33. package/resources/queries/c-tags.scm +9 -0
  34. package/resources/queries/c_sharp-tags.scm +46 -0
  35. package/resources/queries/cpp-tags.scm +15 -0
  36. package/resources/queries/dart-tags.scm +91 -0
  37. package/resources/queries/elisp-tags.scm +8 -0
  38. package/resources/queries/elixir-tags.scm +54 -0
  39. package/resources/queries/elm-tags.scm +19 -0
  40. package/resources/queries/fortran-tags.scm +15 -0
  41. package/resources/queries/go-tags.scm +30 -0
  42. package/resources/queries/haskell-tags.scm +3 -0
  43. package/resources/queries/hcl-tags.scm +77 -0
  44. package/resources/queries/java-tags.scm +20 -0
  45. package/resources/queries/javascript-tags.scm +94 -0
  46. package/resources/queries/julia-tags.scm +60 -0
  47. package/resources/queries/kotlin-tags.scm +27 -0
  48. package/resources/queries/matlab-tags.scm +10 -0
  49. package/resources/queries/ocaml-tags.scm +115 -0
  50. package/resources/queries/ocaml_interface-tags.scm +98 -0
  51. package/resources/queries/php-tags.scm +26 -0
  52. package/resources/queries/python-tags.scm +12 -0
  53. package/resources/queries/ql-tags.scm +26 -0
  54. package/resources/queries/ruby-tags.scm +64 -0
  55. package/resources/queries/rust-tags.scm +60 -0
  56. package/resources/queries/scala-tags.scm +65 -0
  57. package/resources/queries/tsx-tags.scm +51 -0
  58. package/resources/queries/typescript-tags.scm +61 -0
  59. package/resources/queries/zig-tags.scm +3 -0
@@ -0,0 +1,19 @@
1
+ (value_declaration (function_declaration_left (lower_case_identifier) @name.definition.function)) @definition.function
2
+
3
+ (function_call_expr (value_expr (value_qid) @name.reference.function)) @reference.function
4
+ (exposed_value (lower_case_identifier) @name.reference.function) @reference.function
5
+ (type_annotation ((lower_case_identifier) @name.reference.function) (colon)) @reference.function
6
+
7
+ (type_declaration ((upper_case_identifier) @name.definition.type)) @definition.type
8
+
9
+ (type_ref (upper_case_qid (upper_case_identifier) @name.reference.type)) @reference.type
10
+ (exposed_type (upper_case_identifier) @name.reference.type) @reference.type
11
+
12
+ (type_declaration (union_variant (upper_case_identifier) @name.definition.union)) @definition.union
13
+
14
+ (value_expr (upper_case_qid (upper_case_identifier) @name.reference.union)) @reference.union
15
+
16
+
17
+ (module_declaration
18
+ (upper_case_qid (upper_case_identifier)) @name.definition.module
19
+ ) @definition.module
@@ -0,0 +1,15 @@
1
+ ;; derived from: https://github.com/stadelmanma/tree-sitter-fortran
2
+ ;; License: MIT
3
+
4
+ (module_statement
5
+ (name) @name.definition.class) @definition.class
6
+
7
+ (function_statement
8
+ name: (name) @name.definition.function) @definition.function
9
+
10
+ (subroutine_statement
11
+ name: (name) @name.definition.function) @definition.function
12
+
13
+ (module_procedure_statement
14
+ name: (name) @name.definition.function) @definition.function
15
+
@@ -0,0 +1,30 @@
1
+ (
2
+ (comment)* @doc
3
+ .
4
+ (function_declaration
5
+ name: (identifier) @name.definition.function) @definition.function
6
+ (#strip! @doc "^//\\s*")
7
+ (#set-adjacent! @doc @definition.function)
8
+ )
9
+
10
+ (
11
+ (comment)* @doc
12
+ .
13
+ (method_declaration
14
+ name: (field_identifier) @name.definition.method) @definition.method
15
+ (#strip! @doc "^//\\s*")
16
+ (#set-adjacent! @doc @definition.method)
17
+ )
18
+
19
+ (call_expression
20
+ function: [
21
+ (identifier) @name.reference.call
22
+ (parenthesized_expression (identifier) @name.reference.call)
23
+ (selector_expression field: (field_identifier) @name.reference.call)
24
+ (parenthesized_expression (selector_expression field: (field_identifier) @name.reference.call))
25
+ ]) @reference.call
26
+
27
+ (type_spec
28
+ name: (type_identifier) @name.definition.type) @definition.type
29
+
30
+ (type_identifier) @name.reference.type @reference.type
@@ -0,0 +1,3 @@
1
+ (function (variable) @name.definition.function)
2
+ (bind (variable) @name.definition.function)
3
+ (signature (variable) @name.definition.type)
@@ -0,0 +1,77 @@
1
+ ;; Based on https://github.com/tree-sitter-grammars/tree-sitter-hcl/blob/main/make_grammar.js
2
+ ;; Which has Apache 2.0 License
3
+ ;; tags.scm for Terraform (tree-sitter-hcl)
4
+
5
+ ; === Definitions: Terraform Blocks ===
6
+ (block
7
+ (identifier) @block_type
8
+ (string_lit (template_literal) @resource_type)
9
+ (string_lit (template_literal) @name.definition.resource)
10
+ (body) @definition.resource
11
+ ) (#eq? @block_type "resource")
12
+
13
+ (block
14
+ (identifier) @block_type
15
+ (string_lit (template_literal) @name.definition.module)
16
+ (body) @definition.module
17
+ ) (#eq? @block_type "module")
18
+
19
+ (block
20
+ (identifier) @block_type
21
+ (string_lit (template_literal) @name.definition.variable)
22
+ (body) @definition.variable
23
+ ) (#eq? @block_type "variable")
24
+
25
+ (block
26
+ (identifier) @block_type
27
+ (string_lit (template_literal) @name.definition.output)
28
+ (body) @definition.output
29
+ ) (#eq? @block_type "output")
30
+
31
+ (block
32
+ (identifier) @block_type
33
+ (string_lit (template_literal) @name.definition.provider)
34
+ (body) @definition.provider
35
+ ) (#eq? @block_type "provider")
36
+
37
+ (block
38
+ (identifier) @block_type
39
+ (body
40
+ (attribute
41
+ (identifier) @name.definition.local
42
+ (expression) @definition.local
43
+ )+
44
+ )
45
+ ) (#eq? @block_type "locals")
46
+
47
+ ; === References: Variables, Locals, Modules, Data, Resources ===
48
+ ((variable_expr) @ref_type
49
+ (get_attr (identifier) @name.reference.variable)
50
+ ) @reference.variable
51
+ (#eq? @ref_type "var")
52
+
53
+ ((variable_expr) @ref_type
54
+ (get_attr (identifier) @name.reference.local)
55
+ ) @reference.local
56
+ (#eq? @ref_type "local")
57
+
58
+ ((variable_expr) @ref_type
59
+ (get_attr (identifier) @name.reference.module)
60
+ ) @reference.module
61
+ (#eq? @ref_type "module")
62
+
63
+ ((variable_expr) @ref_type
64
+ (get_attr (identifier) @data_source_type)
65
+ (get_attr (identifier) @name.reference.data)
66
+ ) @reference.data
67
+ (#eq? @ref_type "data")
68
+
69
+ ((variable_expr) @resource_type
70
+ (get_attr (identifier) @name.reference.resource)
71
+ ) @reference.resource
72
+ (#not-eq? @resource_type "var")
73
+ (#not-eq? @resource_type "local")
74
+ (#not-eq? @resource_type "module")
75
+ (#not-eq? @resource_type "data")
76
+ (#not-eq? @resource_type "provider")
77
+ (#not-eq? @resource_type "output")
@@ -0,0 +1,20 @@
1
+ (class_declaration
2
+ name: (identifier) @name.definition.class) @definition.class
3
+
4
+ (method_declaration
5
+ name: (identifier) @name.definition.method) @definition.method
6
+
7
+ (method_invocation
8
+ name: (identifier) @name.reference.call
9
+ arguments: (argument_list) @reference.call)
10
+
11
+ (interface_declaration
12
+ name: (identifier) @name.definition.interface) @definition.interface
13
+
14
+ (type_list
15
+ (type_identifier) @name.reference.implementation) @reference.implementation
16
+
17
+ (object_creation_expression
18
+ type: (type_identifier) @name.reference.class) @reference.class
19
+
20
+ (superclass (type_identifier) @name.reference.class) @reference.class
@@ -0,0 +1,94 @@
1
+ (
2
+ (comment)* @doc
3
+ .
4
+ (method_definition
5
+ name: (property_identifier) @name.definition.method) @definition.method
6
+ (#not-eq? @name.definition.method "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.definition.class)
17
+ (class_declaration
18
+ name: (_) @name.definition.class)
19
+ ] @definition.class
20
+ (#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
21
+ (#select-adjacent! @doc @definition.class)
22
+ )
23
+
24
+ (
25
+ (comment)* @doc
26
+ .
27
+ [
28
+ (function_declaration
29
+ name: (identifier) @name.definition.function)
30
+ (generator_function
31
+ name: (identifier) @name.definition.function)
32
+ (generator_function_declaration
33
+ name: (identifier) @name.definition.function)
34
+ ] @definition.function
35
+ (#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
36
+ (#select-adjacent! @doc @definition.function)
37
+ )
38
+
39
+ (
40
+ (comment)* @doc
41
+ .
42
+ (lexical_declaration
43
+ (variable_declarator
44
+ name: (identifier) @name.definition.function
45
+ value: [(arrow_function)]) @definition.function)
46
+ (#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
47
+ (#select-adjacent! @doc @definition.function)
48
+ )
49
+
50
+ (
51
+ (comment)* @doc
52
+ .
53
+ (variable_declaration
54
+ (variable_declarator
55
+ name: (identifier) @name.definition.function
56
+ value: [(arrow_function)]) @definition.function)
57
+ (#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
58
+ (#select-adjacent! @doc @definition.function)
59
+ )
60
+
61
+ (assignment_expression
62
+ left: [
63
+ (identifier) @name.definition.function
64
+ (member_expression
65
+ property: (property_identifier) @name.definition.function)
66
+ ]
67
+ right: [(arrow_function)]) @definition.function
68
+
69
+ (pair
70
+ key: (property_identifier) @name.definition.function
71
+ value: [(arrow_function)]) @definition.function
72
+
73
+ (
74
+ (call_expression
75
+ function: (identifier) @name.reference.call) @reference.call
76
+ (#not-match? @name.reference.call "^(require)$")
77
+ )
78
+
79
+ (call_expression
80
+ function: (member_expression
81
+ property: (property_identifier) @name.reference.call)
82
+ arguments: (_) @reference.call)
83
+
84
+ (new_expression
85
+ constructor: (_) @name.reference.class) @reference.class
86
+
87
+ ; Variables (const, let, var)
88
+ (lexical_declaration
89
+ (variable_declarator
90
+ name: (identifier) @name.definition.variable)) @definition.variable
91
+
92
+ (variable_declaration
93
+ (variable_declarator
94
+ name: (identifier) @name.definition.variable)) @definition.variable
@@ -0,0 +1,60 @@
1
+ ;; derived from: https://github.com/tree-sitter/tree-sitter-julia
2
+ ;; License: MIT
3
+
4
+ (module
5
+ name: (identifier) @name.definition.module) @definition.module
6
+
7
+ (module
8
+ name: (scoped_identifier) @name.definition.module) @definition.module
9
+
10
+ (struct_definition
11
+ name: (type_identifier) @name.definition.class) @definition.class
12
+
13
+ (mutable_struct_definition
14
+ name: (type_identifier) @name.definition.class) @definition.class
15
+
16
+ (abstract_type_declaration
17
+ name: (type_identifier) @name.definition.class) @definition.class
18
+
19
+ (constant_assignment
20
+ left: (identifier) @name.definition.class) @definition.class
21
+
22
+ (function_definition
23
+ name: (identifier) @name.definition.function) @definition.function
24
+
25
+ (function_definition
26
+ name: (scoped_identifier) @name.definition.function) @definition.function
27
+
28
+ (assignment
29
+ left: (call_expression
30
+ function: (identifier) @name.definition.function)) @definition.function
31
+
32
+ (method_definition
33
+ name: (identifier) @name.definition.method) @definition.method
34
+
35
+ (macro_definition
36
+ name: (identifier) @name.definition.macro) @definition.macro
37
+
38
+ (macro_call
39
+ name: (identifier) @name.reference.call) @reference.call
40
+
41
+ (call_expression
42
+ function: (identifier) @name.reference.call) @reference.call
43
+
44
+ (call_expression
45
+ function: (scoped_identifier) @name.reference.call) @reference.call
46
+
47
+ (type_expression
48
+ name: (type_identifier) @name.reference.type) @reference.type
49
+
50
+ (constant_assignment
51
+ left: (identifier) @name.definition.constant) @definition.constant
52
+
53
+ (export_statement
54
+ (identifier) @name.reference.export) @reference.export
55
+
56
+ (using_statement
57
+ (identifier) @name.reference.module) @reference.module
58
+
59
+ (import_statement
60
+ (identifier) @name.reference.module) @reference.module
@@ -0,0 +1,27 @@
1
+ ; Definitions
2
+
3
+ (class_declaration
4
+ (type_identifier) @name.definition.class) @definition.class
5
+
6
+ (function_declaration
7
+ (simple_identifier) @name.definition.function) @definition.function
8
+
9
+ (object_declaration
10
+ (type_identifier) @name.definition.object) @definition.object
11
+
12
+ ; References
13
+
14
+ (call_expression
15
+ [
16
+ (simple_identifier) @name.reference.call
17
+ (navigation_expression
18
+ (navigation_suffix
19
+ (simple_identifier) @name.reference.call))
20
+ ]) @reference.call
21
+
22
+ (delegation_specifier
23
+ [
24
+ (user_type) @name.reference.type
25
+ (constructor_invocation
26
+ (user_type) @name.reference.type)
27
+ ]) @reference.type
@@ -0,0 +1,10 @@
1
+ (class_definition
2
+ name: (identifier) @name.definition.class) @definition.class
3
+
4
+ (function_definition
5
+ name: (identifier) @name.definition.function) @definition.function
6
+
7
+ (function_call
8
+ name: (identifier) @name.reference.call) @reference.call
9
+
10
+ (command (command_name) @name.reference.call) @reference.call
@@ -0,0 +1,115 @@
1
+ ; Modules
2
+ ;--------
3
+
4
+ (
5
+ (comment)? @doc .
6
+ (module_definition (module_binding (module_name) @name.definition.module) @definition.module)
7
+ (#strip! @doc "^\\(\\*\\*?\\s*|\\s\\*\\)$")
8
+ )
9
+
10
+ (module_path (module_name) @name.reference.module) @reference.module
11
+
12
+ ; Module types
13
+ ;--------------
14
+
15
+ (
16
+ (comment)? @doc .
17
+ (module_type_definition (module_type_name) @name.definition.interface) @definition.interface
18
+ (#strip! @doc "^\\(\\*\\*?\\s*|\\s\\*\\)$")
19
+ )
20
+
21
+ (module_type_path (module_type_name) @name.reference.implementation) @reference.implementation
22
+
23
+ ; Functions
24
+ ;----------
25
+
26
+ (
27
+ (comment)? @doc .
28
+ (value_definition
29
+ [
30
+ (let_binding
31
+ pattern: (value_name) @name.definition.function
32
+ (parameter))
33
+ (let_binding
34
+ pattern: (value_name) @name.definition.function
35
+ body: [(fun_expression) (function_expression)])
36
+ ] @definition.function
37
+ )
38
+ (#strip! @doc "^\\(\\*\\*?\\s*|\\s\\*\\)$")
39
+ )
40
+
41
+ (
42
+ (comment)? @doc .
43
+ (external (value_name) @name.definition.function) @definition.function
44
+ (#strip! @doc "^\\(\\*\\*?\\s*|\\s\\*\\)$")
45
+ )
46
+
47
+ (application_expression
48
+ function: (value_path (value_name) @name.reference.call)) @reference.call
49
+
50
+ (infix_expression
51
+ left: (value_path (value_name) @name.reference.call)
52
+ operator: (concat_operator) @reference.call
53
+ (#eq? @reference.call "@@"))
54
+
55
+ (infix_expression
56
+ operator: (rel_operator) @reference.call
57
+ right: (value_path (value_name) @name.reference.call)
58
+ (#eq? @reference.call "|>"))
59
+
60
+ ; Operator
61
+ ;---------
62
+
63
+ (
64
+ (comment)? @doc .
65
+ (value_definition
66
+ (let_binding
67
+ pattern: (parenthesized_operator (_) @name.definition.function)) @definition.function)
68
+ (#strip! @doc "^\\(\\*\\*?\\s*|\\s\\*\\)$")
69
+ )
70
+
71
+ [
72
+ (prefix_operator)
73
+ (sign_operator)
74
+ (pow_operator)
75
+ (mult_operator)
76
+ (add_operator)
77
+ (concat_operator)
78
+ (rel_operator)
79
+ (and_operator)
80
+ (or_operator)
81
+ (assign_operator)
82
+ (hash_operator)
83
+ (indexing_operator)
84
+ (let_operator)
85
+ (let_and_operator)
86
+ (match_operator)
87
+ ] @name.reference.call @reference.call
88
+
89
+ ; Classes
90
+ ;--------
91
+
92
+ (
93
+ (comment)? @doc .
94
+ [
95
+ (class_definition (class_binding (class_name) @name.definition.class) @definition.class)
96
+ (class_type_definition (class_type_binding (class_type_name) @name.definition.class) @definition.class)
97
+ ]
98
+ (#strip! @doc "^\\(\\*\\*?\\s*|\\s\\*\\)$")
99
+ )
100
+
101
+ [
102
+ (class_path (class_name) @name.reference.class)
103
+ (class_type_path (class_type_name) @name.reference.class)
104
+ ] @reference.class
105
+
106
+ ; Methods
107
+ ;--------
108
+
109
+ (
110
+ (comment)? @doc .
111
+ (method_definition (method_name) @name.definition.method) @definition.method
112
+ (#strip! @doc "^\\(\\*\\*?\\s*|\\s\\*\\)$")
113
+ )
114
+
115
+ (method_invocation (method_name) @name.reference.call) @reference.call
@@ -0,0 +1,98 @@
1
+ ; Modules
2
+ ;--------
3
+
4
+ (
5
+ (comment)? @doc .
6
+ (module_definition
7
+ (module_binding (module_name) @name) @definition.module
8
+ )
9
+ (#strip! @doc "^\\(\\*+\\s*|\\s*\\*+\\)$")
10
+ )
11
+
12
+ (module_path (module_name) @name) @reference.module
13
+ (extended_module_path (module_name) @name) @reference.module
14
+
15
+ (
16
+ (comment)? @doc .
17
+ (module_type_definition (module_type_name) @name) @definition.interface
18
+ (#strip! @doc "^\\(\\*+\\s*|\\s*\\*+\\)$")
19
+ )
20
+
21
+ (module_type_path (module_type_name) @name) @reference.implementation
22
+
23
+
24
+ ; Classes
25
+ ;--------
26
+
27
+ (
28
+ (comment)? @doc .
29
+ [
30
+ (class_definition
31
+ (class_binding (class_name) @name) @definition.class
32
+ )
33
+ (class_type_definition
34
+ (class_type_binding (class_type_name) @name) @definition.class
35
+ )
36
+ ]
37
+ (#strip! @doc "^\\(\\*+\\s*|\\s*\\*+\\)$")
38
+ )
39
+
40
+ [
41
+ (class_path (class_name) @name)
42
+ (class_type_path (class_type_name) @name)
43
+ ] @reference.class
44
+
45
+ (
46
+ (comment)? @doc .
47
+ (method_definition (method_name) @name) @definition.method
48
+ (#strip! @doc "^\\(\\*+\\s*|\\s*\\*+\\)$")
49
+ )
50
+
51
+ (method_invocation (method_name) @name) @reference.call
52
+
53
+
54
+ ; Types
55
+ ;------
56
+
57
+ (
58
+ (comment)? @doc .
59
+ (type_definition
60
+ (type_binding
61
+ name: [
62
+ (type_constructor) @name
63
+ (type_constructor_path (type_constructor) @name)
64
+ ]
65
+ ) @definition.type
66
+ )
67
+ (#strip! @doc "^\\(\\*+\\s*|\\s*\\*+\\)$")
68
+ )
69
+
70
+ (type_constructor_path (type_constructor) @name) @reference.type
71
+
72
+ [
73
+ (constructor_declaration (constructor_name) @name)
74
+ (tag_specification (tag) @name)
75
+ ] @definition.enum_variant
76
+
77
+ [
78
+ (constructor_path (constructor_name) @name)
79
+ (tag) @name
80
+ ] @reference.enum_variant
81
+
82
+ (field_declaration (field_name) @name) @definition.field
83
+
84
+ (field_path (field_name) @name) @reference.field
85
+
86
+ (
87
+ (comment)? @doc .
88
+ (external (value_name) @name) @definition.function
89
+ (#strip! @doc "^\\(\\*+\\s*|\\s*\\*+\\)$")
90
+ )
91
+
92
+ (
93
+ (comment)? @doc .
94
+ (value_specification
95
+ (value_name) @name.definition.function
96
+ ) @definition.function
97
+ (#strip! @doc "^\\(\\*+\\s*|\\s*\\*+\\)$")
98
+ )
@@ -0,0 +1,26 @@
1
+ (class_declaration
2
+ name: (name) @name.definition.class) @definition.class
3
+
4
+ (function_definition
5
+ name: (name) @name.definition.function) @definition.function
6
+
7
+ (method_declaration
8
+ name: (name) @name.definition.function) @definition.function
9
+
10
+ (object_creation_expression
11
+ [
12
+ (qualified_name (name) @name.reference.class)
13
+ (variable_name (name) @name.reference.class)
14
+ ]) @reference.class
15
+
16
+ (function_call_expression
17
+ function: [
18
+ (qualified_name (name) @name.reference.call)
19
+ (variable_name (name)) @name.reference.call
20
+ ]) @reference.call
21
+
22
+ (scoped_call_expression
23
+ name: (name) @name.reference.call) @reference.call
24
+
25
+ (member_call_expression
26
+ name: (name) @name.reference.call) @reference.call
@@ -0,0 +1,12 @@
1
+ (class_definition
2
+ name: (identifier) @name.definition.class) @definition.class
3
+
4
+ (function_definition
5
+ name: (identifier) @name.definition.function) @definition.function
6
+
7
+ (call
8
+ function: [
9
+ (identifier) @name.reference.call
10
+ (attribute
11
+ attribute: (identifier) @name.reference.call)
12
+ ]) @reference.call
@@ -0,0 +1,26 @@
1
+ (classlessPredicate
2
+ name: (predicateName) @name.definition.function) @definition.function
3
+
4
+ (memberPredicate
5
+ name: (predicateName) @name.definition.method) @definition.method
6
+
7
+ (aritylessPredicateExpr
8
+ name: (literalId) @name.reference.call) @reference.call
9
+
10
+ (module
11
+ name: (moduleName) @name.definition.module) @definition.module
12
+
13
+ (dataclass
14
+ name: (className) @name.definition.class) @definition.class
15
+
16
+ (datatype
17
+ name: (className) @name.definition.class) @definition.class
18
+
19
+ (datatypeBranch
20
+ name: (className) @name.definition.class) @definition.class
21
+
22
+ (qualifiedRhs
23
+ name: (predicateName) @name.reference.call) @reference.call
24
+
25
+ (typeExpr
26
+ name: (className) @name.reference.type) @reference.type