Skip to content

Improve how dev'ed packages are handledΒ #180

Description

@pfitzseb

As per πŸ€–:

Dev'd (path-dependency) packages are handled statically by design: their symbols come from StaticLint's semantic pass over their source, and the parent never consumes their .jstore β€” even though the DJP child still loads them and writes one.

The bug

Both the static registration and the project_deps entry are gated on derived_has_file(<pkgdir>/src/<Name>.jl) (layer_environment.jl:179, :196), and derived_has_file is strict membership in input_files β€” workspace-folder files plus open documents (layer_files.jl:33-37). The lazy indirect-include mechanism (derived_has_content) is not used here.

So when the dev'd path lies outside every workspace folder, both paths miss: no .jstore is consumed (it's dev'd) and no static pass runs (its files aren't in the set). The name isn't even added to project_deps, so using Foo resolves to nothing and is reported as missing.

Repro

Open folder A/ whose Project.toml/Manifest.toml dev ../B, with B/ outside the workspace. In A/src/A.jl, using B is flagged, and B.anything gets no completions, hover, or go-to-def. Adding B/ as a second workspace folder fixes it.

Possible directions

  1. Reach the dev'd entry closure through the lazy indirect-file input (derived_has_content) instead of derived_has_file, so out-of-workspace dev'd sources are read from disc.
  2. Fall back to the dev'd package's .jstore β€” the DJP already writes one; only the parent-side loading and the input_package_metadata key (dev'd entries have no git_tree_sha1, sometimes no version) need work.
  3. At minimum, add the name to project_deps unconditionally so using B isn't a false UnresolvedImport.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions