You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tree-sitter comes with a bunch of built-in predicates, which work using the capture names. However, in Topiary, we only allow our formatting capture names, such as @append_hardline, etc. While these work in the predicates, it makes them a bit strange to read. For example:
; Append a space to (foo (bar)) nodes if they begin with a capital letter
(foo
(bar) @append_space
(#match? @append_space "[A-Z].*")
)
While this would just be a nice-to-have, maybe it would be worthwhile whitelisting certain patterns for capture names that have no formatting functionality, but make the predicates more intuitive. For example, allowing @topiary\..+:
Tree-sitter comes with a bunch of built-in predicates, which work using the capture names. However, in Topiary, we only allow our formatting capture names, such as
@append_hardline
, etc. While these work in the predicates, it makes them a bit strange to read. For example:While this would just be a nice-to-have, maybe it would be worthwhile whitelisting certain patterns for capture names that have no formatting functionality, but make the predicates more intuitive. For example, allowing
@topiary\..+
:A potential issue with this is that, IIRC, the number of capture names per node is limited to something unreasonably small (like 3).
The text was updated successfully, but these errors were encountered: