Closed theogf closed 4 years ago
Works fine for me. What version of JuliaFormatter.jl do you have installed (you can check with pkg> st -m JuliaFormatter
)?
Edit: Oh, actually, it doesn't error but still messes up:
@traitfn function foo(bar::T) where {T; IsTrait{T}} end
-> @traitfn function foo(bar::T) where {TIsTrait{T}} end
JuliaFormatter is at version 0.3.8
Are you sure it's that line that causes the error (you can check by only selecting that before formatting)?
Here is what it gives when I select a line with @traitfn
:
Parsing error for input:
@traitfn function predict_ar(m::TGP, p::Int = 3, n::Int = 1; y_past = get_y(m)) where {T,TGP<:AbstractGP{T};IsMultiOutput{TGP}}
error(::String) at error.jl:33
#format_text#86(::Int64, ::Int64, ::Bool, ::Bool, ::Bool, ::Bool, ::JuliaFormatter.DefaultStyle, ::typeof(JuliaFormatter.format_text), ::String) at JuliaFormatter.jl:291
(::JuliaFormatter.var"#kw##format_text")(::NamedTuple{(:indent, :margin, :always_for_in, :whitespace_typedefs, :whitespace_ops_in_indices, :remove_extra_newlines),Tuple{Int64,Int64,Bool,Bool,Bool,Bool}}, ::typeof(JuliaFormatter.format_text), ::String) at none:0
(::Atom.var"#308#309")(::Dict{String,Any}) at formatter.jl:14
handlemsg(::Dict{String,Any}, ::Dict{String,Any}) at comm.jl:168
(::Atom.var"#19#21"{Array{Any,1}})() at task.jl:333
The rem_where
issue was when I was selecting the whole function
Ah ok, I can repro with that function. Wanna open an issue about this at the JuliaFormatter repo?
Sure! Probably it's the combination of comas and semicolumn...
closed since the upstream issue has been solved.
Please search existing issues to avoid duplicates.
Details
Steps to reproduce
@traitfn function foo(bar::T) where {T; IsTrait{T}}
end The Juno automatic formatting (Ctrl+J, Ctrl+F) give the error "no method matching rem_where(::Nothing)"