Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

does not locate all references to a case class, in particular constructor calls #6776

Open
coreyoconnor opened this issue Sep 15, 2024 · 0 comments

Comments

@coreyoconnor
Copy link
Contributor

Describe the bug

Using the wes project at this SHA:

  1. nix develop to initialize dev environment. This is not required to repro, but a proper scala-native environment is required.
  2. start sbt
  3. start neovim (or other metals editor?)
  4. navigate to path wes/lib/shared/src/main/scala/wes/nes/ppu/RenderTile.scala - the source for RenderTile
  5. "Find References" on RenderTile

The expectation is that all usages, in particular calls to the constructor, are located. Specifically the reference to RenderTile at line 473 in PPU.scala. Instead the references are:

lib/shared/src/main/scala/wes/PPU.scala|100 col 28| def orIn(renderTile: RenderTile): Unit = {
lib/shared/src/main/scala/wes/PPU.scala|117 col 31| def shiftIn(renderTile: RenderTile): Unit = {
lib/shared/src/main/scala/wes/PPU.scala|410 col 23| nextRenderTile: RenderTile = RenderTile.zero,

Which does not include that reference.

Curiously, finding references on the companion object does locate the line 473 reference. However, this is not as expected: As a developer I'd expect finding references for a class to include finding constructions of that case class.

doctor reports:

Metals Info

  • Metals Server version: 1.3.5+114-8e729b2b-SNAPSHOT
  • Metals Java: 21.0.3 from N/A located at /nix/store/y9dcp2rgh70wz2q3nybv45k8zaz3jdwa-openjdk-21.0.3+9/lib/openjdk

project is lib:

lib

  • target type: Scala 3.5.0
  • goto functionality: metalsDecode:file:///home/coconnor/Documents/wes/lib.metals-buildtarget
  • compilation: ✅
  • diagnostics: ✅
  • interactive: ✅
  • semanticdb: ✅
  • debugging: ✅
  • java: ⚠️

Expected behavior

Locate references to constructor calls when finding references of a case class

Operating system

Linux

Editor/Extension

Nvim (nvim-metals)

Version of Metals

1.3.5+114-8e729b2b-SNAPSHOT

Extra context or search terms

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Triage
Development

No branches or pull requests

2 participants