opsmith-cli 0.1.2a0__py3-none-any.whl
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.
- opsmith/__init__.py +0 -0
- opsmith/agent.py +243 -0
- opsmith/cloud_providers/__init__.py +10 -0
- opsmith/cloud_providers/aws.py +46 -0
- opsmith/cloud_providers/base.py +57 -0
- opsmith/cloud_providers/gcp.py +67 -0
- opsmith/constants.py +175 -0
- opsmith/deployer.py +236 -0
- opsmith/git_repo.py +66 -0
- opsmith/main.py +269 -0
- opsmith/prompts.py +76 -0
- opsmith/queries/tree-sitter-languages/README.md +7 -0
- opsmith/queries/tree-sitter-languages/arduino-tags.scm +5 -0
- opsmith/queries/tree-sitter-languages/c-tags.scm +9 -0
- opsmith/queries/tree-sitter-languages/c_sharp-tags.scm +46 -0
- opsmith/queries/tree-sitter-languages/chatito-tags.scm +16 -0
- opsmith/queries/tree-sitter-languages/commonlisp-tags.scm +122 -0
- opsmith/queries/tree-sitter-languages/cpp-tags.scm +15 -0
- opsmith/queries/tree-sitter-languages/csharp-tags.scm +26 -0
- opsmith/queries/tree-sitter-languages/d-tags.scm +26 -0
- opsmith/queries/tree-sitter-languages/dart-tags.scm +92 -0
- opsmith/queries/tree-sitter-languages/elisp-tags.scm +5 -0
- opsmith/queries/tree-sitter-languages/elixir-tags.scm +54 -0
- opsmith/queries/tree-sitter-languages/elm-tags.scm +19 -0
- opsmith/queries/tree-sitter-languages/gleam-tags.scm +41 -0
- opsmith/queries/tree-sitter-languages/go-tags.scm +42 -0
- opsmith/queries/tree-sitter-languages/hcl-tags.scm +77 -0
- opsmith/queries/tree-sitter-languages/java-tags.scm +20 -0
- opsmith/queries/tree-sitter-languages/javascript-tags.scm +88 -0
- opsmith/queries/tree-sitter-languages/kotlin-tags.scm +27 -0
- opsmith/queries/tree-sitter-languages/lua-tags.scm +34 -0
- opsmith/queries/tree-sitter-languages/ocaml-tags.scm +115 -0
- opsmith/queries/tree-sitter-languages/ocaml_interface-tags.scm +98 -0
- opsmith/queries/tree-sitter-languages/php-tags.scm +26 -0
- opsmith/queries/tree-sitter-languages/pony-tags.scm +39 -0
- opsmith/queries/tree-sitter-languages/properties-tags.scm +5 -0
- opsmith/queries/tree-sitter-languages/python-tags.scm +14 -0
- opsmith/queries/tree-sitter-languages/ql-tags.scm +26 -0
- opsmith/queries/tree-sitter-languages/r-tags.scm +21 -0
- opsmith/queries/tree-sitter-languages/racket-tags.scm +12 -0
- opsmith/queries/tree-sitter-languages/ruby-tags.scm +64 -0
- opsmith/queries/tree-sitter-languages/rust-tags.scm +60 -0
- opsmith/queries/tree-sitter-languages/scala-tags.scm +65 -0
- opsmith/queries/tree-sitter-languages/solidity-tags.scm +43 -0
- opsmith/queries/tree-sitter-languages/swift-tags.scm +51 -0
- opsmith/queries/tree-sitter-languages/typescript-tags.scm +41 -0
- opsmith/queries/tree-sitter-languages/udev-tags.scm +20 -0
- opsmith/repo_map.py +572 -0
- opsmith/settings.py +26 -0
- opsmith/spinner.py +221 -0
- opsmith_cli-0.1.2a0.dist-info/METADATA +31 -0
- opsmith_cli-0.1.2a0.dist-info/RECORD +55 -0
- opsmith_cli-0.1.2a0.dist-info/WHEEL +4 -0
- opsmith_cli-0.1.2a0.dist-info/entry_points.txt +2 -0
- opsmith_cli-0.1.2a0.dist-info/licenses/LICENSE.txt +674 -0
|
@@ -0,0 +1,88 @@
|
|
|
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_expression
|
|
29
|
+
name: (identifier) @name.definition.function)
|
|
30
|
+
(function_declaration
|
|
31
|
+
name: (identifier) @name.definition.function)
|
|
32
|
+
(generator_function
|
|
33
|
+
name: (identifier) @name.definition.function)
|
|
34
|
+
(generator_function_declaration
|
|
35
|
+
name: (identifier) @name.definition.function)
|
|
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.definition.function
|
|
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.definition.function
|
|
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.definition.function
|
|
66
|
+
(member_expression
|
|
67
|
+
property: (property_identifier) @name.definition.function)
|
|
68
|
+
]
|
|
69
|
+
right: [(arrow_function) (function_expression)]
|
|
70
|
+
) @definition.function
|
|
71
|
+
|
|
72
|
+
(pair
|
|
73
|
+
key: (property_identifier) @name.definition.function
|
|
74
|
+
value: [(arrow_function) (function_expression)]) @definition.function
|
|
75
|
+
|
|
76
|
+
(
|
|
77
|
+
(call_expression
|
|
78
|
+
function: (identifier) @name.reference.call) @reference.call
|
|
79
|
+
(#not-match? @name.reference.call "^(require)$")
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
(call_expression
|
|
83
|
+
function: (member_expression
|
|
84
|
+
property: (property_identifier) @name.reference.call)
|
|
85
|
+
arguments: (_) @reference.call)
|
|
86
|
+
|
|
87
|
+
(new_expression
|
|
88
|
+
constructor: (_) @name.reference.class) @reference.class
|
|
@@ -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,34 @@
|
|
|
1
|
+
(function_declaration
|
|
2
|
+
name: [
|
|
3
|
+
(identifier) @name.definition.function
|
|
4
|
+
(dot_index_expression
|
|
5
|
+
field: (identifier) @name.definition.function)
|
|
6
|
+
]) @definition.function
|
|
7
|
+
|
|
8
|
+
(function_declaration
|
|
9
|
+
name: (method_index_expression
|
|
10
|
+
method: (identifier) @name.definition.method)) @definition.method
|
|
11
|
+
|
|
12
|
+
(assignment_statement
|
|
13
|
+
(variable_list .
|
|
14
|
+
name: [
|
|
15
|
+
(identifier) @name.definition.function
|
|
16
|
+
(dot_index_expression
|
|
17
|
+
field: (identifier) @name.definition.function)
|
|
18
|
+
])
|
|
19
|
+
(expression_list .
|
|
20
|
+
value: (function_definition))) @definition.function
|
|
21
|
+
|
|
22
|
+
(table_constructor
|
|
23
|
+
(field
|
|
24
|
+
name: (identifier) @name.definition.function
|
|
25
|
+
value: (function_definition))) @definition.function
|
|
26
|
+
|
|
27
|
+
(function_call
|
|
28
|
+
name: [
|
|
29
|
+
(identifier) @name.reference.call
|
|
30
|
+
(dot_index_expression
|
|
31
|
+
field: (identifier) @name.reference.call)
|
|
32
|
+
(method_index_expression
|
|
33
|
+
method: (identifier) @name.reference.method)
|
|
34
|
+
]) @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,39 @@
|
|
|
1
|
+
;Class definitions @definition.class
|
|
2
|
+
;Function definitions @definition.function
|
|
3
|
+
;Interface definitions @definition.interface
|
|
4
|
+
;Method definitions @definition.method
|
|
5
|
+
;Module definitions @definition.module
|
|
6
|
+
;Function/method calls @reference.call
|
|
7
|
+
;Class reference @reference.class
|
|
8
|
+
;Interface implementation @reference.implementation
|
|
9
|
+
(
|
|
10
|
+
(identifier) @reference.class
|
|
11
|
+
(#match? @reference.class "^_*[A-Z][a-zA-Z0-9_]*$")
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
(class_definition (identifier) @name.definition.class) @definition.class
|
|
15
|
+
(actor_definition (identifier) @name.definition.class) @definition.class
|
|
16
|
+
(primitive_definition (identifier) @name.definition.class) @definition.class
|
|
17
|
+
(struct_definition (identifier) @name.definition.class) @definition.class
|
|
18
|
+
(type_alias (identifier) @name.definition.class) @definition.class
|
|
19
|
+
|
|
20
|
+
(trait_definition (identifier) @name.definition.interface) @definition.interface
|
|
21
|
+
(interface_definition (identifier) @name.definition.interface) @definition.interface
|
|
22
|
+
|
|
23
|
+
(constructor (identifier) @name.definition.method) @definition.method
|
|
24
|
+
(method (identifier) @name.definition.method) @definition.method
|
|
25
|
+
(behavior (identifier) @name.definition.method) @definition.method
|
|
26
|
+
|
|
27
|
+
(class_definition (type) @name.reference.implementation) @reference.implementation
|
|
28
|
+
(actor_definition (type) @name.reference.implementation) @reference.implementation
|
|
29
|
+
(primitive_definition (type) @name.reference.implementation) @reference.implementation
|
|
30
|
+
(struct_definition (type) @name.reference.implementation) @reference.implementation
|
|
31
|
+
(type_alias (type) @name.reference.implementation) @reference.implementation
|
|
32
|
+
|
|
33
|
+
; calls - not catching all possible call cases of callees for capturing the method name
|
|
34
|
+
(call_expression callee: [(identifier) (ffi_identifier)] @name.reference.call) @reference.call
|
|
35
|
+
(call_expression callee: (generic_expression [(identifier) (ffi_identifier)] @name.reference.call)) @reference.call
|
|
36
|
+
(call_expression callee: (member_expression (identifier) @name.reference.call .)) @reference.call
|
|
37
|
+
(call_expression callee: (member_expression (generic_expression [(identifier) (ffi_identifier)] @name.reference.call) .)) @reference.call
|
|
38
|
+
; TODO: add more possible callee expressions
|
|
39
|
+
(call_expression) @reference.call
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
(module (expression_statement (assignment left: (identifier) @name.definition.constant) @definition.constant))
|
|
2
|
+
|
|
3
|
+
(class_definition
|
|
4
|
+
name: (identifier) @name.definition.class) @definition.class
|
|
5
|
+
|
|
6
|
+
(function_definition
|
|
7
|
+
name: (identifier) @name.definition.function) @definition.function
|
|
8
|
+
|
|
9
|
+
(call
|
|
10
|
+
function: [
|
|
11
|
+
(identifier) @name.reference.call
|
|
12
|
+
(attribute
|
|
13
|
+
attribute: (identifier) @name.reference.call)
|
|
14
|
+
]) @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
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
(binary_operator
|
|
2
|
+
lhs: (identifier) @name.definition.function
|
|
3
|
+
operator: "<-"
|
|
4
|
+
rhs: (function_definition)
|
|
5
|
+
) @definition.function
|
|
6
|
+
|
|
7
|
+
(binary_operator
|
|
8
|
+
lhs: (identifier) @name.definition.function
|
|
9
|
+
operator: "="
|
|
10
|
+
rhs: (function_definition)
|
|
11
|
+
) @definition.function
|
|
12
|
+
|
|
13
|
+
(call
|
|
14
|
+
function: (identifier) @name.reference.call
|
|
15
|
+
) @reference.call
|
|
16
|
+
|
|
17
|
+
(call
|
|
18
|
+
function: (namespace_operator
|
|
19
|
+
rhs: (identifier) @name.reference.call
|
|
20
|
+
)
|
|
21
|
+
) @reference.call
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
; Method definitions
|
|
2
|
+
|
|
3
|
+
(
|
|
4
|
+
(comment)* @doc
|
|
5
|
+
.
|
|
6
|
+
[
|
|
7
|
+
(method
|
|
8
|
+
name: (_) @name.definition.method) @definition.method
|
|
9
|
+
(singleton_method
|
|
10
|
+
name: (_) @name.definition.method) @definition.method
|
|
11
|
+
]
|
|
12
|
+
(#strip! @doc "^#\\s*")
|
|
13
|
+
(#select-adjacent! @doc @definition.method)
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
(alias
|
|
17
|
+
name: (_) @name.definition.method) @definition.method
|
|
18
|
+
|
|
19
|
+
(setter
|
|
20
|
+
(identifier) @ignore)
|
|
21
|
+
|
|
22
|
+
; Class definitions
|
|
23
|
+
|
|
24
|
+
(
|
|
25
|
+
(comment)* @doc
|
|
26
|
+
.
|
|
27
|
+
[
|
|
28
|
+
(class
|
|
29
|
+
name: [
|
|
30
|
+
(constant) @name.definition.class
|
|
31
|
+
(scope_resolution
|
|
32
|
+
name: (_) @name.definition.class)
|
|
33
|
+
]) @definition.class
|
|
34
|
+
(singleton_class
|
|
35
|
+
value: [
|
|
36
|
+
(constant) @name.definition.class
|
|
37
|
+
(scope_resolution
|
|
38
|
+
name: (_) @name.definition.class)
|
|
39
|
+
]) @definition.class
|
|
40
|
+
]
|
|
41
|
+
(#strip! @doc "^#\\s*")
|
|
42
|
+
(#select-adjacent! @doc @definition.class)
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
; Module definitions
|
|
46
|
+
|
|
47
|
+
(
|
|
48
|
+
(module
|
|
49
|
+
name: [
|
|
50
|
+
(constant) @name.definition.module
|
|
51
|
+
(scope_resolution
|
|
52
|
+
name: (_) @name.definition.module)
|
|
53
|
+
]) @definition.module
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
; Calls
|
|
57
|
+
|
|
58
|
+
(call method: (identifier) @name.reference.call) @reference.call
|
|
59
|
+
|
|
60
|
+
(
|
|
61
|
+
[(identifier) (constant)] @name.reference.call @reference.call
|
|
62
|
+
(#is-not? local)
|
|
63
|
+
(#not-match? @name.reference.call "^(lambda|load|require|require_relative|__FILE__|__LINE__)$")
|
|
64
|
+
)
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
; ADT definitions
|
|
2
|
+
|
|
3
|
+
(struct_item
|
|
4
|
+
name: (type_identifier) @name.definition.class) @definition.class
|
|
5
|
+
|
|
6
|
+
(enum_item
|
|
7
|
+
name: (type_identifier) @name.definition.class) @definition.class
|
|
8
|
+
|
|
9
|
+
(union_item
|
|
10
|
+
name: (type_identifier) @name.definition.class) @definition.class
|
|
11
|
+
|
|
12
|
+
; type aliases
|
|
13
|
+
|
|
14
|
+
(type_item
|
|
15
|
+
name: (type_identifier) @name.definition.class) @definition.class
|
|
16
|
+
|
|
17
|
+
; method definitions
|
|
18
|
+
|
|
19
|
+
(declaration_list
|
|
20
|
+
(function_item
|
|
21
|
+
name: (identifier) @name.definition.method) @definition.method)
|
|
22
|
+
|
|
23
|
+
; function definitions
|
|
24
|
+
|
|
25
|
+
(function_item
|
|
26
|
+
name: (identifier) @name.definition.function) @definition.function
|
|
27
|
+
|
|
28
|
+
; trait definitions
|
|
29
|
+
(trait_item
|
|
30
|
+
name: (type_identifier) @name.definition.interface) @definition.interface
|
|
31
|
+
|
|
32
|
+
; module definitions
|
|
33
|
+
(mod_item
|
|
34
|
+
name: (identifier) @name.definition.module) @definition.module
|
|
35
|
+
|
|
36
|
+
; macro definitions
|
|
37
|
+
|
|
38
|
+
(macro_definition
|
|
39
|
+
name: (identifier) @name.definition.macro) @definition.macro
|
|
40
|
+
|
|
41
|
+
; references
|
|
42
|
+
|
|
43
|
+
(call_expression
|
|
44
|
+
function: (identifier) @name.reference.call) @reference.call
|
|
45
|
+
|
|
46
|
+
(call_expression
|
|
47
|
+
function: (field_expression
|
|
48
|
+
field: (field_identifier) @name.reference.call)) @reference.call
|
|
49
|
+
|
|
50
|
+
(macro_invocation
|
|
51
|
+
macro: (identifier) @name.reference.call) @reference.call
|
|
52
|
+
|
|
53
|
+
; implementations
|
|
54
|
+
|
|
55
|
+
(impl_item
|
|
56
|
+
trait: (type_identifier) @name.reference.implementation) @reference.implementation
|
|
57
|
+
|
|
58
|
+
(impl_item
|
|
59
|
+
type: (type_identifier) @name.reference.implementation
|
|
60
|
+
!trait) @reference.implementation
|