In addition to what @GunnarFarneback just posted, I’d like to add to @davidanthoff’s last post, which explains that not only do you not need a git repo to make a julia package, you don’t need a julia package to add a folder to an environment. I think this might be able to more or less keep your current workflow without using LOAD_PATH, creating any packages or doing anything with git. Recall David’s post:
One can make a julia module, just sitting in a folder on your machine, not part of any project, available as part of your environment without using LOAD_PATH. You can do all of this through the package manager repl mode, without having to create any packages. Once these modules are part of the vs code extension’s active environment, they will be picked up by the extension and used in linting etc.
Perhaps this could be better documented. Here’s an example. Let’s say I create two modules, FooMod
and BarMod
. These modules each consist of single files, FooMod.jl and BarMod.jl, respectively. The directories storing these modules looks like so:
FooMod
└── src
└── FooMod.jl
BarMod
└── src
└── BarMod.jl
And that’s it, no Project.toml, no git stuff.
BarMod.jl could contain, for example
module BarMod
export bar
using FooMod
bar() = println(foo()*"baaaaaaaaaaar")
end
Now, assuming I have these directory structures and files defined, in julia I can do the following from the Pkg repl mode to add these modules to my current environment
pkg> dev /path-to/FooMod
and the same for BarMod. This adds these two modules to my current environment. Then I can then do using FooMod, BarMod
from any directory on my system without touching LOAD_PATH. vs code will also pick up these modules, assuming your active julia environment for the vs code extension has these modules in there.