Skip to content

Go-to-definition for implicit apply only goes to apply #7267

@harpocrates

Description

@harpocrates

Describe the bug

Code:

trait Foo {
  def someNum
  def apply(i: Int): Unit = println(someNum)
}
object Bar extends Foo {
  def someNum = 42
}

object Test {
  Bar(2)
}

Cursor on Bar in Bar(2), go-to-definition goes to Foo.apply.

Expected behavior

Go-to definition should report two definitions:

  • object Bar
  • def apply on Foo

LSP is designed to accommodate multiple definitions.

Operating system

Windows

Editor/Extension

VS Code

Version of Metals

1.5.1

Extra context or search terms

No response

Metadata

Metadata

Assignees

Labels

Scala 2Scala 3Generic ticket relating to Scala 3presentation-compilerSomething relating to the presentation compiler

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions