mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
Fixup format (#5934)
* fix(format): newline between top-level field defs * fixup: newline between node and comment * fixup: optimize pattern
This commit is contained in:
parent
f5a839d1e8
commit
d198a75e2c
35 changed files with 47 additions and 3 deletions
|
|
@ -52,10 +52,7 @@ local format_queries = [[
|
|||
;; Preserve inline comments
|
||||
(program
|
||||
. (_)
|
||||
(_) @_comment
|
||||
.
|
||||
(comment) @format.prepend-newline
|
||||
(#not-has-type? @_comment comment)
|
||||
(#is-start-of-line? @format.prepend-newline))
|
||||
(program
|
||||
. (_)
|
||||
|
|
@ -77,7 +74,9 @@ local format_queries = [[
|
|||
(grouping)
|
||||
(named_node)
|
||||
(anonymous_node)
|
||||
(field_definition)
|
||||
] @format.prepend-newline)
|
||||
|
||||
(program
|
||||
(comment) @_comment
|
||||
.
|
||||
|
|
@ -86,6 +85,8 @@ local format_queries = [[
|
|||
(grouping)
|
||||
(named_node)
|
||||
(anonymous_node)
|
||||
(field_definition)
|
||||
(comment)
|
||||
] @format.cancel-prepend
|
||||
(#is-start-of-line? @_comment))
|
||||
;; }}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue