Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: crystal-lang/crystal
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4360c69ad55c
Choose a base ref
...
head repository: crystal-lang/crystal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0e646220fca2
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on May 9, 2018

  1. Copy the full SHA
    81845c5 View commit details
  2. Merge pull request #6084 from asterite/bug/annotations_formatter

    Formatter: correctly handle annotation path
    asterite authored May 9, 2018

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    0e64622 View commit details
Showing with 4 additions and 2 deletions.
  1. +2 −0 spec/compiler/formatter/formatter_spec.cr
  2. +2 −2 src/compiler/crystal/tools/formatter.cr
2 changes: 2 additions & 0 deletions spec/compiler/formatter/formatter_spec.cr
Original file line number Diff line number Diff line change
@@ -499,6 +499,8 @@ describe Crystal::Formatter do
assert_format "@[Foo( 1, 2, foo: 3 )]", "@[Foo(1, 2, foo: 3)]"
assert_format "@[Foo]\ndef foo\nend"
assert_format "@[Foo(\n 1,\n)]"
assert_format "@[Foo::Bar]"
assert_format "@[::Foo::Bar]"

assert_format "1.as Int32", "1.as Int32"
assert_format "foo.bar. as Int32", "foo.bar.as Int32"
4 changes: 2 additions & 2 deletions src/compiler/crystal/tools/formatter.cr
Original file line number Diff line number Diff line change
@@ -3490,8 +3490,8 @@ module Crystal
write_token :"@["
skip_space_or_newline

write @token
next_token_skip_space
node.path.accept self
skip_space_or_newline

if @token.type == :"("
has_args = !node.args.empty? || node.named_args