Simply having a package added to the global environment (through ] add) and then in a new Julia file having the line using Example
, the linter shows a warning “Missing reference: Example” for the package and any used functions that are part of the package. And yet, running the file in the Julia REPL the package is recognized and internal functions are executed just fine.
It feels like such a core issue that I find it difficult to believe it is a bug in the extension but that actually might be the case and it’s driving me mad. I looked up online and it seems to be a well-known issue and yet I’m unsure whether it’s a more specific case as it would be insane that such a simple usage of a package the linter would fail to recognize. Examples of such reports:
- "Missing reference" warnings · Issue #1102 · julia-vscode/julia-vscode · GitHub
- "Missing reference" warnings with Julia in VS Code?
- None of the symbols in my package seem to be recognized · Issue #800 · julia-vscode/julia-vscode · GitHub
I’ve seen some mentions for creating a project.toml or activating a local environment for the code files. But from my understanding, this is only needed if you want to create a portable project that can be run by others. When I tried creating a new project and generated a Project.toml, added the Example dependency and instantiated it, it finally worked (after adding the package a second time, I’m not sure where). But surely there’s a simpler way that also doesn’t require installing the same package every time I create a new project, right?