Open MilesCranmer opened 2 years ago
I can not reproduce this.
Sorry for the confusion, I gave the completely wrong example. The issue I was seeing is actually the one described here: https://github.com/julia-vscode/julia-vscode/issues/2719. Not sure if this is a vscode issue or a LanguageServer.jl issue? Feel free to close this if needed.
Right now it seems that VSCode is unable to find function definitions in submodules. For example:
src/A.jl
src/B.jl
src/C.jl
Project.toml
VSCode cannot seem to locate
f
from withinB.jl
, though it is able to locate it fromC.jl
.@davidanthoff @ZacLN @pfitzseb do you know why this is not currently possible?
(Maybe related: https://github.com/julia-vscode/julia-vscode/issues/1740, https://github.com/julia-vscode/julia-vscode/issues/2904, https://github.com/julia-vscode/LanguageServer.jl/issues/1173)
Use-case: if you look at the codebase of SymbolicRegression.jl, every single file defines its own module - e.g., the file src/AdaptiveParsimony.jl defines the AdaptiveParsimonyModule which can be imported by other files. This is to make the codebase easier to navigate for potential contributors, since all dependencies are explicit[1]. However, the downside is that Julia VSCode doesn't seem to know where the functions are actually defined.
[1] Aside: I think this should be done by every Julia package, rather than the overpowered namespace mixing include("...") which requires me to search manually for where a function is defined, or to rely on an IDE.
Originally posted in https://github.com/julia-vscode/LanguageServer.jl/issues/1173. Thanks to @pfitzseb for identifying this as a separate issue.