purefunctor / purefunctor/purescript-iris

[lsp] Find references across files for implicit Prim classes

Open
#264 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
102
Forks
11
Avg merge
3h 30m
Merged PRs (30d)
138

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the LSP Find References implementation and trace how its explicit-import check limits searched files for declarations from Prim. Compare searching every active file with maintaining an index, and define the intended user-facing scope, including whether references from built-in Prim modules should appear.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.