mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-16 10:20:11 -04:00
fix(format): fix nested grouping indentation (#6128)
This commit is contained in:
parent
5e4b657181
commit
fef26b5eee
2 changed files with 10 additions and 4 deletions
|
|
@ -13,10 +13,11 @@
|
||||||
; NOTE: This query is a bit of a work around for the fact that the dart grammar doesn't
|
; NOTE: This query is a bit of a work around for the fact that the dart grammar doesn't
|
||||||
; specifically identify a node as a function call
|
; specifically identify a node as a function call
|
||||||
(((identifier) @function
|
(((identifier) @function
|
||||||
(#lua-match? @function "^_?[%l]")).
|
(#lua-match? @function "^_?[%l]"))
|
||||||
(selector
|
|
||||||
.
|
.
|
||||||
(argument_part))) @function
|
(selector
|
||||||
|
.
|
||||||
|
(argument_part))) @function
|
||||||
|
|
||||||
; Annotations
|
; Annotations
|
||||||
; --------------------
|
; --------------------
|
||||||
|
|
|
||||||
|
|
@ -206,10 +206,15 @@ local format_queries = [[
|
||||||
(named_node) ; ((foo))
|
(named_node) ; ((foo))
|
||||||
(list) ; ([foo] (...))
|
(list) ; ([foo] (...))
|
||||||
(anonymous_node) ; ("foo")
|
(anonymous_node) ; ("foo")
|
||||||
(grouping . (anonymous_node)) ; (("foo"))
|
|
||||||
] @format.indent.begin
|
] @format.indent.begin
|
||||||
.
|
.
|
||||||
(_))
|
(_))
|
||||||
|
(grouping
|
||||||
|
"("
|
||||||
|
.
|
||||||
|
(grouping . (_)) @format.indent.begin
|
||||||
|
.
|
||||||
|
(_))
|
||||||
(grouping
|
(grouping
|
||||||
"("
|
"("
|
||||||
.
|
.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue