Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nickel: Don't prepend line break to equals signs in annotations #682

Merged
merged 2 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions topiary-cli/tests/samples/expected/nickel.ncl
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
{
regression_tests = [
# Issue 680
{
config
| { labels = { a = "a" } }
= {}
},
{
a = [
b
Expand Down
6 changes: 6 additions & 0 deletions topiary-cli/tests/samples/input/nickel.ncl
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
{
regression_tests = [
# Issue 680
{
config
| { labels = { a = "a" } }
= {}
},
{
a = [
b
Expand Down
14 changes: 3 additions & 11 deletions topiary-queries/queries/nickel.scm
Original file line number Diff line number Diff line change
Expand Up @@ -249,15 +249,6 @@

;; Annotations

; We want the equals sign to be aligned with the annotations, if they
; coexist, so create a scope that covers them both.
(
(#scope_id! "annotated_assignment")
(annot) @prepend_begin_scope
.
"=" @append_end_scope
)

Xophmeister marked this conversation as resolved.
Show resolved Hide resolved
; Start an indentation block from the start of the annotations to the
; end of the enclosing node
(_
Expand Down Expand Up @@ -287,8 +278,9 @@
)

(
(#scope_id! "annotated_assignment")
"=" @prepend_spaced_scoped_softline
(annot)
.
"=" @prepend_spaced_softline
)

; Break a multi-line polymorphic type annotation after the type
Expand Down
Loading