1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
Adding Indent QueriesHelix uses tree-sitter to correctly indent new lines. This requires
a tree-sitter grammar and an Note that it matters where these added indents begin. For example, multiple indent level increases that start on the same line only increase the total indent level by 1. ScopesAdded indents don't always apply to the whole node. For example, in most cases when a node should be indented, we actually only want everything except for its first line to be indented. For this, there are several scopes (more scopes may be added in the future if required):
Every capture type has a default scope which should do the right thing
in most situations. When a different scope is required, this can be
changed by using a Capture Types
PredicatesIn some cases, an S-expression cannot express exactly what pattern should be matched.
For that, tree-sitter allows for predicates to appear anywhere within a pattern,
similar to how The number of arguments depends on the predicate that's used.
Each argument is either a capture (
Additionally, we support some custom predicates for indent queries:
|