vscode julia path changed, code to avoid Main.Notebook module context changed
This commit is contained in:
@@ -10,6 +10,8 @@ engine: julia
|
||||
#| output: false
|
||||
using InteractiveUtils
|
||||
|
||||
#struct M a::Int end; x = M(22); @show x
|
||||
#should not print "Main.Notebook.M(22)" but only "M(22)"
|
||||
function Base.show(io::IO, x::T) where T
|
||||
if parentmodule(T) == @__MODULE__
|
||||
# Print "TypeName(fields...)" without module prefix
|
||||
@@ -24,14 +26,6 @@ function Base.show(io::IO, x::T) where T
|
||||
invoke(Base.show, Tuple{IO, Any}, io, x)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
##import QuartoNotebookWorker
|
||||
##Base.stdout = QuartoNotebookWorker.with_context(stdout)
|
||||
##myactive_module() = Main.Notebook
|
||||
##Base.active_module() = myactive_module()
|
||||
# https://github.com/JuliaLang/julia/blob/master/base/show.jl#L516-L520
|
||||
# https://github.com/JuliaLang/julia/blob/master/base/show.jl#L3073-L3077
|
||||
```
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user