"Go to defintition (F12)" doesn't work for functions in a package

I am new to using Julia in VSCode. I have installed the Julia language support package that carries the Julia logo. What I want to do, is to find the definition function that was called at runtime.

The way I have been trying to do it is to right-click on the text document and select «Julia: Execute code in REPL». I iterate through the code in the VSCode REPL using Shift+Enter. When I try to get the definition of any function by right-clicking on it or using F12, I always get the error that «No definition found for function-name». The packages I am using are installed globally on my machine.

What is it that I have to setup to get the feature to work?

1 Like

By “globally” do you mean, that packages are in main environment (e.g. @1.8)?
From my experience, F12 works only on packages added to the current workspace you are in, so it does not see through the env hierarchy.
If you can’t switch to the workspace where those packages are installed, there is also an @edit macro, which will open the file containing the fuction, e.g. @edit sum().

1 Like

Thanks

In my experience, VSCode does not find definitions from the package that you are developing, but only from its dependencies. How weird.

I can confirm: I thought it worked, but just found out it does not (anymore?). This is indeed a significant pain point.