mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-12 08:20:05 -04:00
feat(query): indents that reflect the formatter (#6154)
* feat(query): indents that reflect the formatter Indentation queries that reflect the query formatter. Only applicable if `lispoptions=expr:1`
This commit is contained in:
parent
01cdcfb216
commit
455f6586ba
4 changed files with 83 additions and 5 deletions
|
|
@ -1,8 +1,20 @@
|
|||
(list) @indent.begin
|
||||
|
||||
[
|
||||
(list)
|
||||
(named_node)
|
||||
(grouping)
|
||||
(predicate) ; WIP to newline wrap any-of?
|
||||
"["
|
||||
"]"
|
||||
] @indent.begin
|
||||
|
||||
"]" @indent.branch
|
||||
; ERROR node indents
|
||||
(ERROR
|
||||
"(") @indent.begin
|
||||
|
||||
"]" @indent.branch @indent.end
|
||||
|
||||
")" @indent.end
|
||||
|
||||
; Captures always mark the end of a node
|
||||
; Because of that, mark it as indent.end
|
||||
(capture
|
||||
name: (identifier) @indent.end)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue