Skip to content

Commit

Permalink
Filter on exported symbols in 1.11
Browse files Browse the repository at this point in the history
  • Loading branch information
Pangoraw committed Oct 7, 2023
1 parent 3b37549 commit ea21e52
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/runner/PlutoRunner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion test/ExpressionExplorer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit ea21e52

Please sign in to comment.