Files
storybook/tree-sitter-storybook/queries/indents.scm

46 lines
703 B
Scheme

; Indentation query for Storybook DSL
; Increase indent after opening braces
[
"{"
"("
"["
] @indent.begin
; Decrease indent before closing braces
[
"}"
")"
"]"
] @indent.end
; Special handling for prose blocks
(prose_block
marker: (prose_marker) @indent.begin
content: (_)
end: (_) @indent.end
)
; Block structures that should indent their contents
[
(block)
(character)
(template)
(life_arc)
(arc_state)
(schedule)
(schedule_block)
(behavior)
(institution)
(relationship)
(location)
(species)
(enum_declaration)
(selector_node)
(sequence_node)
(repeat_node)
] @indent.begin
; Dedent after semicolon at top level
(use_declaration ";" @indent.end)