Skip to content

Commit 48ce8d8

Browse files
committed
No error but bad indentation again
I used to split some scoping definition rule on annotations in two, before I understood that I couldn't do what I wanted. So reverting this splitting by having only one query fixes the error, which is very strange - the rules modified in the last commit aren't scoped (at least after the modification). The indentation of the result is still bad, but there's no error.
1 parent bb1ef55 commit 48ce8d8

File tree

1 file changed

+0
-36
lines changed

1 file changed

+0
-36
lines changed

topiary-queries/queries/nickel.scm

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -333,42 +333,6 @@
333333
(_) @append_begin_scope
334334
.
335335
(annot) @append_end_scope
336-
.
337-
)
338-
339-
; We want to include a potential "=" following the annotation in the scope, so
340-
; that we can properly add a newline between the last annotation and the "=" in
341-
; multi-line mode:
342-
;
343-
; {
344-
; foo
345-
; | Number
346-
; | doc "hello"
347-
; = 5,
348-
; }
349-
;
350-
; if we didn't include this rule, we could have
351-
;
352-
; | doc "hello" = 5,
353-
;
354-
; which is arguably confusing
355-
;
356-
; Note that this query is disjoint from the other one defining the "annotations"
357-
; scope above, which that only applies when the annotation is the last named
358-
; node of its parent. Thus, only one of the two ever matches.
359-
;
360-
; WARNING: currently, splitting the rule in two is useless because we actually
361-
; add the newline before `=` inconditionally (see
362-
; [^annotations-followed-by-eq]). However, when this limitation is lifted, the
363-
; current rule architecture will allow for the desired formatting with minimal
364-
; change.
365-
(
366-
(#scope_id! "annotations")
367-
(_) @append_begin_scope
368-
.
369-
(annot)
370-
.
371-
"=" @append_end_scope
372336
)
373337

374338
; Put each annotation on a new line, in a multi-line context.

0 commit comments

Comments
 (0)