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

[BUG] Juno Formatting with SimpleTraits #529

Closed
theogf opened this issue Mar 24, 2020 · 8 comments
Closed

[BUG] Juno Formatting with SimpleTraits #529

theogf opened this issue Mar 24, 2020 · 8 comments

Comments

@theogf
Copy link

theogf commented Mar 24, 2020

Please search existing issues to avoid duplicates.

Details

  • Atom version:
  • Julia version: 1.3.1
  • OS: Linux
  • Package versions:
    • Atom.jl: 0.12.9
    • julia-client:
    • ink:

Steps to reproduce

  1. Use SimpleTraits.jl and create a @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)"
@theogf theogf added the bug label Mar 24, 2020
@pfitzseb
Copy link
Member

pfitzseb commented Mar 24, 2020

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

@theogf
Copy link
Author

theogf commented Mar 24, 2020

JuliaFormatter is at version 0.3.8

@pfitzseb
Copy link
Member

Are you sure it's that line that causes the error (you can check by only selecting that before formatting)?

@theogf
Copy link
Author

theogf commented Mar 24, 2020

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

@theogf
Copy link
Author

theogf commented Mar 24, 2020

The rem_where issue was when I was selecting the whole function

@pfitzseb
Copy link
Member

Ah ok, I can repro with that function.
Wanna open an issue about this at the JuliaFormatter repo?

@theogf
Copy link
Author

theogf commented Mar 24, 2020

Sure!
Probably it's the combination of comas and semicolumn...

@aviatesk
Copy link
Member

closed since the upstream issue has been solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants