You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/frompackage/helpers.jl
+51-43Lines changed: 51 additions & 43 deletions
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,12 @@
1
1
import..PlutoDevMacros: hide_this_log
2
2
3
3
functionget_temp_module()
4
-
@assertisassigned(fromparent_module) "You have to assing the parent module by calling `maybe_create_module` with a Pluto workspace module as input before you can use `get_temp_module`"
## Similar to names but allows to exclude names and add explicit ones. It also filter names based on whether they are defined already in the caller module
130
+
functionfilterednames(m::Module; all =true, imported =true, explicit_names =Set{Symbol}(), caller_module::Module)
!only_rootmodule && ancestor_found &&returntrue# Ancestor found, and no check on only_rootmodule
145
+
nm === previous &&return ancestor_found # The target is the same as previous, so we reached a top-level module. We return whether the ancestor was found and is a parent of itself
@warn"The name `$s`, defined in $owner, is already present in the caller module and will not be imported."
168
169
end
170
+
return should_include
169
171
end
170
172
return f
171
173
end
@@ -280,7 +282,7 @@ end
280
282
# This relies on Base internals (and even the C API) but will allow make the loaded module behave more like if we simply did `using TargetPackage` in the REPL
# This will explicitly import each direct dependency of the package inside the LoadedModules module. Loading all of the direct dependencies will help make every dependency available even if not directly loaded in the target source code.
@@ -168,9 +167,15 @@ function load_module_in_caller(mod_exp::Expr, package_dict::Dict, caller_module)
168
167
target_file = package_dict["target"]
169
168
ecg =default_ecg()
170
169
# If the module Reference inside fromparent_module is not assigned, we create the module in the calling workspace and assign it
171
-
_MODULE_ =maybe_create_module(caller_module)
170
+
_MODULE_ =maybe_create_module()
172
171
# We reset the module path in case it was not cleaned
173
172
mod_name = mod_exp.args[2]
173
+
# We reset the list of symbols if we loaded a different module
0 commit comments