-
Notifications
You must be signed in to change notification settings - Fork 111
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
[feature request] recursive includet #518
Comments
Hello,
However, as stated in this comment, it is possible to manually track included files. One way to do that could look like the following. Assuming that julia> using Revise
# No file has been included anywhere yet
julia> Revise.included_files
Tuple{Module,String}[]
# Track foo.jl; since includet is not recursive, bar.jl is not tracked
julia> includet("/tmp/foo.jl")
# ...but it is listed in the included files
julia> Revise.included_files
1-element Array{Tuple{Module,String},1}:
(Main, "/tmp/bar.jl")
# manually track it
julia> for (mod, file) in Revise.included_files
Revise.track(mod, file)
end
# Now both foo.jl and bar.jl are tracked
julia> Revise.watched_files
Dict{String,Revise.WatchList} with 5 entries:
"/tmp" => WatchList(1.59618e9, Dict{String,Base.PkgId}("foo.jl"=>Main [top-level],"bar.jl"=>Main [top-level]))
"/home/francois/.julia/packages/OrderedCollections/P6ntV/src" => WatchList(1.59618e9, Dict{String,Base.PkgId}("dict_sorting.jl"=>OrderedCollections [bac558e1-5e72-5ebc-8fee-abe8a469f55d…
"/home/francois/.julia/packages/LoweredCodeUtils/ynJHb/src" => WatchList(1.59618e9, Dict{String,Base.PkgId}("LoweredCodeUtils.jl"=>LoweredCodeUtils [6f1432cf-f94c-5a45-995e-cdbf5db27b…
"/home/francois/.julia/packages/CodeTracking/q52fp/src" => WatchList(1.59618e9, Dict{String,Base.PkgId}("utils.jl"=>CodeTracking [da1fd8a2-8d9e-5ec2-8556-3022fb5608a2],"pkgfiles.j…
"/home/francois/.julia/packages/JuliaInterpreter/fh7AN/src" => WatchList(1.59618e9, Dict{String,Base.PkgId}("utils.jl"=>JuliaInterpreter [aa1ae85d-cabe-5617-a682-6adf51b2e16a],"types.… |
Oh. great. I created a new function based on your comment, that is what I want!!. Thank you so much!!
So, my feature request would be |
Please be aware that a new element gets pushed to using Revise
function recursive_includet(filename)
already_included = copy(Revise.included_files)
includet(filename)
newly_included = setdiff(Revise.included_files, already_included)
for (mod, file) in newly_included
Revise.track(mod, file)
end
end
@timholy What would you think about such an API change? |
|
@timholy Thank you for your comment, I understood. |
Let's leave this open, so we can reconsider it once we get experience with |
Is extending |
2c from me: I think it would be nice if |
First of all, thank you so much for great package!!.
The
includet
looks like just watching specified script even if the script includes other scripts.If it is possible, it would be great that
includet
can watch scripts recursively (watching both the top script and included scripts by the top script).The text was updated successfully, but these errors were encountered: