scala / bug

Scala 2 bug reports only. Please, no questions — proper bug reports only.
https://scala-lang.org
230 stars 21 forks source link

REPL won't tell me the parameters with multiple completion candidates #12843

Open som-snytt opened 10 months ago

som-snytt commented 10 months ago

Reproduction steps

Scala version: 2.13.11

scala> b.update()
               ^
       error: not enough arguments for method update: (index: Int, elem: String): Unit.
       Unspecified value parameters index, elem.

scala> b.update
         ^
       error: missing argument list for method update in class ArrayBuffer
       Unapplied methods are only converted to functions when a function type is expected.
       You can make this conversion explicit by writing `update _` or `update(_,_)` instead of `update`.

Problem

I'd like to see the signature without attempting an invocation. (Because who knows what may happen.)

It would be nice if missing argument list just told me the signature if unique, or that there are overloads.

Completion no longer tells me parameters when there are multiple completion candidates. (This used to be offered on subsequent tab.)

In this case, update and updated are candidates.

It does report signatures of a single completion candidate with overloads:

def remove(index: Int, count: Int): Unit
def remove(index: Int): String

scala> b.remove
SethTisue commented 10 months ago

Yeah, this has long bugged me.