@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
|
+
; Helix indentation is only claimed for CST containers whose source range owns
|
|
2
|
+
; both an opener and a closer. Flat/indentation-scanner families are explicit
|
|
3
|
+
; N/A until their CST exposes nested parent ranges Helix can traverse.
|
|
4
|
+
|
|
5
|
+
[
|
|
6
|
+
(block_composite_statement)
|
|
7
|
+
(c4_boundary_statement)
|
|
8
|
+
(class_namespace_declaration)
|
|
9
|
+
(class_member_block)
|
|
10
|
+
(event_data_block)
|
|
11
|
+
(event_nested_data_block)
|
|
12
|
+
(flow_subgraph)
|
|
13
|
+
(requirement_declaration)
|
|
14
|
+
(requirement_element_declaration)
|
|
15
|
+
(sequence_alt_block)
|
|
16
|
+
(sequence_box_block)
|
|
17
|
+
(sequence_break_block)
|
|
18
|
+
(sequence_critical_block)
|
|
19
|
+
(sequence_loop_block)
|
|
20
|
+
(sequence_opt_block)
|
|
21
|
+
(sequence_par_block)
|
|
22
|
+
(sequence_rect_block)
|
|
23
|
+
(state_composite_declaration)
|
|
24
|
+
(swimlane_subgraph)
|
|
25
|
+
(zenuml_block)
|
|
26
|
+
(zenuml_group_block)
|
|
27
|
+
] @indent
|
|
28
|
+
|
|
29
|
+
[
|
|
30
|
+
(block_end)
|
|
31
|
+
(flow_subgraph_end)
|
|
32
|
+
(sequence_block_end)
|
|
33
|
+
(swimlane_subgraph_end)
|
|
34
|
+
] @outdent
|
|
35
|
+
|
|
36
|
+
(c4_boundary_statement close: "}" @outdent)
|
|
37
|
+
(class_namespace_declaration close: "}" @outdent)
|
|
38
|
+
(class_member_block close: "}" @outdent)
|
|
39
|
+
(event_data_block close: "}" @outdent)
|
|
40
|
+
(event_nested_data_block close: "}" @outdent)
|
|
41
|
+
(requirement_declaration close: "}" @outdent)
|
|
42
|
+
(requirement_element_declaration close: "}" @outdent)
|
|
43
|
+
(state_composite_declaration close: "}" @outdent)
|
|
44
|
+
(zenuml_block close: "}" @outdent)
|
|
45
|
+
(zenuml_group_block close: "}" @outdent)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
; Helix 25.07.1 consumes this file through SyntaxConfig::new.
|
|
2
|
+
; Frontmatter content excludes Mermaid's --- delimiters, so the combined ranges
|
|
3
|
+
; form a valid YAML document for every Mermaid family.
|
|
4
|
+
|
|
5
|
+
((frontmatter_content) @injection.content
|
|
6
|
+
(#set! injection.language "yaml")
|
|
7
|
+
(#set! injection.combined))
|
|
8
|
+
|
|
9
|
+
((comment) @injection.content
|
|
10
|
+
(#set! injection.language "comment"))
|
|
11
|
+
|
|
12
|
+
; Markdown-looking Mermaid labels are intentionally not injected yet. Most
|
|
13
|
+
; family CST nodes still own their quote/backtick delimiters, and Helix does
|
|
14
|
+
; not implement Neovim's query offset directive. Injecting those nodes would
|
|
15
|
+
; hand invalid Markdown ranges to the child parser.
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
; Helix local scopes are diagram-local: Mermaid identifiers do not cross a
|
|
2
|
+
; diagram boundary. Only families with a syntactic definition/reference split
|
|
3
|
+
; are included; label-only and record-only families are explicit N/A cells.
|
|
4
|
+
|
|
5
|
+
[
|
|
6
|
+
(architecture_body)
|
|
7
|
+
(block_body)
|
|
8
|
+
(c4_body)
|
|
9
|
+
(c4_boundary_body)
|
|
10
|
+
(class_body)
|
|
11
|
+
(class_namespace_body)
|
|
12
|
+
(entity_relationship_body)
|
|
13
|
+
(flow_body)
|
|
14
|
+
(flow_subgraph)
|
|
15
|
+
(git_graph_body)
|
|
16
|
+
(requirement_body)
|
|
17
|
+
(sequence_body)
|
|
18
|
+
(state_body)
|
|
19
|
+
(state_composite_declaration)
|
|
20
|
+
(swimlane_body)
|
|
21
|
+
(swimlane_subgraph)
|
|
22
|
+
(venn_body)
|
|
23
|
+
(railroad_body)
|
|
24
|
+
(railroad_abnf_body)
|
|
25
|
+
(railroad_ebnf_body)
|
|
26
|
+
(railroad_peg_body)
|
|
27
|
+
(zenuml_body)
|
|
28
|
+
(zenuml_block)
|
|
29
|
+
(zenuml_group_block)
|
|
30
|
+
] @local.scope
|
|
31
|
+
|
|
32
|
+
; Architecture.
|
|
33
|
+
[
|
|
34
|
+
(architecture_group_statement id: (architecture_identifier) @local.definition.namespace)
|
|
35
|
+
(architecture_service_statement id: (architecture_identifier) @local.definition.variable)
|
|
36
|
+
(architecture_junction_statement id: (architecture_identifier) @local.definition.variable)
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
(architecture_parent_clause parent: (architecture_identifier) @local.reference)
|
|
40
|
+
(architecture_edge_endpoint id: (architecture_identifier) @local.reference)
|
|
41
|
+
(architecture_alignment_statement member: (architecture_identifier) @local.reference)
|
|
42
|
+
|
|
43
|
+
; Block diagrams.
|
|
44
|
+
(block_node_statement
|
|
45
|
+
node: (block_node id: (block_identifier) @local.definition.variable))
|
|
46
|
+
(block_composite_statement
|
|
47
|
+
node: (block_node id: (block_identifier) @local.definition.variable))
|
|
48
|
+
(block_edge_statement
|
|
49
|
+
source: (block_node id: (block_identifier) @local.reference)
|
|
50
|
+
target: (block_node id: (block_identifier) @local.reference))
|
|
51
|
+
|
|
52
|
+
; C4.
|
|
53
|
+
(c4_boundary_statement id: (c4_reference) @local.definition.namespace)
|
|
54
|
+
(c4_entity_declaration id: (c4_reference) @local.definition.variable)
|
|
55
|
+
(c4_relationship_statement
|
|
56
|
+
source: (c4_reference) @local.reference
|
|
57
|
+
target: (c4_reference) @local.reference)
|
|
58
|
+
(c4_style_update_statement
|
|
59
|
+
source: (c4_reference)? @local.reference
|
|
60
|
+
target: (c4_reference)? @local.reference)
|
|
61
|
+
|
|
62
|
+
; Class and entity-relationship diagrams.
|
|
63
|
+
(class_namespace_declaration name: (class_namespace_name) @local.definition.namespace)
|
|
64
|
+
(class_declaration name: (class_name) @local.definition.type)
|
|
65
|
+
(class_reference) @local.reference
|
|
66
|
+
|
|
67
|
+
(er_entity_declaration name: (er_entity_name) @local.definition.type)
|
|
68
|
+
(er_relationship
|
|
69
|
+
source: (er_entity_reference) @local.reference
|
|
70
|
+
target: (er_entity_reference) @local.reference)
|
|
71
|
+
|
|
72
|
+
; Flowchart and swimlane explicit definitions plus references.
|
|
73
|
+
(flow_subgraph id: (flow_node_id) @local.definition.namespace)
|
|
74
|
+
(flow_node_statement
|
|
75
|
+
node: (flow_node
|
|
76
|
+
vertex: (flow_vertex id: (flow_node_id) @local.definition.variable)))
|
|
77
|
+
(flow_edge_statement
|
|
78
|
+
source: (flow_node (flow_vertex id: (flow_node_id) @local.reference))
|
|
79
|
+
target: (flow_node (flow_vertex id: (flow_node_id) @local.reference)))
|
|
80
|
+
(flow_reference) @local.reference
|
|
81
|
+
|
|
82
|
+
(swimlane_subgraph id: (swimlane_node_id) @local.definition.namespace)
|
|
83
|
+
(swimlane_node_statement
|
|
84
|
+
node: (swimlane_node
|
|
85
|
+
vertex: (swimlane_vertex id: (swimlane_node_id) @local.definition.variable)))
|
|
86
|
+
(swimlane_edge_statement
|
|
87
|
+
source: (swimlane_node (swimlane_vertex id: (swimlane_node_id) @local.reference))
|
|
88
|
+
target: (swimlane_node (swimlane_vertex id: (swimlane_node_id) @local.reference)))
|
|
89
|
+
(swimlane_reference) @local.reference
|
|
90
|
+
|
|
91
|
+
; GitGraph.
|
|
92
|
+
(git_graph_branch_statement name: (_) @local.definition.variable)
|
|
93
|
+
(git_graph_checkout_statement branch: (_) @local.reference)
|
|
94
|
+
(git_graph_merge_statement branch: (_) @local.reference)
|
|
95
|
+
|
|
96
|
+
; Requirements.
|
|
97
|
+
(requirement_declaration name: (requirement_name) @local.definition.variable)
|
|
98
|
+
(requirement_element_declaration name: (requirement_name) @local.definition.variable)
|
|
99
|
+
(requirement_relationship_statement
|
|
100
|
+
source: (requirement_reference) @local.reference
|
|
101
|
+
target: (requirement_reference) @local.reference)
|
|
102
|
+
|
|
103
|
+
; Sequence and state diagrams.
|
|
104
|
+
(sequence_participant_declaration
|
|
105
|
+
name: (sequence_participant_name) @local.definition.type)
|
|
106
|
+
(sequence_actor_reference) @local.reference
|
|
107
|
+
|
|
108
|
+
(state_named_declaration name: (state_name) @local.definition.variable)
|
|
109
|
+
(state_composite_declaration name: (state_name) @local.definition.namespace)
|
|
110
|
+
(state_alias_declaration
|
|
111
|
+
alias: (state_alias_clause name: (state_name) @local.definition.variable))
|
|
112
|
+
(state_reference) @local.reference
|
|
113
|
+
|
|
114
|
+
; Venn sets.
|
|
115
|
+
(venn_set_statement
|
|
116
|
+
expression: (venn_set_expression set: (venn_identifier) @local.definition.variable))
|
|
117
|
+
(venn_intersection_expression set: (venn_identifier) @local.reference)
|
|
118
|
+
|
|
119
|
+
; Railroad dialect rule definitions and references.
|
|
120
|
+
(railroad_rule name: (railroad_identifier) @local.definition.function)
|
|
121
|
+
(railroad_reference name: (_) @local.reference)
|
|
122
|
+
(railroad_abnf_rule name: (railroad_abnf_rule_name) @local.definition.function)
|
|
123
|
+
(railroad_abnf_reference name: (railroad_abnf_rule_name) @local.reference)
|
|
124
|
+
(railroad_ebnf_rule name: (railroad_ebnf_identifier) @local.definition.function)
|
|
125
|
+
(railroad_ebnf_reference name: (railroad_ebnf_identifier) @local.reference)
|
|
126
|
+
(railroad_peg_rule name: (railroad_peg_identifier) @local.definition.function)
|
|
127
|
+
(railroad_peg_reference name: (railroad_peg_identifier) @local.reference)
|
|
128
|
+
|
|
129
|
+
; ZenUML participants and groups.
|
|
130
|
+
(zenuml_participant_declaration name: (zenuml_name) @local.definition.type)
|
|
131
|
+
(zenuml_starter_declaration participant: (zenuml_name) @local.definition.type)
|
|
132
|
+
(zenuml_group_declaration name: (zenuml_name) @local.definition.namespace)
|
|
133
|
+
(zenuml_endpoint name: (zenuml_name) @local.reference)
|
|
134
|
+
(zenuml_reference_list participant: (zenuml_name) @local.reference)
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
; Helix textobjects use the editor's fixed capture vocabulary. A Mermaid
|
|
2
|
+
; diagram is the outer structural container, and its family body is the inside
|
|
3
|
+
; selection. Direct body children are entry textobjects.
|
|
4
|
+
|
|
5
|
+
; architecture.
|
|
6
|
+
(architecture_diagram
|
|
7
|
+
body: (architecture_body) @class.inside) @class.around
|
|
8
|
+
|
|
9
|
+
; block.
|
|
10
|
+
(block_diagram
|
|
11
|
+
body: (block_body) @class.inside) @class.around
|
|
12
|
+
|
|
13
|
+
; c4.
|
|
14
|
+
(c4_diagram
|
|
15
|
+
body: (c4_body) @class.inside) @class.around
|
|
16
|
+
|
|
17
|
+
; class.
|
|
18
|
+
(class_diagram
|
|
19
|
+
body: (class_body) @class.inside) @class.around
|
|
20
|
+
|
|
21
|
+
; cynefin.
|
|
22
|
+
(cynefin_diagram
|
|
23
|
+
body: (cynefin_body) @class.inside) @class.around
|
|
24
|
+
|
|
25
|
+
; er.
|
|
26
|
+
(entity_relationship_diagram
|
|
27
|
+
body: (entity_relationship_body) @class.inside) @class.around
|
|
28
|
+
|
|
29
|
+
; eventmodeling.
|
|
30
|
+
(event_modeling_diagram
|
|
31
|
+
body: (event_modeling_body) @class.inside) @class.around
|
|
32
|
+
|
|
33
|
+
; flowchart.
|
|
34
|
+
(flowchart_diagram
|
|
35
|
+
body: (flow_body) @class.inside) @class.around
|
|
36
|
+
|
|
37
|
+
; gantt.
|
|
38
|
+
(gantt_diagram
|
|
39
|
+
body: (gantt_body) @class.inside) @class.around
|
|
40
|
+
|
|
41
|
+
; gitgraph.
|
|
42
|
+
(git_graph_diagram
|
|
43
|
+
body: (git_graph_body) @class.inside) @class.around
|
|
44
|
+
|
|
45
|
+
; info.
|
|
46
|
+
(info_diagram
|
|
47
|
+
body: (info_body) @class.inside) @class.around
|
|
48
|
+
|
|
49
|
+
; ishikawa.
|
|
50
|
+
(ishikawa_diagram
|
|
51
|
+
body: (ishikawa_body) @class.inside) @class.around
|
|
52
|
+
|
|
53
|
+
; journey.
|
|
54
|
+
(journey_diagram
|
|
55
|
+
body: (journey_body) @class.inside) @class.around
|
|
56
|
+
|
|
57
|
+
; kanban.
|
|
58
|
+
(kanban_diagram
|
|
59
|
+
body: (kanban_body) @class.inside) @class.around
|
|
60
|
+
|
|
61
|
+
; mindmap.
|
|
62
|
+
(mindmap_diagram
|
|
63
|
+
body: (mindmap_body) @class.inside) @class.around
|
|
64
|
+
|
|
65
|
+
; packet.
|
|
66
|
+
(packet_diagram
|
|
67
|
+
body: (packet_body) @class.inside) @class.around
|
|
68
|
+
|
|
69
|
+
; pie.
|
|
70
|
+
(pie_diagram
|
|
71
|
+
body: (pie_body) @class.inside) @class.around
|
|
72
|
+
|
|
73
|
+
; quadrantchart.
|
|
74
|
+
(quadrant_chart_diagram
|
|
75
|
+
body: (quadrant_chart_body) @class.inside) @class.around
|
|
76
|
+
|
|
77
|
+
; radar.
|
|
78
|
+
(radar_diagram
|
|
79
|
+
body: (radar_body) @class.inside) @class.around
|
|
80
|
+
|
|
81
|
+
; railroad.
|
|
82
|
+
(railroad_diagram
|
|
83
|
+
body: (railroad_body) @class.inside) @class.around
|
|
84
|
+
|
|
85
|
+
; railroadAbnf.
|
|
86
|
+
(railroad_abnf_diagram
|
|
87
|
+
body: (railroad_abnf_body) @class.inside) @class.around
|
|
88
|
+
|
|
89
|
+
; railroadEbnf.
|
|
90
|
+
(railroad_ebnf_diagram
|
|
91
|
+
body: (railroad_ebnf_body) @class.inside) @class.around
|
|
92
|
+
|
|
93
|
+
; railroadPeg.
|
|
94
|
+
(railroad_peg_diagram
|
|
95
|
+
body: (railroad_peg_body) @class.inside) @class.around
|
|
96
|
+
|
|
97
|
+
; requirement.
|
|
98
|
+
(requirement_diagram
|
|
99
|
+
body: (requirement_body) @class.inside) @class.around
|
|
100
|
+
|
|
101
|
+
; sankey.
|
|
102
|
+
(sankey_diagram
|
|
103
|
+
body: (sankey_body) @class.inside) @class.around
|
|
104
|
+
|
|
105
|
+
; sequence.
|
|
106
|
+
(sequence_diagram
|
|
107
|
+
body: (sequence_body) @class.inside) @class.around
|
|
108
|
+
|
|
109
|
+
; state.
|
|
110
|
+
(state_diagram
|
|
111
|
+
body: (state_body) @class.inside) @class.around
|
|
112
|
+
|
|
113
|
+
; swimlane.
|
|
114
|
+
(swimlane_diagram
|
|
115
|
+
body: (swimlane_body) @class.inside) @class.around
|
|
116
|
+
|
|
117
|
+
; timeline.
|
|
118
|
+
(timeline_diagram
|
|
119
|
+
body: (timeline_body) @class.inside) @class.around
|
|
120
|
+
|
|
121
|
+
; treeView.
|
|
122
|
+
(tree_view_diagram
|
|
123
|
+
body: (tree_view_body) @class.inside) @class.around
|
|
124
|
+
|
|
125
|
+
; treemap.
|
|
126
|
+
(treemap_diagram
|
|
127
|
+
body: (treemap_body) @class.inside) @class.around
|
|
128
|
+
|
|
129
|
+
; venn.
|
|
130
|
+
(venn_diagram
|
|
131
|
+
body: (venn_body) @class.inside) @class.around
|
|
132
|
+
|
|
133
|
+
; wardley.
|
|
134
|
+
(wardley_diagram
|
|
135
|
+
body: (wardley_body) @class.inside) @class.around
|
|
136
|
+
|
|
137
|
+
; xychart.
|
|
138
|
+
(xy_chart_diagram
|
|
139
|
+
body: (xy_chart_body) @class.inside) @class.around
|
|
140
|
+
|
|
141
|
+
; zenuml.
|
|
142
|
+
(zenuml_diagram
|
|
143
|
+
body: (zenuml_body) @class.inside) @class.around
|
|
144
|
+
|
|
145
|
+
; Top-level family statements and records.
|
|
146
|
+
(architecture_body
|
|
147
|
+
(_) @entry.around)
|
|
148
|
+
(block_body
|
|
149
|
+
(_) @entry.around)
|
|
150
|
+
(c4_body
|
|
151
|
+
(_) @entry.around)
|
|
152
|
+
(class_body
|
|
153
|
+
(_) @entry.around)
|
|
154
|
+
(cynefin_body
|
|
155
|
+
(_) @entry.around)
|
|
156
|
+
(entity_relationship_body
|
|
157
|
+
(_) @entry.around)
|
|
158
|
+
(event_modeling_body
|
|
159
|
+
(_) @entry.around)
|
|
160
|
+
(flow_body
|
|
161
|
+
(_) @entry.around)
|
|
162
|
+
(gantt_body
|
|
163
|
+
(_) @entry.around)
|
|
164
|
+
(git_graph_body
|
|
165
|
+
(_) @entry.around)
|
|
166
|
+
(info_body
|
|
167
|
+
(_) @entry.around)
|
|
168
|
+
(ishikawa_body
|
|
169
|
+
(_) @entry.around)
|
|
170
|
+
(journey_body
|
|
171
|
+
(_) @entry.around)
|
|
172
|
+
(kanban_body
|
|
173
|
+
(_) @entry.around)
|
|
174
|
+
(mindmap_body
|
|
175
|
+
(_) @entry.around)
|
|
176
|
+
(packet_body
|
|
177
|
+
(_) @entry.around)
|
|
178
|
+
(pie_body
|
|
179
|
+
(_) @entry.around)
|
|
180
|
+
(quadrant_chart_body
|
|
181
|
+
(_) @entry.around)
|
|
182
|
+
(radar_body
|
|
183
|
+
(_) @entry.around)
|
|
184
|
+
(railroad_body
|
|
185
|
+
(_) @entry.around)
|
|
186
|
+
(railroad_abnf_body
|
|
187
|
+
(_) @entry.around)
|
|
188
|
+
(railroad_ebnf_body
|
|
189
|
+
(_) @entry.around)
|
|
190
|
+
(railroad_peg_body
|
|
191
|
+
(_) @entry.around)
|
|
192
|
+
(requirement_body
|
|
193
|
+
(_) @entry.around)
|
|
194
|
+
(sankey_body
|
|
195
|
+
(_) @entry.around)
|
|
196
|
+
(sequence_body
|
|
197
|
+
(_) @entry.around)
|
|
198
|
+
(state_body
|
|
199
|
+
(_) @entry.around)
|
|
200
|
+
(swimlane_body
|
|
201
|
+
(_) @entry.around)
|
|
202
|
+
(timeline_body
|
|
203
|
+
(_) @entry.around)
|
|
204
|
+
(tree_view_body
|
|
205
|
+
(_) @entry.around)
|
|
206
|
+
(treemap_body
|
|
207
|
+
(_) @entry.around)
|
|
208
|
+
(venn_body
|
|
209
|
+
(_) @entry.around)
|
|
210
|
+
(wardley_body
|
|
211
|
+
(_) @entry.around)
|
|
212
|
+
(xy_chart_body
|
|
213
|
+
(_) @entry.around)
|
|
214
|
+
(zenuml_body
|
|
215
|
+
(_) @entry.around)
|
|
216
|
+
|
|
217
|
+
; Railroad rules are function-like definitions.
|
|
218
|
+
(railroad_rule
|
|
219
|
+
definition: (railroad_expression) @function.inside) @function.around
|
|
220
|
+
(railroad_abnf_rule
|
|
221
|
+
definition: (railroad_abnf_alternation) @function.inside) @function.around
|
|
222
|
+
(railroad_ebnf_rule
|
|
223
|
+
definition: (railroad_ebnf_choice) @function.inside) @function.around
|
|
224
|
+
(railroad_peg_rule
|
|
225
|
+
definition: (railroad_peg_ordered_choice) @function.inside) @function.around
|
|
226
|
+
|
|
227
|
+
; Argument entries are Helix parameter textobjects.
|
|
228
|
+
(c4_argument) @parameter.around
|
|
229
|
+
(zenuml_argument) @parameter.around
|
|
230
|
+
|
|
231
|
+
; Common and family-owned comments.
|
|
232
|
+
[
|
|
233
|
+
(comment)
|
|
234
|
+
(event_line_comment)
|
|
235
|
+
(event_multiline_comment)
|
|
236
|
+
(journey_hash_comment)
|
|
237
|
+
(railroad_abnf_comment)
|
|
238
|
+
(railroad_block_comment)
|
|
239
|
+
(railroad_ebnf_block_comment)
|
|
240
|
+
(railroad_ebnf_iso_comment)
|
|
241
|
+
(railroad_peg_comment)
|
|
242
|
+
(requirement_hash_comment)
|
|
243
|
+
(sequence_hash_comment)
|
|
244
|
+
(state_hash_comment)
|
|
245
|
+
(timeline_hash_comment)
|
|
246
|
+
(zenuml_comment)
|
|
247
|
+
] @comment.inside
|
|
248
|
+
|
|
249
|
+
[
|
|
250
|
+
(comment)
|
|
251
|
+
(event_line_comment)
|
|
252
|
+
(event_multiline_comment)
|
|
253
|
+
(journey_hash_comment)
|
|
254
|
+
(railroad_abnf_comment)
|
|
255
|
+
(railroad_block_comment)
|
|
256
|
+
(railroad_ebnf_block_comment)
|
|
257
|
+
(railroad_ebnf_iso_comment)
|
|
258
|
+
(railroad_peg_comment)
|
|
259
|
+
(requirement_hash_comment)
|
|
260
|
+
(sequence_hash_comment)
|
|
261
|
+
(state_hash_comment)
|
|
262
|
+
(timeline_hash_comment)
|
|
263
|
+
(zenuml_comment)
|
|
264
|
+
] @comment.around
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Neovim query profile
|
|
2
|
+
|
|
3
|
+
This profile is a pre-1.0 adoption asset for Neovim and nvim-treesitter. It
|
|
4
|
+
targets the language ABI exposed by the committed Mermaid parser, but the
|
|
5
|
+
downstream integration remains responsible for pinning a released repository
|
|
6
|
+
revision and validating it against the Neovim version it supports.
|
|
7
|
+
|
|
8
|
+
`highlights.scm` is an adapter loaded after `queries/portable/highlights.scm`.
|
|
9
|
+
It adds only Neovim's `@spell` capture, so portable syntax captures remain the
|
|
10
|
+
single semantic vocabulary. The other files are complete Neovim query groups.
|
|
11
|
+
Merman's package tests compile the shipped queries against the generated
|
|
12
|
+
language; real Neovim loader behavior is validated when preparing a downstream
|
|
13
|
+
adoption change rather than through a second package-owned capture matrix.
|
|
14
|
+
|
|
15
|
+
The profile follows established consumer conventions:
|
|
16
|
+
|
|
17
|
+
- core/nvim-treesitter: `@fold`, `@indent.*`, `@injection.*`, and
|
|
18
|
+
`@local.*`;
|
|
19
|
+
- Tree-sitter tags: `@definition.*` and `@name`;
|
|
20
|
+
- rainbow-delimiters.nvim: `@container` and `@delimiter`;
|
|
21
|
+
- aerial.nvim: `@symbol`, `@name`, and a `kind` property;
|
|
22
|
+
- nvim-treesitter-textobjects: `@class.*`, `@block.*`, `@function.*`,
|
|
23
|
+
`@conditional.*`, `@loop.*`, `@assignment.*`, `@parameter.*`, and
|
|
24
|
+
`@comment.*`.
|
|
25
|
+
|
|
26
|
+
Query and capture changes are pre-1.0 API changes. Keep them source-reviewed and
|
|
27
|
+
compile-clean, then exercise the affected behavior in the downstream editor
|
|
28
|
+
repository that owns its runtime contract.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
; rainbow-delimiters.nvim-compatible captures. Field-based pairing lets the
|
|
2
|
+
; grammar define the actual delimiter tokens, including named aliases.
|
|
3
|
+
|
|
4
|
+
(_
|
|
5
|
+
open: _ @delimiter
|
|
6
|
+
close: _ @delimiter) @container
|
|
7
|
+
|
|
8
|
+
(architecture_icon
|
|
9
|
+
"(" @delimiter
|
|
10
|
+
")" @delimiter) @container
|
|
11
|
+
|
|
12
|
+
(architecture_title
|
|
13
|
+
"[" @delimiter
|
|
14
|
+
"]" @delimiter) @container
|
|
15
|
+
|
|
16
|
+
(wardley_position
|
|
17
|
+
"[" @delimiter
|
|
18
|
+
"]" @delimiter) @container
|
|
19
|
+
|
|
20
|
+
(wardley_xy_position
|
|
21
|
+
"[" @delimiter
|
|
22
|
+
"]" @delimiter) @container
|
|
23
|
+
|
|
24
|
+
(block_composite_statement
|
|
25
|
+
keyword: (block_statement_keyword) @delimiter
|
|
26
|
+
end: (block_end) @delimiter) @container
|
|
27
|
+
|
|
28
|
+
(flow_subgraph
|
|
29
|
+
keyword: (flow_statement_keyword) @delimiter
|
|
30
|
+
end: (flow_subgraph_end) @delimiter) @container
|
|
31
|
+
|
|
32
|
+
(swimlane_subgraph
|
|
33
|
+
keyword: (swimlane_statement_keyword) @delimiter
|
|
34
|
+
end: (swimlane_subgraph_end) @delimiter) @container
|
|
35
|
+
|
|
36
|
+
[
|
|
37
|
+
(sequence_alt_block
|
|
38
|
+
keyword: (sequence_block_keyword) @delimiter
|
|
39
|
+
end: (sequence_block_end) @delimiter)
|
|
40
|
+
(sequence_box_block
|
|
41
|
+
keyword: (sequence_block_keyword) @delimiter
|
|
42
|
+
end: (sequence_block_end) @delimiter)
|
|
43
|
+
(sequence_break_block
|
|
44
|
+
keyword: (sequence_block_keyword) @delimiter
|
|
45
|
+
end: (sequence_block_end) @delimiter)
|
|
46
|
+
(sequence_critical_block
|
|
47
|
+
keyword: (sequence_block_keyword) @delimiter
|
|
48
|
+
end: (sequence_block_end) @delimiter)
|
|
49
|
+
(sequence_loop_block
|
|
50
|
+
keyword: (sequence_block_keyword) @delimiter
|
|
51
|
+
end: (sequence_block_end) @delimiter)
|
|
52
|
+
(sequence_opt_block
|
|
53
|
+
keyword: (sequence_block_keyword) @delimiter
|
|
54
|
+
end: (sequence_block_end) @delimiter)
|
|
55
|
+
(sequence_par_block
|
|
56
|
+
keyword: (sequence_block_keyword) @delimiter
|
|
57
|
+
end: (sequence_block_end) @delimiter)
|
|
58
|
+
(sequence_rect_block
|
|
59
|
+
keyword: (sequence_block_keyword) @delimiter
|
|
60
|
+
end: (sequence_block_end) @delimiter)
|
|
61
|
+
] @container
|
|
62
|
+
|
|
63
|
+
(state_multiline_note
|
|
64
|
+
keyword: (state_statement_keyword) @delimiter
|
|
65
|
+
end: (state_note_end) @delimiter) @container
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
; Every Mermaid family has one body-level fold. Nested structural folds are
|
|
2
|
+
; additive and deliberately use Neovim's standard @fold capture.
|
|
3
|
+
|
|
4
|
+
(source_file
|
|
5
|
+
(_
|
|
6
|
+
body: (_) @fold))
|
|
7
|
+
|
|
8
|
+
[
|
|
9
|
+
(architecture_accessibility_description_block)
|
|
10
|
+
(block_composite_statement)
|
|
11
|
+
(c4_boundary_statement)
|
|
12
|
+
(class_member_block)
|
|
13
|
+
(class_namespace_declaration)
|
|
14
|
+
(cynefin_domain_block)
|
|
15
|
+
(er_attribute_block)
|
|
16
|
+
(event_data_block)
|
|
17
|
+
(event_nested_data_block)
|
|
18
|
+
(flow_accessibility_description_block)
|
|
19
|
+
(flow_subgraph)
|
|
20
|
+
(gantt_accessibility_description_block)
|
|
21
|
+
(journey_accessibility_description_block)
|
|
22
|
+
(kanban_multiline_label_text)
|
|
23
|
+
(langium_acc_descr_block)
|
|
24
|
+
(mindmap_multiline_label_text)
|
|
25
|
+
(quadrant_chart_accessibility_description_block)
|
|
26
|
+
(radar_accessibility_block)
|
|
27
|
+
(railroad_acc_descr_block)
|
|
28
|
+
(requirement_accessibility_description_block)
|
|
29
|
+
(requirement_declaration)
|
|
30
|
+
(requirement_element_declaration)
|
|
31
|
+
(sequence_alt_block)
|
|
32
|
+
(sequence_and_branch)
|
|
33
|
+
(sequence_box_block)
|
|
34
|
+
(sequence_break_block)
|
|
35
|
+
(sequence_critical_block)
|
|
36
|
+
(sequence_else_branch)
|
|
37
|
+
(sequence_loop_block)
|
|
38
|
+
(sequence_opt_block)
|
|
39
|
+
(sequence_option_branch)
|
|
40
|
+
(sequence_par_block)
|
|
41
|
+
(sequence_rect_block)
|
|
42
|
+
(state_accessibility_description_block)
|
|
43
|
+
(state_composite_declaration)
|
|
44
|
+
(state_multiline_note)
|
|
45
|
+
(swimlane_accessibility_description_block)
|
|
46
|
+
(swimlane_subgraph)
|
|
47
|
+
(timeline_accessibility_description_block)
|
|
48
|
+
(wardley_accessibility_block)
|
|
49
|
+
(wardley_pipeline_statement)
|
|
50
|
+
(xy_chart_accessibility_description_block)
|
|
51
|
+
(zenuml_block)
|
|
52
|
+
(zenuml_group_block)
|
|
53
|
+
] @fold
|