JunoLab / Juno.jl

MIT License
145 stars 23 forks source link

[BUG] Subtypes of functions and their fields display incorrectly in workspace #535

Closed mewilhel closed 4 years ago

mewilhel commented 4 years ago

When displaying functors the Workspace panel doesn't reflect the type of the functor or the fields of the structure. Running the below snippet, the example will display in the Workspace as "example Any" and no drop down menu is present which can be used to example the fields "x" or "y" rather a definition of any is given. The correct type is Functor. Functor's a fairly useful for efficiently adding parameters to functions that previously lacked them (e.g. Jacobians with ForwardDiff.jl) or preallocating storage. So if would be nice if Juno's display supported them.

struct Functor <: Function 
x::Int
y::Int
end
example = Functor(1,2)

image

Details

Steps to reproduce

  1. Run the code snippet included.
  2. Inspect the workspace panel.
aviatesk commented 4 years ago

How about this ? image

https://github.com/JunoLab/Atom.jl/pull/303 will address this.

mewilhel commented 4 years ago

Looks good to me. Thanks!