Skip to content

[lsp] Find references across files for implicit Prim classes #264

Description

@purefunctor

Problem

Find References narrows the files it searches by checking explicit imports. This works for ordinary classes because a file must import the class before using it.

Classes from Prim, such as Partial, are available in every module without an import. The import check therefore cannot identify which files may reference them. A request on Partial can find references in the current file but omit matching references in other workspace files, including instance declarations.

Possible approaches

  • Search every active file when the target is defined in Prim.
  • Maintain an index that maps resolved declarations to the files that reference them.

Searching every active file is the simpler approach. It may also return valid references from built-in Prim.* modules, so the expected user-facing scope should be decided before implementation.

Scope

This is a general limitation of cross-file reference search for implicitly available Prim declarations. It is separate from locating class names inside instance declarations.

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