Skip to content

Commit

Permalink
Good state
Browse files Browse the repository at this point in the history
The modification of another query finally solves the indentation
problem. This query was dubious, because annotations are a series of
`(annot_atom)`, which most of the time fit on one line. We still want to
indent them, so we should have indented the whole series instead of each
node individually - which this commit is doing.

Also, the `multi_line_scop_only` is useless because if the annotation is
single line then the indentation just doesn't have any effect. Still, I
found that removing it is necessary to get the right behavior, this I
don't understand.
  • Loading branch information
yannham committed Sep 19, 2024
1 parent caa85f9 commit 1d9fca2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions topiary-queries/queries/nickel.scm
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,7 @@
; Indent the annotations themselves in multi-line mode with respect to the
; identifier they annotate.
(
(#multi_line_scope_only! "annotations")
(annot_atom) @prepend_indent_start @append_indent_end
(annot) @prepend_indent_start @append_indent_end
)

; Indent the RHS of the let-binding in presence of annotations.
Expand Down

0 comments on commit 1d9fca2

Please sign in to comment.