4

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.

Pankaj Godbole
  • 177
  • 1
  • 8

1 Answers1

8

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

Community
  • 1
  • 1
My other car is a cadr
  • 1,429
  • 1
  • 13
  • 21
  • 1
    It's pretty desperate. Thanks for the ML link, I like the idea of expanding implicits on multiple tabs. – som-snytt Apr 06 '14 at 09:18