Hello all!
I’m currently writing a package for the purpose of learning Julia, and am finding that autocomplete & hover-tooltips for types defined in the package do not seem to appear when in a test file.
Problem
Specifically, suppose I’m writing a package called Moo
, and I have the usual package structure. within src/Moo.jl
vscode will give tooltips/autocompletion for functions and types defined therein.
Now I have some tests too. I have test/runtests.jl
, which include
s test/some_tests.jl
. If I’m editing some_tests.jl
then such tooltips appear to be unavailable.
I’ve tried restarting the language server, restarting vscode, and reindexing the language server cache; none seem to change the behaviour.
Is this behaviour expected? In case the answer is “no”, I’ve gone into a bit more detail on my workflow below in case it has relevance…
Workflow
[[NB Aside – I’m pretty new to Julia and the associated tooling! I’m doing my best to figure out established best-practice-workflow, and sticking to what seems to be common structuring of packaging & projects. I’m coming from primarily Python, also some Kotlin, and C++. Any suggestions and tips would be most welcome! ]]
When writing tests, I’m currently switching between a Julia REPL [in which the Moo
development directory is activated] and running pkg> test
. This obviously runs all the tests… not a problem right now, but I can imagine this becoming frustrating if some tests are longer-running.
The only other way I’ve found to run the tests that works is using Alt-Enter in runtests.jl
, but since this requires switching files it seems rather less convenient. Alt-Enter in some_tests.jl
doesn’t work, as the Test
module is only imported in runtests.jl
… this seems to be standard practice though? [This concept – the writing of a source file which does not contain sufficient information to be runnable – is somewhat alien to me, yet seems to be very common in Julia. In Python you’d always import anything used, and in C++ you’d include headers.]
Am I missing something? Is there a better / faster way? And maybe this is related to my autocompletion apparent non-functionality?
Thanks very much!