Skip to content

Order of suggested completions: Extensions from companion should rank higher #7642

@TomasMikula

Description

@TomasMikula

Describe the bug

Extension methods from companion object are suggested only after (some) Object methods, Product methods and even orphan extensions like ensuring.

Foo.scala

case class Foo()

object Foo:
  extension (f: Foo)
    def qux: Unit = ()

test.scala

val _ = Foo().@@
Image

Seems like of the Object methods, only the ones that are overridden by compiler-generated methods of a case class rank higher, but that's still unwanted.

Expected behavior

I'd expect extension methods from the companion object to be suggested before orphan extension methods.
It'd be useful to also de-prioritize methods inherited from Object and Product.

Operating system

None

Editor/Extension

VS Code

Version of Metals

v1.6.0

Scala version/s

3.7.1

Extra context or search terms

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Scala 3Generic ticket relating to Scala 3presentation-compilerSomething relating to the presentation compilerspree

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions