Your approach should work. However, note that using Revise must come before the package that you’re editing is loaded. Perhaps you already did using OtherPackageThatMyPackageImports in this Julia session?
I find it most convenient to just load Revise automatically, which ensures that it is always loaded first: Configuration · Revise.jl
I think my question is a suitable follow-up question:
When using Revise and importing a module , Revise does its magic.
More specifically I can redefine the struct in the imported module and Revise reloads it.
But when importing a specific struct/function from the module, I get a LoadError: MethodError.
Is there some syntactic difference to what Revise can reload and what not?
Example:
# Both files Human.jl and Main.jl are in the same directory
# Human.jl
module Human
export Person, printastring
struct Person
name::String
age::Int64
zip::Int64
partner::Bool
child::Bool
end
end
# Main.jl
using Revise
include("Human.jl")
import .Human: Person
Bob = Human.Person("Robert", 16, 12345, true, false) -> Revise works
Bob = Person("Robert", 16, 12345, true, false) -> Revise doesnt work
println(Bob)
Specifically, my question is how Revise interacts with importing functions/structs from modules and what the best practices are for Revise and importing specific functions/structs from other modules.