When making a change to a module, I thought I simply needed to save the file and then re-run the importing script (which loads Revise at the very top). But the changes are only ever respected if I not only save the module file but also re-run its source in the current Julia session.
Is this normal?
edit: using VS code.
This is very vague without code or descriptions, what do you mean by plain module and how is the (separate?) script importing it? What do you do to “re-run” something,
include? Is that module a package?
Sorry, to be more precise:
In another file then:
No packages. By re-run I mean pressing Alt+Enter with the open file.
So if I make a change to the module, saving the file alone is not enough. I have to press Alt+Enter as well. Otherwise running the calling file will still lead to the old version of the module being used.
That’ll be an
include. Your importing script lacks an
include for the
testmod file, are you running both files in order then? Otherwise if you only run the importing script,
using .testmod should fail.
includet for non-package files, and the purpose is to not re-run files manually (in fact reevaluating a module can easily make a mess out of a session).
In VS code? You might try
includet(testmod.jl) (yes, the
t at the end is intentional) - I’m not sure Revise knows how to update when it’s run from vs code, which is essentially the same as pasting it into the repl
Related: take a look here and the entire thread.
Thank you guys, simply changing the line
using .testmod to