@mermanjs/tree-sitter-mermaid 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.
- package/CMakeLists.txt +44 -0
- package/LICENSE +22 -0
- package/Makefile +80 -0
- package/README.md +201 -0
- package/THIRD_PARTY_LICENSES/mermaid/LICENSE +21 -0
- package/THIRD_PARTY_LICENSES/monaqa-tree-sitter-mermaid/LICENSE +21 -0
- package/THIRD_PARTY_LICENSES/pappasam-tree-sitter-mermaid/LICENSE +21 -0
- package/THIRD_PARTY_LICENSES/singularity-tree-sitter-mermaid/LICENSE +22 -0
- package/THIRD_PARTY_LICENSES/tree-sitter/LICENSE +21 -0
- package/THIRD_PARTY_LICENSES/zenuml-core/LICENSE +21 -0
- package/THIRD_PARTY_NOTICES.md +47 -0
- package/binding.gyp +56 -0
- package/bindings/c/tree-sitter-mermaid.pc.in +10 -0
- package/bindings/c/tree_sitter/tree-sitter-mermaid.h +16 -0
- package/bindings/node/binding.cc +25 -0
- package/bindings/node/index.d.ts +5 -0
- package/bindings/node/index.js +10 -0
- package/grammar/families/architecture.js +361 -0
- package/grammar/families/block.js +370 -0
- package/grammar/families/c4.js +394 -0
- package/grammar/families/class.js +441 -0
- package/grammar/families/cynefin.js +127 -0
- package/grammar/families/entity-relationship.js +408 -0
- package/grammar/families/event-modeling.js +307 -0
- package/grammar/families/flowchart.js +690 -0
- package/grammar/families/gantt.js +445 -0
- package/grammar/families/git-graph.js +326 -0
- package/grammar/families/info.js +77 -0
- package/grammar/families/ishikawa.js +103 -0
- package/grammar/families/journey.js +221 -0
- package/grammar/families/kanban.js +264 -0
- package/grammar/families/mindmap.js +221 -0
- package/grammar/families/packet.js +108 -0
- package/grammar/families/pie.js +118 -0
- package/grammar/families/quadrant-chart.js +385 -0
- package/grammar/families/radar.js +286 -0
- package/grammar/families/railroad-abnf.js +124 -0
- package/grammar/families/railroad-ebnf.js +179 -0
- package/grammar/families/railroad-peg.js +128 -0
- package/grammar/families/railroad-shared.js +114 -0
- package/grammar/families/railroad.js +143 -0
- package/grammar/families/requirement.js +475 -0
- package/grammar/families/sankey.js +139 -0
- package/grammar/families/sequence.js +437 -0
- package/grammar/families/state.js +400 -0
- package/grammar/families/swimlane.js +25 -0
- package/grammar/families/timeline.js +251 -0
- package/grammar/families/tree-view.js +189 -0
- package/grammar/families/treemap.js +146 -0
- package/grammar/families/venn.js +256 -0
- package/grammar/families/wardley.js +530 -0
- package/grammar/families/xy-chart.js +460 -0
- package/grammar/families/zenuml.js +725 -0
- package/grammar/shared/common.js +78 -0
- package/grammar/shared/header.js +16 -0
- package/grammar/shared/indentation.js +22 -0
- package/grammar/shared/langium.js +166 -0
- package/grammar/shared/preamble.js +26 -0
- package/grammar.js +188 -0
- package/metadata/derivations.json +519 -0
- package/metadata/provenance.json +98 -0
- package/package.json +107 -0
- package/prebuilds/darwin-arm64/@mermanjs+tree-sitter-mermaid.node +0 -0
- package/prebuilds/darwin-x64/@mermanjs+tree-sitter-mermaid.node +0 -0
- package/prebuilds/linux-x64/@mermanjs+tree-sitter-mermaid.node +0 -0
- package/prebuilds/win32-x64/@mermanjs+tree-sitter-mermaid.node +0 -0
- package/queries/helix/highlights.scm +960 -0
- package/queries/helix/indents.scm +45 -0
- package/queries/helix/injections.scm +15 -0
- package/queries/helix/locals.scm +134 -0
- package/queries/helix/textobjects.scm +264 -0
- package/queries/neovim/README.md +28 -0
- package/queries/neovim/brackets.scm +65 -0
- package/queries/neovim/folds.scm +53 -0
- package/queries/neovim/highlights.scm +121 -0
- package/queries/neovim/indents.scm +110 -0
- package/queries/neovim/injections.scm +86 -0
- package/queries/neovim/locals.scm +277 -0
- package/queries/neovim/outline.scm +117 -0
- package/queries/neovim/tags.scm +149 -0
- package/queries/neovim/textobjects.scm +97 -0
- package/queries/portable/highlights.scm +961 -0
- package/queries/portable/injections.scm +45 -0
- package/queries/portable/locals.scm +290 -0
- package/queries/portable/tags.scm +182 -0
- package/queries/zed/README.md +48 -0
- package/queries/zed/brackets.scm +111 -0
- package/queries/zed/highlights.scm +961 -0
- package/queries/zed/indents.scm +111 -0
- package/queries/zed/injections.scm +11 -0
- package/queries/zed/outline.scm +167 -0
- package/queries/zed/textobjects.scm +68 -0
- package/src/grammar.json +71138 -0
- package/src/node-types.json +34871 -0
- package/src/parser.c +321353 -0
- package/src/scanner.c +462 -0
- package/src/tree_sitter/alloc.h +54 -0
- package/src/tree_sitter/array.h +336 -0
- package/src/tree_sitter/parser.h +286 -0
- package/tree-sitter-mermaid.wasm +0 -0
- package/tree-sitter.json +40 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
; Portable injections require delimiter-free payload nodes and standard query
|
|
2
|
+
; predicates. Families that require editor-specific offsets remain N/A.
|
|
3
|
+
|
|
4
|
+
; Event Modeling typed data blocks.
|
|
5
|
+
((event_data_block
|
|
6
|
+
type: (event_data_type
|
|
7
|
+
kind: (event_data_type_name) @_event_language)
|
|
8
|
+
content: [
|
|
9
|
+
(event_data_fragment)
|
|
10
|
+
(event_nested_data_block)
|
|
11
|
+
] @injection.content)
|
|
12
|
+
(#eq? @_event_language "json")
|
|
13
|
+
(#set! injection.language "json")
|
|
14
|
+
(#set! injection.combined))
|
|
15
|
+
|
|
16
|
+
((event_data_block
|
|
17
|
+
type: (event_data_type
|
|
18
|
+
kind: (event_data_type_name) @_event_language)
|
|
19
|
+
content: [
|
|
20
|
+
(event_data_fragment)
|
|
21
|
+
(event_nested_data_block)
|
|
22
|
+
] @injection.content)
|
|
23
|
+
(#eq? @_event_language "md")
|
|
24
|
+
(#set! injection.language "markdown")
|
|
25
|
+
(#set! injection.combined))
|
|
26
|
+
|
|
27
|
+
((event_data_block
|
|
28
|
+
type: (event_data_type
|
|
29
|
+
kind: (event_data_type_name) @_event_language)
|
|
30
|
+
content: [
|
|
31
|
+
(event_data_fragment)
|
|
32
|
+
(event_nested_data_block)
|
|
33
|
+
] @injection.content)
|
|
34
|
+
(#eq? @_event_language "html")
|
|
35
|
+
(#set! injection.language "html")
|
|
36
|
+
(#set! injection.combined))
|
|
37
|
+
|
|
38
|
+
; XY Chart Markdown text already exposes its delimiters separately.
|
|
39
|
+
((xy_chart_markdown_text
|
|
40
|
+
[
|
|
41
|
+
(xy_chart_markdown_content)
|
|
42
|
+
(xy_chart_markdown_backtick_content)
|
|
43
|
+
] @injection.content)
|
|
44
|
+
(#set! injection.language "markdown")
|
|
45
|
+
(#set! injection.combined))
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
; Mermaid identifiers are diagram-local. Only families whose CST distinguishes
|
|
2
|
+
; declarations from references participate in the portable locals contract.
|
|
3
|
+
[
|
|
4
|
+
(architecture_diagram)
|
|
5
|
+
(block_diagram)
|
|
6
|
+
(c4_diagram)
|
|
7
|
+
(class_diagram)
|
|
8
|
+
(entity_relationship_diagram)
|
|
9
|
+
(event_modeling_diagram)
|
|
10
|
+
(flowchart_diagram)
|
|
11
|
+
(gantt_diagram)
|
|
12
|
+
(git_graph_diagram)
|
|
13
|
+
(radar_diagram)
|
|
14
|
+
(railroad_diagram)
|
|
15
|
+
(railroad_abnf_diagram)
|
|
16
|
+
(railroad_ebnf_diagram)
|
|
17
|
+
(railroad_peg_diagram)
|
|
18
|
+
(requirement_diagram)
|
|
19
|
+
(sequence_diagram)
|
|
20
|
+
(state_diagram)
|
|
21
|
+
(swimlane_diagram)
|
|
22
|
+
(venn_diagram)
|
|
23
|
+
(wardley_diagram)
|
|
24
|
+
(zenuml_diagram)
|
|
25
|
+
] @local.scope
|
|
26
|
+
|
|
27
|
+
; Architecture.
|
|
28
|
+
(architecture_group_statement
|
|
29
|
+
id: (architecture_identifier) @local.definition)
|
|
30
|
+
|
|
31
|
+
[
|
|
32
|
+
(architecture_service_statement
|
|
33
|
+
id: (architecture_identifier) @local.definition)
|
|
34
|
+
(architecture_junction_statement
|
|
35
|
+
id: (architecture_identifier) @local.definition)
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
(architecture_parent_clause
|
|
39
|
+
parent: (architecture_identifier) @local.reference)
|
|
40
|
+
|
|
41
|
+
(architecture_edge_endpoint
|
|
42
|
+
id: (architecture_identifier) @local.reference)
|
|
43
|
+
|
|
44
|
+
(architecture_alignment_statement
|
|
45
|
+
member: (architecture_identifier) @local.reference)
|
|
46
|
+
|
|
47
|
+
; Block.
|
|
48
|
+
(block_node
|
|
49
|
+
id: (block_identifier) @local.definition
|
|
50
|
+
shape: (_))
|
|
51
|
+
|
|
52
|
+
(block_edge_statement
|
|
53
|
+
source: (block_node
|
|
54
|
+
id: (block_identifier) @local.reference
|
|
55
|
+
!shape))
|
|
56
|
+
|
|
57
|
+
(block_edge_statement
|
|
58
|
+
target: (block_node
|
|
59
|
+
id: (block_identifier) @local.reference
|
|
60
|
+
!shape))
|
|
61
|
+
|
|
62
|
+
; C4.
|
|
63
|
+
(c4_entity_declaration
|
|
64
|
+
id: (c4_reference
|
|
65
|
+
value: (c4_identifier) @local.definition))
|
|
66
|
+
|
|
67
|
+
(c4_boundary_statement
|
|
68
|
+
id: (c4_reference
|
|
69
|
+
value: (c4_identifier) @local.definition))
|
|
70
|
+
|
|
71
|
+
(c4_relationship_statement
|
|
72
|
+
source: (c4_reference
|
|
73
|
+
value: (c4_identifier) @local.reference))
|
|
74
|
+
|
|
75
|
+
(c4_relationship_statement
|
|
76
|
+
target: (c4_reference
|
|
77
|
+
value: (c4_identifier) @local.reference))
|
|
78
|
+
|
|
79
|
+
(c4_style_update_statement
|
|
80
|
+
source: (c4_reference
|
|
81
|
+
value: (c4_identifier) @local.reference))
|
|
82
|
+
|
|
83
|
+
(c4_style_update_statement
|
|
84
|
+
target: (c4_reference
|
|
85
|
+
value: (c4_identifier) @local.reference))
|
|
86
|
+
|
|
87
|
+
; Class.
|
|
88
|
+
(class_namespace_declaration
|
|
89
|
+
name: (class_namespace_name
|
|
90
|
+
(identifier) @local.definition))
|
|
91
|
+
|
|
92
|
+
(class_declaration
|
|
93
|
+
name: (class_name
|
|
94
|
+
(identifier) @local.definition))
|
|
95
|
+
|
|
96
|
+
(class_reference
|
|
97
|
+
(identifier) @local.reference)
|
|
98
|
+
|
|
99
|
+
; Entity Relationship.
|
|
100
|
+
(er_entity_declaration
|
|
101
|
+
name: (er_entity_name) @local.definition)
|
|
102
|
+
|
|
103
|
+
(er_relationship
|
|
104
|
+
source: (er_entity_reference) @local.reference)
|
|
105
|
+
|
|
106
|
+
(er_relationship
|
|
107
|
+
target: (er_entity_reference) @local.reference)
|
|
108
|
+
|
|
109
|
+
; Event Modeling.
|
|
110
|
+
(event_entity_statement
|
|
111
|
+
name: (event_qualified_name) @local.definition)
|
|
112
|
+
|
|
113
|
+
(event_data_statement
|
|
114
|
+
name: (event_data_name) @local.definition)
|
|
115
|
+
|
|
116
|
+
(event_frame_statement
|
|
117
|
+
entity: (event_qualified_name) @local.reference)
|
|
118
|
+
|
|
119
|
+
(event_frame_statement
|
|
120
|
+
data_reference: (event_data_reference
|
|
121
|
+
name: (event_data_name) @local.reference))
|
|
122
|
+
|
|
123
|
+
; Flowchart.
|
|
124
|
+
(flow_vertex
|
|
125
|
+
id: (flow_node_id) @local.definition
|
|
126
|
+
shape: (_))
|
|
127
|
+
|
|
128
|
+
(flow_vertex
|
|
129
|
+
id: (flow_node_id) @local.reference
|
|
130
|
+
!shape)
|
|
131
|
+
|
|
132
|
+
(flow_class_assignment_statement
|
|
133
|
+
targets: (flow_identifier_list
|
|
134
|
+
item: (flow_reference) @local.reference))
|
|
135
|
+
|
|
136
|
+
(flow_style_statement
|
|
137
|
+
target: (flow_node_id) @local.reference)
|
|
138
|
+
|
|
139
|
+
(flow_click_statement
|
|
140
|
+
target: (flow_node_id) @local.reference)
|
|
141
|
+
|
|
142
|
+
; Gantt.
|
|
143
|
+
(gantt_task_statement
|
|
144
|
+
metadata: (gantt_task_metadata
|
|
145
|
+
(gantt_task_item
|
|
146
|
+
value: (gantt_task_atom) @local.definition)))
|
|
147
|
+
|
|
148
|
+
(gantt_reference) @local.reference
|
|
149
|
+
|
|
150
|
+
; GitGraph.
|
|
151
|
+
(git_graph_branch_statement
|
|
152
|
+
name: (git_graph_reference) @local.definition)
|
|
153
|
+
|
|
154
|
+
(git_graph_checkout_statement
|
|
155
|
+
branch: (git_graph_reference) @local.reference)
|
|
156
|
+
|
|
157
|
+
(git_graph_merge_statement
|
|
158
|
+
branch: (git_graph_reference) @local.reference)
|
|
159
|
+
|
|
160
|
+
; Radar.
|
|
161
|
+
(radar_axis
|
|
162
|
+
name: (radar_identifier) @local.definition)
|
|
163
|
+
|
|
164
|
+
(radar_curve
|
|
165
|
+
name: (radar_identifier) @local.definition)
|
|
166
|
+
|
|
167
|
+
(radar_detailed_entry
|
|
168
|
+
axis: (radar_identifier) @local.reference)
|
|
169
|
+
|
|
170
|
+
; Railroad constructor dialect.
|
|
171
|
+
(railroad_rule
|
|
172
|
+
name: (railroad_identifier) @local.definition)
|
|
173
|
+
|
|
174
|
+
(railroad_reference
|
|
175
|
+
name: (railroad_string) @local.reference)
|
|
176
|
+
|
|
177
|
+
; Railroad ABNF.
|
|
178
|
+
(railroad_abnf_rule
|
|
179
|
+
name: (railroad_abnf_rule_name) @local.definition)
|
|
180
|
+
|
|
181
|
+
(railroad_abnf_reference
|
|
182
|
+
name: (railroad_abnf_rule_name) @local.reference)
|
|
183
|
+
|
|
184
|
+
; Railroad EBNF.
|
|
185
|
+
(railroad_ebnf_rule
|
|
186
|
+
name: (railroad_ebnf_identifier) @local.definition)
|
|
187
|
+
|
|
188
|
+
(railroad_ebnf_reference
|
|
189
|
+
name: (railroad_ebnf_identifier) @local.reference)
|
|
190
|
+
|
|
191
|
+
; Railroad PEG.
|
|
192
|
+
(railroad_peg_rule
|
|
193
|
+
name: (railroad_peg_identifier) @local.definition)
|
|
194
|
+
|
|
195
|
+
(railroad_peg_reference
|
|
196
|
+
name: (railroad_peg_identifier) @local.reference)
|
|
197
|
+
|
|
198
|
+
; Requirement.
|
|
199
|
+
[
|
|
200
|
+
(requirement_declaration
|
|
201
|
+
name: (requirement_name) @local.definition)
|
|
202
|
+
(requirement_element_declaration
|
|
203
|
+
name: (requirement_name) @local.definition)
|
|
204
|
+
]
|
|
205
|
+
|
|
206
|
+
(requirement_relationship_statement
|
|
207
|
+
source: (requirement_reference) @local.reference)
|
|
208
|
+
|
|
209
|
+
(requirement_relationship_statement
|
|
210
|
+
target: (requirement_reference) @local.reference)
|
|
211
|
+
|
|
212
|
+
; Sequence.
|
|
213
|
+
(sequence_participant_declaration
|
|
214
|
+
name: (sequence_participant_name) @local.definition)
|
|
215
|
+
|
|
216
|
+
(sequence_actor_reference) @local.reference
|
|
217
|
+
|
|
218
|
+
; State.
|
|
219
|
+
(state_alias_clause
|
|
220
|
+
name: (state_name) @local.definition)
|
|
221
|
+
|
|
222
|
+
[
|
|
223
|
+
(state_named_declaration
|
|
224
|
+
name: (state_name) @local.definition)
|
|
225
|
+
(state_pseudostate_declaration
|
|
226
|
+
name: (state_name) @local.definition)
|
|
227
|
+
(state_composite_declaration
|
|
228
|
+
name: (state_name) @local.definition)
|
|
229
|
+
]
|
|
230
|
+
|
|
231
|
+
(state_reference) @local.reference
|
|
232
|
+
|
|
233
|
+
; Swimlane.
|
|
234
|
+
(swimlane_vertex
|
|
235
|
+
id: (swimlane_node_id) @local.definition
|
|
236
|
+
shape: (_))
|
|
237
|
+
|
|
238
|
+
(swimlane_vertex
|
|
239
|
+
id: (swimlane_node_id) @local.reference
|
|
240
|
+
!shape)
|
|
241
|
+
|
|
242
|
+
(swimlane_class_assignment_statement
|
|
243
|
+
targets: (swimlane_identifier_list
|
|
244
|
+
item: (swimlane_reference) @local.reference))
|
|
245
|
+
|
|
246
|
+
(swimlane_style_statement
|
|
247
|
+
target: (swimlane_node_id) @local.reference)
|
|
248
|
+
|
|
249
|
+
(swimlane_click_statement
|
|
250
|
+
target: (swimlane_node_id) @local.reference)
|
|
251
|
+
|
|
252
|
+
; Venn.
|
|
253
|
+
(venn_set_statement
|
|
254
|
+
expression: (venn_set_expression
|
|
255
|
+
set: (venn_identifier) @local.definition))
|
|
256
|
+
|
|
257
|
+
(venn_intersection_expression
|
|
258
|
+
set: (venn_identifier) @local.reference)
|
|
259
|
+
|
|
260
|
+
; Wardley.
|
|
261
|
+
[
|
|
262
|
+
(wardley_component_statement
|
|
263
|
+
name: (wardley_name) @local.definition)
|
|
264
|
+
(wardley_anchor_statement
|
|
265
|
+
name: (wardley_name) @local.definition)
|
|
266
|
+
]
|
|
267
|
+
|
|
268
|
+
(wardley_link_statement
|
|
269
|
+
source: (wardley_name) @local.reference)
|
|
270
|
+
|
|
271
|
+
(wardley_link_statement
|
|
272
|
+
target: (wardley_name) @local.reference)
|
|
273
|
+
|
|
274
|
+
(wardley_evolve_statement
|
|
275
|
+
component: (wardley_name) @local.reference)
|
|
276
|
+
|
|
277
|
+
; ZenUML.
|
|
278
|
+
[
|
|
279
|
+
(zenuml_starter_declaration
|
|
280
|
+
participant: (zenuml_name) @local.definition)
|
|
281
|
+
(zenuml_participant_declaration
|
|
282
|
+
name: (zenuml_name) @local.definition)
|
|
283
|
+
]
|
|
284
|
+
|
|
285
|
+
(zenuml_assignment
|
|
286
|
+
assignee: (zenuml_assignee
|
|
287
|
+
item: (zenuml_identifier) @local.definition))
|
|
288
|
+
|
|
289
|
+
(zenuml_endpoint
|
|
290
|
+
name: (zenuml_name) @local.reference)
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
; Portable tags describe stable named declarations. Narrative-only families
|
|
2
|
+
; stay explicitly not applicable rather than receiving synthetic diagram tags.
|
|
3
|
+
|
|
4
|
+
; Architecture.
|
|
5
|
+
(architecture_group_statement
|
|
6
|
+
id: (architecture_identifier) @name) @definition.module
|
|
7
|
+
|
|
8
|
+
[
|
|
9
|
+
(architecture_service_statement
|
|
10
|
+
id: (architecture_identifier) @name)
|
|
11
|
+
(architecture_junction_statement
|
|
12
|
+
id: (architecture_identifier) @name)
|
|
13
|
+
] @definition.class
|
|
14
|
+
|
|
15
|
+
; Block.
|
|
16
|
+
(block_node
|
|
17
|
+
id: (block_identifier) @name
|
|
18
|
+
shape: (_)) @definition.var
|
|
19
|
+
|
|
20
|
+
; C4.
|
|
21
|
+
(c4_boundary_statement
|
|
22
|
+
id: (c4_reference
|
|
23
|
+
value: (c4_identifier) @name)) @definition.module
|
|
24
|
+
|
|
25
|
+
(c4_entity_declaration
|
|
26
|
+
id: (c4_reference
|
|
27
|
+
value: (c4_identifier) @name)) @definition.class
|
|
28
|
+
|
|
29
|
+
; Class.
|
|
30
|
+
(class_namespace_declaration
|
|
31
|
+
name: (class_namespace_name
|
|
32
|
+
(identifier) @name)) @definition.module
|
|
33
|
+
|
|
34
|
+
(class_declaration
|
|
35
|
+
name: (class_name
|
|
36
|
+
(identifier) @name)) @definition.class
|
|
37
|
+
|
|
38
|
+
; Entity Relationship.
|
|
39
|
+
(er_entity_declaration
|
|
40
|
+
name: (er_entity_name) @name) @definition.class
|
|
41
|
+
|
|
42
|
+
; Event Modeling.
|
|
43
|
+
(event_entity_statement
|
|
44
|
+
name: (event_qualified_name) @name) @definition.class
|
|
45
|
+
|
|
46
|
+
(event_data_statement
|
|
47
|
+
name: (event_data_name) @name) @definition.var
|
|
48
|
+
|
|
49
|
+
; Flowchart.
|
|
50
|
+
(flow_subgraph
|
|
51
|
+
id: (flow_node_id) @name) @definition.module
|
|
52
|
+
|
|
53
|
+
(flow_vertex
|
|
54
|
+
id: (flow_node_id) @name
|
|
55
|
+
shape: (_)) @definition.var
|
|
56
|
+
|
|
57
|
+
; Gantt.
|
|
58
|
+
(gantt_section_statement
|
|
59
|
+
name: (gantt_line_text) @name) @definition.module
|
|
60
|
+
|
|
61
|
+
(gantt_task_statement
|
|
62
|
+
metadata: (gantt_task_metadata
|
|
63
|
+
(gantt_task_item
|
|
64
|
+
value: (gantt_task_atom) @name))) @definition.function
|
|
65
|
+
|
|
66
|
+
; GitGraph.
|
|
67
|
+
(git_graph_branch_statement
|
|
68
|
+
name: (git_graph_reference) @name) @definition.module
|
|
69
|
+
|
|
70
|
+
; Journey.
|
|
71
|
+
(journey_section_statement
|
|
72
|
+
section: (journey_section_name) @name) @definition.module
|
|
73
|
+
|
|
74
|
+
(journey_task_statement
|
|
75
|
+
task: (journey_task_name) @name) @definition.function
|
|
76
|
+
|
|
77
|
+
; Kanban.
|
|
78
|
+
(kanban_item
|
|
79
|
+
id: (kanban_item_id) @name) @definition.var
|
|
80
|
+
|
|
81
|
+
; Mindmap.
|
|
82
|
+
(mindmap_node
|
|
83
|
+
id: (mindmap_node_id) @name) @definition.var
|
|
84
|
+
|
|
85
|
+
; Radar.
|
|
86
|
+
[
|
|
87
|
+
(radar_axis
|
|
88
|
+
name: (radar_identifier) @name)
|
|
89
|
+
(radar_curve
|
|
90
|
+
name: (radar_identifier) @name)
|
|
91
|
+
] @definition.var
|
|
92
|
+
|
|
93
|
+
; Railroad constructor dialect.
|
|
94
|
+
(railroad_rule
|
|
95
|
+
name: (railroad_identifier) @name) @definition.function
|
|
96
|
+
|
|
97
|
+
; Railroad ABNF.
|
|
98
|
+
(railroad_abnf_rule
|
|
99
|
+
name: (railroad_abnf_rule_name) @name) @definition.function
|
|
100
|
+
|
|
101
|
+
; Railroad EBNF.
|
|
102
|
+
(railroad_ebnf_rule
|
|
103
|
+
name: (railroad_ebnf_identifier) @name) @definition.function
|
|
104
|
+
|
|
105
|
+
; Railroad PEG.
|
|
106
|
+
(railroad_peg_rule
|
|
107
|
+
name: (railroad_peg_identifier) @name) @definition.function
|
|
108
|
+
|
|
109
|
+
; Requirement.
|
|
110
|
+
[
|
|
111
|
+
(requirement_declaration
|
|
112
|
+
name: (requirement_name) @name)
|
|
113
|
+
(requirement_element_declaration
|
|
114
|
+
name: (requirement_name) @name)
|
|
115
|
+
] @definition.class
|
|
116
|
+
|
|
117
|
+
; Sequence.
|
|
118
|
+
(sequence_participant_declaration
|
|
119
|
+
name: (sequence_participant_name) @name) @definition.class
|
|
120
|
+
|
|
121
|
+
; State.
|
|
122
|
+
(state_alias_clause
|
|
123
|
+
name: (state_name) @name) @definition.class
|
|
124
|
+
|
|
125
|
+
[
|
|
126
|
+
(state_named_declaration
|
|
127
|
+
name: (state_name) @name)
|
|
128
|
+
(state_pseudostate_declaration
|
|
129
|
+
name: (state_name) @name)
|
|
130
|
+
] @definition.class
|
|
131
|
+
|
|
132
|
+
(state_composite_declaration
|
|
133
|
+
name: (state_name) @name) @definition.module
|
|
134
|
+
|
|
135
|
+
; Swimlane.
|
|
136
|
+
(swimlane_subgraph
|
|
137
|
+
id: (swimlane_node_id) @name) @definition.module
|
|
138
|
+
|
|
139
|
+
(swimlane_vertex
|
|
140
|
+
id: (swimlane_node_id) @name
|
|
141
|
+
shape: (_)) @definition.var
|
|
142
|
+
|
|
143
|
+
; Timeline.
|
|
144
|
+
(timeline_section_statement
|
|
145
|
+
name: (timeline_section_name) @name) @definition.module
|
|
146
|
+
|
|
147
|
+
; Tree View.
|
|
148
|
+
(tree_view_node
|
|
149
|
+
name: (_) @name) @definition.var
|
|
150
|
+
|
|
151
|
+
; Treemap.
|
|
152
|
+
[
|
|
153
|
+
(treemap_section
|
|
154
|
+
name: (_) @name)
|
|
155
|
+
(treemap_leaf
|
|
156
|
+
name: (_) @name)
|
|
157
|
+
] @definition.var
|
|
158
|
+
|
|
159
|
+
; Venn.
|
|
160
|
+
(venn_set_statement
|
|
161
|
+
expression: (venn_set_expression
|
|
162
|
+
set: (venn_identifier) @name)) @definition.var
|
|
163
|
+
|
|
164
|
+
; Wardley.
|
|
165
|
+
[
|
|
166
|
+
(wardley_component_statement
|
|
167
|
+
name: (wardley_name) @name)
|
|
168
|
+
(wardley_anchor_statement
|
|
169
|
+
name: (wardley_name) @name)
|
|
170
|
+
] @definition.var
|
|
171
|
+
|
|
172
|
+
; ZenUML.
|
|
173
|
+
[
|
|
174
|
+
(zenuml_starter_declaration
|
|
175
|
+
participant: (zenuml_name) @name)
|
|
176
|
+
(zenuml_participant_declaration
|
|
177
|
+
name: (zenuml_name) @name)
|
|
178
|
+
] @definition.class
|
|
179
|
+
|
|
180
|
+
(zenuml_assignment
|
|
181
|
+
assignee: (zenuml_assignee
|
|
182
|
+
item: (zenuml_identifier) @name)) @definition.var
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Zed query profile
|
|
2
|
+
|
|
3
|
+
This directory is a pre-1.0 Zed-specific adapter, not a portable Tree-sitter
|
|
4
|
+
query ABI. A downstream Zed extension must pin a released grammar revision and
|
|
5
|
+
validate these queries against the Zed version it supports.
|
|
6
|
+
|
|
7
|
+
Zed's loader at `crates/language_core/src/queries.rs` recognizes ten query
|
|
8
|
+
prefixes. Six of the nine project surfaces are native to that loader:
|
|
9
|
+
|
|
10
|
+
| Project surface | Zed query | Family coverage | Capture contract |
|
|
11
|
+
| --- | --- | ---: | --- |
|
|
12
|
+
| highlights | `highlights.scm` | 35/35 | Zed theme captures |
|
|
13
|
+
| brackets | `brackets.scm` | 25/35 | `open`, `close` |
|
|
14
|
+
| outline | `outline.scm` | 35/35 | required `item`, `name`; optional Zed outline captures |
|
|
15
|
+
| indents | `indents.scm` | 23/35 | required `indent`; optional `start`, `end`, `outdent`, `start.*` |
|
|
16
|
+
| injections | `injections.scm` | 35/35 | `injection.content` plus a fixed `injection.language` property |
|
|
17
|
+
| textobjects | `textobjects.scm` | 35/35 | Zed's function/class/comment Vim text objects |
|
|
18
|
+
| folds | none | 0/35 | Zed does not load `folds.scm` |
|
|
19
|
+
| locals | none | 0/35 | Zed does not load `locals.scm` |
|
|
20
|
+
| tags | none | 0/35 | Zed does not load `tags.scm` |
|
|
21
|
+
|
|
22
|
+
The highlight query preserves the portable query's semantic patterns while
|
|
23
|
+
mapping captures that are outside Zed's documented theme vocabulary:
|
|
24
|
+
|
|
25
|
+
| Portable capture | Zed capture |
|
|
26
|
+
| --- | --- |
|
|
27
|
+
| `comment.documentation` | `comment.doc` |
|
|
28
|
+
| `function.macro` | `function` |
|
|
29
|
+
| `keyword.operator` | `operator` |
|
|
30
|
+
| `namespace` | `type` |
|
|
31
|
+
| `variable.member` | `property` |
|
|
32
|
+
|
|
33
|
+
Bracket matching is not applicable to Cynefin, Git Graph, Info, Ishikawa,
|
|
34
|
+
Journey, Packet, Pie, Timeline, Tree View, or Treemap because their v1 CSTs do
|
|
35
|
+
not expose coherent source-owned delimiter pairs. Indentation is additionally
|
|
36
|
+
not applicable to Sankey or Venn. Ishikawa, Tree View, and Treemap already use
|
|
37
|
+
scanner-owned semantic indentation, while Venn only has inline label
|
|
38
|
+
delimiters.
|
|
39
|
+
|
|
40
|
+
All injection fixtures include Mermaid frontmatter, which Zed injects as YAML.
|
|
41
|
+
XY Chart also exposes delimiter-free Markdown payload nodes as
|
|
42
|
+
`markdown-inline`. Outline and text-object fixtures exercise every family;
|
|
43
|
+
bracket and indent fixtures exist only for applicable cells.
|
|
44
|
+
|
|
45
|
+
Merman's package tests compile every shipped query against the generated
|
|
46
|
+
language. Loader-specific behavior and representative captures belong in the
|
|
47
|
+
downstream Zed extension change rather than a duplicated package-owned 35 x 9
|
|
48
|
+
matrix.
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
; Zed bracket-pair profile. Capture names follow Zed's brackets query ABI.
|
|
2
|
+
|
|
3
|
+
; Anonymous delimiter pairs used by block, expression, and shape productions.
|
|
4
|
+
("(" @open ")" @close)
|
|
5
|
+
("[" @open "]" @close)
|
|
6
|
+
("{" @open "}" @close)
|
|
7
|
+
|
|
8
|
+
; Family-owned named delimiters preserve exact source ranges.
|
|
9
|
+
(_
|
|
10
|
+
open: (block_shape_delimiter) @open
|
|
11
|
+
close: (block_shape_delimiter) @close)
|
|
12
|
+
|
|
13
|
+
(_
|
|
14
|
+
open: (flow_shape_delimiter) @open
|
|
15
|
+
close: (flow_shape_delimiter) @close)
|
|
16
|
+
|
|
17
|
+
(_
|
|
18
|
+
open: (swimlane_shape_delimiter) @open
|
|
19
|
+
close: (swimlane_shape_delimiter) @close)
|
|
20
|
+
|
|
21
|
+
(_
|
|
22
|
+
open: (mindmap_shape_delimiter) @open
|
|
23
|
+
close: (mindmap_shape_delimiter) @close)
|
|
24
|
+
|
|
25
|
+
(_
|
|
26
|
+
open: (mindmap_decorator_delimiter) @open
|
|
27
|
+
close: (mindmap_decorator_delimiter) @close)
|
|
28
|
+
|
|
29
|
+
(_
|
|
30
|
+
open: (kanban_shape_delimiter) @open
|
|
31
|
+
close: (kanban_shape_delimiter) @close)
|
|
32
|
+
|
|
33
|
+
(_
|
|
34
|
+
open: (kanban_decorator_delimiter) @open
|
|
35
|
+
close: (kanban_decorator_delimiter) @close)
|
|
36
|
+
|
|
37
|
+
(_
|
|
38
|
+
open: (kanban_metadata_delimiter) @open
|
|
39
|
+
close: (kanban_metadata_delimiter) @close)
|
|
40
|
+
|
|
41
|
+
(_
|
|
42
|
+
open: (venn_label_delimiter) @open
|
|
43
|
+
close: (venn_label_delimiter) @close)
|
|
44
|
+
|
|
45
|
+
((sankey_quoted_field
|
|
46
|
+
open: (sankey_quote) @open
|
|
47
|
+
close: (sankey_quote) @close)
|
|
48
|
+
(#set! rainbow.exclude))
|
|
49
|
+
|
|
50
|
+
((_
|
|
51
|
+
open: (xy_chart_quote_delimiter) @open
|
|
52
|
+
close: (xy_chart_quote_delimiter) @close)
|
|
53
|
+
(#set! rainbow.exclude))
|
|
54
|
+
|
|
55
|
+
((_
|
|
56
|
+
open: (xy_chart_markdown_delimiter) @open
|
|
57
|
+
close: (xy_chart_markdown_delimiter) @close)
|
|
58
|
+
(#set! rainbow.exclude))
|
|
59
|
+
|
|
60
|
+
; XY arrays expose dedicated named open and close nodes.
|
|
61
|
+
(xy_chart_category_array
|
|
62
|
+
open: (xy_chart_array_open) @open
|
|
63
|
+
close: (xy_chart_array_close) @close)
|
|
64
|
+
|
|
65
|
+
(xy_chart_series_array
|
|
66
|
+
open: (xy_chart_array_open) @open
|
|
67
|
+
close: (xy_chart_array_close) @close)
|
|
68
|
+
|
|
69
|
+
; Mermaid's keyword-delimited blocks are bracket pairs in Zed as well.
|
|
70
|
+
(block_composite_statement
|
|
71
|
+
keyword: (block_statement_keyword) @open
|
|
72
|
+
end: (block_end) @close)
|
|
73
|
+
|
|
74
|
+
(flow_subgraph
|
|
75
|
+
keyword: (flow_statement_keyword) @open
|
|
76
|
+
end: (flow_subgraph_end) @close)
|
|
77
|
+
|
|
78
|
+
(swimlane_subgraph
|
|
79
|
+
keyword: (swimlane_statement_keyword) @open
|
|
80
|
+
end: (swimlane_subgraph_end) @close)
|
|
81
|
+
|
|
82
|
+
[
|
|
83
|
+
(sequence_alt_block
|
|
84
|
+
keyword: (sequence_block_keyword) @open
|
|
85
|
+
end: (sequence_block_end) @close)
|
|
86
|
+
(sequence_box_block
|
|
87
|
+
keyword: (sequence_block_keyword) @open
|
|
88
|
+
end: (sequence_block_end) @close)
|
|
89
|
+
(sequence_break_block
|
|
90
|
+
keyword: (sequence_block_keyword) @open
|
|
91
|
+
end: (sequence_block_end) @close)
|
|
92
|
+
(sequence_critical_block
|
|
93
|
+
keyword: (sequence_block_keyword) @open
|
|
94
|
+
end: (sequence_block_end) @close)
|
|
95
|
+
(sequence_loop_block
|
|
96
|
+
keyword: (sequence_block_keyword) @open
|
|
97
|
+
end: (sequence_block_end) @close)
|
|
98
|
+
(sequence_opt_block
|
|
99
|
+
keyword: (sequence_block_keyword) @open
|
|
100
|
+
end: (sequence_block_end) @close)
|
|
101
|
+
(sequence_par_block
|
|
102
|
+
keyword: (sequence_block_keyword) @open
|
|
103
|
+
end: (sequence_block_end) @close)
|
|
104
|
+
(sequence_rect_block
|
|
105
|
+
keyword: (sequence_block_keyword) @open
|
|
106
|
+
end: (sequence_block_end) @close)
|
|
107
|
+
]
|
|
108
|
+
|
|
109
|
+
(state_multiline_note
|
|
110
|
+
keyword: (state_statement_keyword) @open
|
|
111
|
+
end: (state_note_end) @close)
|