aboutsummaryrefslogtreecommitdiffstats
path: root/queries/query
diff options
context:
space:
mode:
authorRiley Bruins <ribru17@hotmail.com>2024-02-21 01:47:09 -0800
committerGitHub <noreply@github.com>2024-02-21 18:47:09 +0900
commit455f6586bae558f99b51c0b07d46adc736f3822c (patch)
treea2f5091bd44cc51794c85dd0d86846bd8398d9f4 /queries/query
parenthighlights(slang): add support for `where` (diff)
downloadnvim-treesitter-455f6586bae558f99b51c0b07d46adc736f3822c.tar
nvim-treesitter-455f6586bae558f99b51c0b07d46adc736f3822c.tar.gz
nvim-treesitter-455f6586bae558f99b51c0b07d46adc736f3822c.tar.bz2
nvim-treesitter-455f6586bae558f99b51c0b07d46adc736f3822c.tar.lz
nvim-treesitter-455f6586bae558f99b51c0b07d46adc736f3822c.tar.xz
nvim-treesitter-455f6586bae558f99b51c0b07d46adc736f3822c.tar.zst
nvim-treesitter-455f6586bae558f99b51c0b07d46adc736f3822c.zip
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`
Diffstat (limited to 'queries/query')
-rw-r--r--queries/query/indents.scm20
1 files changed, 16 insertions, 4 deletions
diff --git a/queries/query/indents.scm b/queries/query/indents.scm
index 925d77060..2ce40d299 100644
--- a/queries/query/indents.scm
+++ b/queries/query/indents.scm
@@ -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)