fonsp / Pluto.jl

🎈 Simple reactive notebooks for Julia
https://plutojl.org/
MIT License
5k stars 296 forks source link

Stack trace: bracket-matched hiding and expanding and more #3045

Closed fonsp closed 1 month ago

fonsp commented 1 month ago

We now use Julia's built-in (curly-bracket matched) method to shorten type information. (From https://github.com/JuliaLang/julia/pull/49795, suggested by https://github.com/fonsp/Pluto.jl/issues/3006.)

You can click to expand and see all types.

https://github.com/user-attachments/assets/9800dc79-b47a-4392-b564-7f62753d0ced

Also notice: the first frame has a big parameterized callable type, but in the unexpanded form, just the name is shown.

Anonymous function

This PR also adds a special case for anonymous functions. Instead of a generated name like #15 or #24#25, it shows "anonymous function" and you can hover to learn what that phrase means:

image

Compare this to the REPL:

image

Highlighted function argument names

The argument names are now highlighted in grey (x in sqrt(x::Float64))

image

Try this Pull Request!

Open Julia and type:

julia> import Pkg
julia> Pkg.activate(temp=true)
julia> Pkg.add(url="https://github.com/fonsp/Pluto.jl", rev="stack-trace-expand-types")
julia> using Pluto