Skip to content

Commit

Permalink
Merge pull request #134 from ember-tooling/support-indents-and-folding
Browse files Browse the repository at this point in the history
Support indents and folding
  • Loading branch information
NullVoxPopuli committed Mar 19, 2024
2 parents 5dc6d10 + 2c2cf7c commit 6b25d26
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
4 changes: 4 additions & 0 deletions queries/folds.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[
(element_node (element_node_start))
(block_statement)
] @fold
22 changes: 22 additions & 0 deletions queries/indents.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
(element_node (element_node_start))
(element_node_void)
(block_statement (block_statement_start))
(mustache_statement)
] @indent.begin

(element_node (element_node_end [">"] @indent.end))
(element_node_void "/>" @indent.end)
[
">"
"/>"
"</"
"{{/"
"}}"
] @indent.branch

(mustache_statement
(helper_invocation helper: (identifier) @_identifier (#lua-match? @_identifier "else"))
) @indent.branch
(mustache_statement ((identifier) @_identifier (#lua-match? @_identifier "else"))) @indent.branch
(comment_statement) @indent.ignore
9 changes: 9 additions & 0 deletions queries/locals.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[
(element_node)
(block_statement)
] @local.scope

(identifier) @local.reference

(block_params
(identifier) @local.definition.var)

0 comments on commit 6b25d26

Please sign in to comment.