@sshadows/tree-sitter-al 3.2.0 → 3.2.1
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.
- package/package.json +3 -4
- package/queries/folds.scm +4 -16
- package/queries/highlights.scm +305 -97
- package/queries/indents.scm +5 -5
- package/queries/locals.scm +28 -7
- package/queries/tags.scm +179 -68
- package/queries/textobjects.scm +67 -27
- package/src/parser.c +370 -356
- package/src/tree_sitter/array.h +23 -17
- package/tree-sitter-al.wasm +0 -0
- package/queries/bad_delete.scm.v1 +0 -30
package/queries/textobjects.scm
CHANGED
|
@@ -9,11 +9,9 @@
|
|
|
9
9
|
;
|
|
10
10
|
; Note: the `body` field is absent for an empty construct (`{ }` / `begin end`),
|
|
11
11
|
; so an empty body simply yields no `.inside` match — the correct behaviour.
|
|
12
|
-
|
|
13
12
|
; =============================================================================
|
|
14
13
|
; Objects / types -> class.inside / class.around
|
|
15
14
|
; =============================================================================
|
|
16
|
-
|
|
17
15
|
[
|
|
18
16
|
(table_declaration)
|
|
19
17
|
(tableextension_declaration)
|
|
@@ -34,49 +32,91 @@
|
|
|
34
32
|
(permissionsetextension_declaration)
|
|
35
33
|
] @class.around
|
|
36
34
|
|
|
37
|
-
(table_declaration
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
(
|
|
53
|
-
|
|
35
|
+
(table_declaration
|
|
36
|
+
body: (_) @class.inside)
|
|
37
|
+
|
|
38
|
+
(tableextension_declaration
|
|
39
|
+
body: (_) @class.inside)
|
|
40
|
+
|
|
41
|
+
(page_declaration
|
|
42
|
+
body: (_) @class.inside)
|
|
43
|
+
|
|
44
|
+
(pageextension_declaration
|
|
45
|
+
body: (_) @class.inside)
|
|
46
|
+
|
|
47
|
+
(pagecustomization_declaration
|
|
48
|
+
body: (_) @class.inside)
|
|
49
|
+
|
|
50
|
+
(codeunit_declaration
|
|
51
|
+
body: (_) @class.inside)
|
|
52
|
+
|
|
53
|
+
(report_declaration
|
|
54
|
+
body: (_) @class.inside)
|
|
55
|
+
|
|
56
|
+
(reportextension_declaration
|
|
57
|
+
body: (_) @class.inside)
|
|
58
|
+
|
|
59
|
+
(query_declaration
|
|
60
|
+
body: (_) @class.inside)
|
|
61
|
+
|
|
62
|
+
(xmlport_declaration
|
|
63
|
+
body: (_) @class.inside)
|
|
64
|
+
|
|
65
|
+
(enum_declaration
|
|
66
|
+
body: (_) @class.inside)
|
|
67
|
+
|
|
68
|
+
(enumextension_declaration
|
|
69
|
+
body: (_) @class.inside)
|
|
70
|
+
|
|
71
|
+
(interface_declaration
|
|
72
|
+
body: (_) @class.inside)
|
|
73
|
+
|
|
74
|
+
(controladdin_declaration
|
|
75
|
+
body: (_) @class.inside)
|
|
76
|
+
|
|
77
|
+
(dotnet_declaration
|
|
78
|
+
body: (_) @class.inside)
|
|
79
|
+
|
|
80
|
+
(permissionset_declaration
|
|
81
|
+
body: (_) @class.inside)
|
|
82
|
+
|
|
83
|
+
(permissionsetextension_declaration
|
|
84
|
+
body: (_) @class.inside)
|
|
54
85
|
|
|
55
86
|
; =============================================================================
|
|
56
87
|
; Procedures / triggers -> function.inside / function.around
|
|
57
88
|
; (code blocks keep begin/end inside the body node, Rust `block` model)
|
|
58
89
|
; =============================================================================
|
|
59
|
-
|
|
60
90
|
(procedure) @function.around
|
|
91
|
+
|
|
61
92
|
(trigger_declaration) @function.around
|
|
93
|
+
|
|
62
94
|
(interface_procedure) @function.around
|
|
63
95
|
|
|
64
96
|
; Inside = the statement run only (excludes begin/end). The code_block now nests
|
|
65
97
|
; a content-only statement_block (no delimiters); target it for a clean inside.
|
|
66
|
-
(procedure
|
|
67
|
-
|
|
98
|
+
(procedure
|
|
99
|
+
body: (code_block
|
|
100
|
+
body: (statement_block) @function.inside))
|
|
101
|
+
|
|
102
|
+
(trigger_declaration
|
|
103
|
+
body: (code_block
|
|
104
|
+
body: (statement_block) @function.inside))
|
|
68
105
|
|
|
69
106
|
; Parameters — each parameter selectable individually
|
|
70
107
|
(parameter) @parameter.inside
|
|
108
|
+
|
|
71
109
|
(parameter) @parameter.around
|
|
72
110
|
|
|
73
111
|
; =============================================================================
|
|
74
112
|
; Statement containers (loops / case) -> block.inside / function.inside
|
|
75
113
|
; repeat/while/for/foreach/with bodies and the case branch list.
|
|
76
114
|
; =============================================================================
|
|
115
|
+
(repeat_statement
|
|
116
|
+
body: (statement_block) @function.inside)
|
|
77
117
|
|
|
78
|
-
(
|
|
79
|
-
|
|
118
|
+
(case_statement
|
|
119
|
+
body: (case_body) @block.inside)
|
|
80
120
|
|
|
81
121
|
; =============================================================================
|
|
82
122
|
; Sections, fields, actions, var, loops -> generic body capture
|
|
@@ -85,14 +125,14 @@
|
|
|
85
125
|
; case_body, statement_block, …), so any new body-bearing construct works
|
|
86
126
|
; without editing this query.
|
|
87
127
|
; =============================================================================
|
|
88
|
-
|
|
89
|
-
|
|
128
|
+
(_
|
|
129
|
+
body: (_) @block.inside) @block.around
|
|
90
130
|
|
|
91
131
|
; =============================================================================
|
|
92
132
|
; Comments
|
|
93
133
|
; =============================================================================
|
|
94
|
-
|
|
95
134
|
(comment) @comment.inside
|
|
135
|
+
|
|
96
136
|
(multiline_comment) @comment.inside
|
|
97
137
|
|
|
98
138
|
[
|