Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Attaching sources in IntelliJ IDEA for scala project

I have Playframework 2 project with Scala (very small one). It uses Scala Anorm library.

I have the code like this:

package models
..
import anorm.SqlParser._
...

val rowParser = scalar[Long]

So, I would like to see source of scalar method. Trying to attache the sources I have in my plaframework source folder, but IDEA just swallows my request and does nothing back.

I use last version of IDEA and Scala plugin. Is it bug, probably?

like image 405
ses Avatar asked Nov 22 '12 21:11

ses


People also ask

How do I add sources in IntelliJ?

Click Libraries tab 3. Pick library and click + icon 4. Find a JAR file containing sources. But in your case,( using maven as a build tool), IntelliJ will automatically download and attach available source to all libraries, no manual work needed.

How do I add nature to Scala in IntelliJ?

To install Scala plugin, press Ctrl+Alt+S , open the Plugins page, browse repositories to locate the Scala plugin, click Install and restart IntelliJ IDEA. Now you can successfully check out from VCS, create, or import Scala projects.

How do I add Scala framework support in IntelliJ?

To add Scala support to existing module:Right-click the module in Project View, choose “Add Framework Support…” Check “Scala” in technologies list (unavailable if module has Scala facet attached) Provide a path to Scala installation (if not detected)


1 Answers

First download source code :

1.) Click on this link : http://www.scala-lang.org/download/all.html

2.) Choose any scala version.

3.) Now in the last section 'Other Resources' you can see 'Sources' link. Click on it to download. In my case (https://codeload.github.com/scala/scala/tar.gz/v2.11.7)

enter image description here

Now point to this Source Code from IntelliJ.

1.) Open Project Structure in IntelliJ. Shorcut (Cmd + DownArrow)

2.) Select Global Libraries from the left section.

3.) Then on right side, Under 'Scala Library' section. Click '+' and point to source directory. See the screenshot.

enter image description here

like image 165
mdev Avatar answered Oct 06 '22 01:10

mdev