Open touchft opened 2 years ago
+1. This is really needed! @davidanthoff @ZacLN do you know why this is not currently possible, even though https://github.com/julia-vscode/LanguageServer.jl/pull/871 was merged?
Related: https://github.com/julia-vscode/julia-vscode/issues/1740, https://github.com/julia-vscode/julia-vscode/issues/2904.
For example, 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.
That's a completely unrelated issue.
Wait, do you mean the PR is unrelated, or the other GH issues julia-vscode/julia-vscode#1740 julia-vscode/julia-vscode#2904?
Your case is unrelated to this issue, which is about missing functionality in the test dir. Unless I misunderstood you and symbol resolution works fine in package files even with the one-module-per-file structure and only breaks in the test dir.
Oh, I see what you mean, thanks. Let me open a new issue then.
Hi, @touchft . I don't think it is a bug, since it is unrepeatable in my machine. Maybe you miss the Project.toml
file? Can you provide more detail of the repo? Feel free to correct me if I miss something.
PkgTemplates
as mentioned in your comment.
# using Pkg; Pkg.add("PkgTemplates")
using PkgTemplates
Template(dir=".")("testjl")
File-tree of the repo:
# tree
├── LICENSE
├── Manifest.toml
├── Project.toml
├── README.md
├── src
│ └── testjl.jl
└── test
└── runtests.jl
runtests.jl
and testjl.jl
as above, then
Example:
A package named as 'testjl' was initialized by
PkgTemplates
with part of contents:file
testjl/src/testjl.jl
:file
testjl/test/runtests.jl
:Question: How can I get code-jump working for the function
ff
within the filetestjl/test/runtests.jl
?