lunduniversity / introprog

Teaching material for "Introduction to Programming using Scala" at Lund University, LTH. http://cs.lth.se/pgk/
142 stars 179 forks source link

LTH's computers don't have standard library sources/docs #226

Closed jos-rosenqvist-3812 closed 5 months ago

jos-rosenqvist-3812 commented 7 years ago

This issue report is related to the course but not the course's git repo.

When using IntelliJ (I'm not sure how it works in Eclipse), it's possible to hold Ctrl and click on any standard library function to see its source code, which is useful in particular because it lets you view the javadoc/scaladoc comments right in the IDE. By default on the Linux computers in LTH's E building, this works nicely for the Java standard library, but trying to do the same for the Scala standard library only shows function heads without any implementations or comments.

If you go to File > New > Project... and select Scala, you will see that there is a Create button next to the selection of Scala SDK. It shows a window with a list that by default only contains a single entry: System - 2.11.8 without any sources or docs. It is possible to get the sources and docs by using the Download... button in this window, which will create new entries in the list (marked Ivy instead of System), and will make Ctrl-clicking work for Scala methods just like Java methods.

It would be better if the sources and docs were pre-installed so that each person who wants them won't have to download it on their own and keep it in their user directory. Maybe it could be done along with upgrading to Scala 2.12 for next year's instance of the course?

bjornregnell commented 7 years ago

One issue in multi-user environments is how much hands-on that the installation must get to enable central mgmt of some files. So some detective work might be needed to figure out if a local setting can enable a central store of the plug-ins. System managers of student computers want as little intervention as possible after package install. We use this ppa: https://launchpad.net/~mmk2410/+archive/ubuntu/intellij-idea-community So it would be good if someone could look into how to centralize plugin lookup in a multi-user linux environment when making progress on this issue.

bjornregnell commented 7 years ago

I think this can be solved by adding stuff to each users config but I'm not sure. Help wanted to chek out if this is possible.

bjornregnell commented 6 years ago

The current installation is made from the official .deb. I'm still unsure how to do this and not break easy install from .deb for sysadmins of student computers. Under "Other Resources" here https://www.scala-lang.org/download/2.12.7.html there is a sources tar. @jos-rosenqvist-3812 do you know where to put the sources globally so that intellij/eclipse can find them or if that is even possible?

bjornregnell commented 3 years ago

This needs to be checked if it works with Scala 3 both in vscode (high prio) and intelliJ (low prio)

bjornregnell commented 1 year ago

Here is an old SO post that describes how to add sources in IntelliJ: https://stackoverflow.com/questions/13520532/attaching-sources-in-intellij-idea-for-scala-project This needs to be tested on the LTH student computers but wuth the new IntelliJ Scala plugin (perhaps that one already has solved this issue?) Of higher priority is to test source availability of the Scala sdt lib in VS Code on LTH student computers when using "show definition" or similar.

bjornregnell commented 5 months ago

fixed by vscode Metals