Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't the Scala REPL list all possibilities when using TAB-completion?

Tags:

scala

I have just started programming in Scala, and I noticed that hitting TAB-completion in the Scala REPL doesn't show all the available methods.

E.g. I want to evaluate this expression -

"Hello".intersect("World")

So, I type

"Hello".inter

and press TAB and expect 'intersect' to be shown as a valid option, but it is not shown.

Why is this so? I am sure that it is not a bug. I don't have any other examples yet.

like image 921
Pankaj Godbole Avatar asked Feb 13 '23 07:02

Pankaj Godbole


1 Answers

Intersect is not a String method but instead implicitly inferred from ArrayOps, and the REPL's auto-complete doesn't cover implicits yet. So it's not exactly a bug, just a (desperately) missing feature.

There's no technical barrier for this. It's just that no one had time to implement it yet.

Sources: Scala REPL fails to autocomplete methods that comes from implicit conversion

https://groups.google.com/forum/#!topic/scala-language/B34-TqH8pGU

like image 172
My other car is a cadr Avatar answered Feb 16 '23 04:02

My other car is a cadr