Skip to content

Commit

Permalink
fix #820 (#824)
Browse files Browse the repository at this point in the history
* fix #820

* 0.54
  • Loading branch information
domluna authored Mar 14, 2024
1 parent b65fefc commit e610eb4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "JuliaFormatter"
uuid = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
authors = ["Dominique Luna <[email protected]>"]
version = "1.0.53"
version = "1.0.54"

[deps]
CSTParser = "00ebfdb7-1f24-5e51-bd34-a7502290713f"
Expand Down
5 changes: 4 additions & 1 deletion src/styles/default/pretty.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1751,6 +1751,7 @@ p_conditionalopcall(style::S, cst::CSTParser.EXPR, s::State) where {S<:AbstractS
function p_unaryopcall(ds::DefaultStyle, cst::CSTParser.EXPR, s::State; nospace = true)
style = getstyle(ds)
t = FST(Unary, cst, nspaces(s))

if length(cst) == 1
head = cst.head::CSTParser.EXPR
if head.fullspan != 0
Expand All @@ -1764,7 +1765,9 @@ function p_unaryopcall(ds::DefaultStyle, cst::CSTParser.EXPR, s::State; nospace
else
add_node!(t, pretty(style, cst[1], s), s)
!nospace && add_node!(t, Whitespace(1), s)
add_node!(t, pretty(style, cst[2], s), s, join_lines = true)
for i in 2:length(cst)
add_node!(t, pretty(style, cst[i], s), s, join_lines = true)
end
end
t
end
Expand Down
5 changes: 5 additions & 0 deletions test/issues.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1830,4 +1830,9 @@
"""
@test format_text(s) == s
end

@testset "820" begin
s = "this_func(::Tuple{<:(some_func())}) = nothing"
@test format_text(s) == s
end
end

2 comments on commit e610eb4

@domluna
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/102841

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.0.54 -m "<description of version>" e610eb476459a8be60600b34a022bddcc01f7092
git push origin v1.0.54

Please sign in to comment.