Open stevengj opened 4 years ago
Or maybe it should be part of repl.options
(the REPL.Options
struct)?
Maybe adding a slightly higher-level API, e.g.
REPL.current_ast_transforms() = isdefined(Base, :active_repl_backend) ? Base.active_repl_backend.ast_transforms : REPL.repl_ast_transforms
FWIW, this is almost exactly what SafeREPL
uses.
Note that there is the undocumented function REPL.Numbered.__current_ast_transforms()
: https://github.com/JuliaLang/julia/blob/39f2ad1e941fd092b906d60e8d23c004e8ee5b7e/stdlib/REPL/src/REPL.jl#L1786
Julia 1.5 includes a REPL
ast_transforms
variable initially added for the softscope transformation (#33864) but expanded for use by other packages (#34626, #34778), that is starting to be used by other packages. It is currently being used by Revise (https://github.com/timholy/Revise.jl/pull/425), support will probably be added soon in IJulia (for theREPL.repl_ast_transforms
defaults), and it might be used in the future by things like OhMyREPL.We might consider documenting it somewhere. Maybe adding a slightly higher-level API, e.g.