6

I've been experimenting with Scala lately and I noticed that when I need to look up a function or a class, I have to go to the website or navigate to the local documentation.

Is there a way to read the Scaladoc from inside the interpreter?

Maybe something like help() in Python.

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
Mahmoud Hanafy
  • 7,958
  • 12
  • 47
  • 62
  • 1
    Duplicate of **[How do I access scala documentation from the repl?](http://stackoverflow.com/q/6768445/334519)** – Travis Brown Oct 23 '11 at 12:43
  • It would be nice to have a shortcut way to just print out the docs for a particular method though. I suppose that could be done with some parsing of the actual scaladoc page.. – Dylan Oct 23 '11 at 13:10
  • 1
    Good question. Since the "duplicate" wasn't really answered, I think this should stay open. You can have scaladoc hover in an IDE like IntelliJ, so it's not about html or not, you can certainly strip html and print the plain text. I am looking for something like this, too, so I hope there will be more elaborate answers then firing up a web browser... – 0__ Oct 23 '11 at 14:26
  • Keeping a tab in Firefox with your local docs open is a really easy solution. – Luigi Plinge Oct 24 '11 at 01:32
  • @LuigiPlinge I know that, but I don't want to do this all the time, it gets tedious. – Mahmoud Hanafy Oct 24 '11 at 08:11

2 Answers2

2

Scalaex is a cool Scala-web documentation like Hoogle with an usefull CLI-client.

(But it's not inside the interpreter. Unfortunately I cannot write a comment to your question, so I write this as an answer.)

Sonson123
  • 10,879
  • 12
  • 54
  • 72
1

I'm running the command line scala interpreter for 2.9, and tab-key completion works for me:

val x = List(1,2,3)

x. 

Then press TAB

Shows the list of methods.

Not quite full docs, but helpful nonetheless.

DaveShaw
  • 52,123
  • 16
  • 112
  • 141
Tony K.
  • 5,535
  • 23
  • 27