From ea21e523d3be07e5864bcb5886a7b5a7176f87f0 Mon Sep 17 00:00:00 2001 From: Paul Date: Sat, 7 Oct 2023 11:33:09 +0200 Subject: [PATCH 1/2] Filter on exported symbols in 1.11 See https://github.com/JuliaLang/julia/pull/50105#issuecomment-1721111250 for context --- src/runner/PlutoRunner.jl | 10 +++++++++- test/ExpressionExplorer.jl | 1 - 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/runner/PlutoRunner.jl b/src/runner/PlutoRunner.jl index cf252733ab..aa53cb746e 100644 --- a/src/runner/PlutoRunner.jl +++ b/src/runner/PlutoRunner.jl @@ -324,9 +324,17 @@ function try_macroexpand(mod::Module, notebook_id::UUID, cell_id::UUID, expr; ca return (sanitize_expr(expr_to_save), expr_hash(expr_to_save)) end +function exported_names(mod::Module) + @static if VERSION ≥ v"1.11.0-DEV.469" + filter!(b -> Base.isexported(mod, b), names(mod; all=true)) + else + names(mod) + end +end + function get_module_names(workspace_module, module_ex::Expr) try - Core.eval(workspace_module, Expr(:call, :names, module_ex)) |> Set{Symbol} + Core.eval(workspace_module, Expr(:call, exported_names, module_ex)) |> Set{Symbol} catch Set{Symbol}() end diff --git a/test/ExpressionExplorer.jl b/test/ExpressionExplorer.jl index 5ab13b83a9..aa086d6eb4 100644 --- a/test/ExpressionExplorer.jl +++ b/test/ExpressionExplorer.jl @@ -805,7 +805,6 @@ end (" 🍕🍕", (6, 10), (3, 5)), # a 🍕 is two UTF16 codeunits ] for (s, (start_byte, end_byte), (from, to)) in tests - @show s @test PlutoRunner.map_byte_range_to_utf16_codepoints(s, start_byte, end_byte) == (from, to) end end From f1424828647315050ddad6f968b2ad099de0e1dd Mon Sep 17 00:00:00 2001 From: Paul Berg Date: Sat, 7 Oct 2023 15:00:06 +0200 Subject: [PATCH 2/2] Update PlutoRunner.jl --- src/runner/PlutoRunner.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runner/PlutoRunner.jl b/src/runner/PlutoRunner.jl index aa53cb746e..fdc891be03 100644 --- a/src/runner/PlutoRunner.jl +++ b/src/runner/PlutoRunner.jl @@ -326,7 +326,7 @@ end function exported_names(mod::Module) @static if VERSION ≥ v"1.11.0-DEV.469" - filter!(b -> Base.isexported(mod, b), names(mod; all=true)) + filter!(Base.Fix1(Base.isexported, mod), names(mod; all=true)) else names(mod) end