mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-12 00:10:04 -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
41
tests/indent/query/test.scm
Normal file
41
tests/indent/query/test.scm
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
; vim:ft=query
|
||||
; format-ignore
|
||||
(fenced_code_block (fenced_code_block_delimiter) @label
|
||||
(info_string
|
||||
(language) @_lang)
|
||||
(#offset! @label 0 1 0 -1)
|
||||
(#ft-conceal! @_lang))
|
||||
|
||||
([
|
||||
(list_marker_minus)
|
||||
(list_marker_plus)
|
||||
(list_marker_star)
|
||||
] @markup.list
|
||||
(#offset-first-n! @markup.list 1)
|
||||
(#set! conceal "•"))
|
||||
|
||||
(list
|
||||
(list_item
|
||||
(list
|
||||
(list_item
|
||||
([
|
||||
(list_marker_minus)
|
||||
(list_marker_plus)
|
||||
(list_marker_star)
|
||||
] @markup.list
|
||||
(#offset-first-n! @markup.list 1)
|
||||
(#set! conceal "◦"))))))
|
||||
|
||||
; comment
|
||||
(while_statement
|
||||
[
|
||||
"while"
|
||||
"do"
|
||||
] @open.loop
|
||||
"end" @close.loop) @scope.loop
|
||||
|
||||
[
|
||||
"toplevel"
|
||||
"list"
|
||||
] @variable
|
||||
((
|
||||
Loading…
Add table
Add a link
Reference in a new issue