Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter on exported symbols in 1.11 #2661

Merged
merged 2 commits into from
Oct 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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!(Base.Fix1(Base.isexported, mod), 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