I still don’t understand your context. I don’t understand the problem you are experiencing, and I’m guessing at what you mean. This is why I suggested in my first reply that you document a MWE and delineate the problem.
Here’s my usual workflow when starting a project, usually a data analysis of some sort.
julia -e 'using Pkg;Pkg.generate("aproject")'
cd aproject
julia -e 'using Pkg;Pkg.activate(".");Pkg.instantiate()'
You should now see a Project.toml and a Manifest.toml in your project directory.
I work with Revise as one of the few packages in my global environment and is part of my startup. So my ~/.julia/config/startup.jl reads (in part)
using Pkg
if isfile("Project.toml") && isfile("Manifest.toml")
Pkg.activate(".")
end
try
using Revise
catch e
@warn "Error initializing Revise" exception=(e, catch_backtrace())
end
println(":")
println(":" * pwd())
println(":")
In the project directory, I start julia. Dropping to the package prompt, pkg> I add DataFrames, CSV, etc. to the project.
Now back to the project directory.
touch myanalysis.jl
echo "using aproject;\nusing DataFrames;" > myanalysis.jl
In my src/aproject.jl, I use this trick
module aproject
using DatFrames
@static if false
include("../myanalysis.jl")
end
end # module aproject
Note that the follow-up reply reported success in emacs. I’m not strictly sure that’s needed for eglot but I’ve left it there for now.
As @ufechner7 notes, eglot / jetls takes a bit of time to start up in Emacs. But once it does, things seem to work. I haven’t got all the xref lookup functions working but with the emacs consult/embark, I can also do a consult-rg (ripgrep) which generally finds anything I need in the project.