Attaching sources in IntelliJ IDEA for scala project

前端 未结 4 1357
别那么骄傲
别那么骄傲 2021-02-08 01:10

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.SqlPar         


        
相关标签:
4条回答
  • 2021-02-08 01:40

    To fix it we need to do some changes into IntelliJ IDEA platform. Most probably it will be fixed in IntelliJ IDEA 13.1.

    0 讨论(0)
  • 2021-02-08 01:41

    I have the same problem. I installed "Scala Imports Organizer", and problem was solved.

    0 讨论(0)
  • 2021-02-08 01:47

    Aha.. fixed.

    So: I used to use 'attach source' in the top of the window editor - it does not work (I guess it is a bug - maybe related to the scala plugin, because usually it works).

    But if try to attache sources to particular library - in "Project Structure -> Library -> +Attach File or Directories -> Sources" then it works.

    Thanks.

    0 讨论(0)
  • 2021-02-08 02:03

    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

    0 讨论(0)
提交回复
热议问题