Respect keywords in access in code formatter

This commit is contained in:
José Valim
2021-05-11 12:37:58 +02:00
parent 1c9d7365db
commit 480c19cb5b
4 changed files with 44 additions and 9 deletions
@@ -358,6 +358,30 @@ defmodule Code.Formatter.CommentsTest do
end
end
describe "access" do
test "before and after single arg" do
assert_same ~S"""
foo[
# bar
baz
# bat
]
"""
end
test "before and after keywords" do
assert_same ~S"""
foo[
# bar
one: :two,
# baz
three: :four
# bat
]
"""
end
end
describe "calls" do
test "local with parens inside before and after" do
assert_same ~S"""