nvim-treesitter/queries/gleam/indents.scm

34 lines
605 B
Scheme
Raw Normal View History

2022-02-06 12:48:38 -08:00
; Gleam indents similar to Rust and JavaScript
[
2022-02-12 15:12:05 -08:00
(assert)
2022-02-06 12:48:38 -08:00
(case)
(case_clause)
(constant)
(expression_group)
2022-02-12 15:12:05 -08:00
(external_function)
2022-02-06 12:48:38 -08:00
(function)
2022-02-12 15:12:05 -08:00
(import)
2022-02-06 12:48:38 -08:00
(let)
(list)
2022-02-12 15:12:05 -08:00
(public_constant)
(public_external_function)
2022-02-06 12:48:38 -08:00
(public_function)
(public_opaque_type_definition)
2022-02-12 15:12:05 -08:00
(public_type_alias)
2022-02-06 12:48:38 -08:00
(public_type_definition)
2022-02-12 15:12:05 -08:00
(todo)
(try)
2022-02-06 12:48:38 -08:00
(tuple)
2022-02-12 15:12:05 -08:00
(type_alias)
2022-02-06 12:48:38 -08:00
(type_definition)
] @indent
[
")"
"]"
"}"
] @indent_end @branch
2022-02-12 15:12:05 -08:00
; Gleam pipelines are not indented, but other binary expression chains are
((binary_expression operator: _ @_operator) @indent (#not-eq? @_operator "|>"))