From fef26b5eeee1dca1699639dd0d76c47f15a45ee6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ph=E1=BA=A1m=20Huy=20Ho=C3=A0ng?= Date: Sun, 18 Feb 2024 23:13:39 +0900 Subject: [PATCH] fix(format): fix nested grouping indentation (#6128) --- queries/dart/highlights.scm | 7 ++++--- scripts/format-queries.lua | 7 ++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/queries/dart/highlights.scm b/queries/dart/highlights.scm index ada4d212c..c41ff9c27 100644 --- a/queries/dart/highlights.scm +++ b/queries/dart/highlights.scm @@ -13,10 +13,11 @@ ; 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 (((identifier) @function - (#lua-match? @function "^_?[%l]")). -(selector + (#lua-match? @function "^_?[%l]")) . - (argument_part))) @function + (selector + . + (argument_part))) @function ; Annotations ; -------------------- diff --git a/scripts/format-queries.lua b/scripts/format-queries.lua index 5cb0fb1a2..ab136d671 100755 --- a/scripts/format-queries.lua +++ b/scripts/format-queries.lua @@ -206,10 +206,15 @@ local format_queries = [[ (named_node) ; ((foo)) (list) ; ([foo] (...)) (anonymous_node) ; ("foo") - (grouping . (anonymous_node)) ; (("foo")) ] @format.indent.begin . (_)) +(grouping + "(" + . + (grouping . (_)) @format.indent.begin + . + (_)) (grouping "(" .