Re: [scala-ide-user] Should I be able to hover-over and see ScalaDoc in Scala-IDE?

414 views
Skip to first unread message

Eric Kolotyluk

unread,
May 14, 2013, 6:08:17 PM5/14/13
to scala-i...@googlegroups.com
This is one of the most important features of the Java Editor I miss in
the Scala Editor. It is also one of the biggest barriers in learning to
use Scala.

Cheers, Eric

On 5/14/2013 2:22 PM, Robert Kuhar wrote:
> I'm new to Scala and Scala-IDE, but it was my expectation that it
> would work in a manner very similar to how the Java editor works. In
> my little "Hello" application, I am surprised that I cannot see the
> ScalaDocs for print, println, etc when I hover-over a function call.
> Is this correct or did I dork my deployment somehow?
>
> packagehello
>
> object Hello extends App {
> print("Hello, ")
> print("World")
> println("")
> }
>
> --
> You received this message because you are subscribed to the Google
> Groups "Scala IDE User" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to scala-ide-use...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Simon Schäfer

unread,
May 14, 2013, 6:43:34 PM5/14/13
to scala-i...@googlegroups.com

On 05/14/2013 11:22 PM, Robert Kuhar wrote:
> I'm new to Scala and Scala-IDE, but it was my expectation that it
> would work in a manner very similar to how the Java editor works. In
> my little "Hello" application, I am surprised that I cannot see the
> ScalaDocs for print, println, etc when I hover-over a function call.
> Is this correct or did I dork my deployment somehow?
Currently Scala IDE lacks any Scaladoc related features.

The good news is that half of the Scaladoc integration with code
completion is already implemented, but it couldn't merged yet because of
some last problems that need to be fixed. The original author of the
Scaladoc contribution is busy at the moment and can't address the
problems, thus there is no time frame when this will definitely be
implemented.

Another good news is that I have more time now I can spend contributing
to the IDE. For me Scaladoc support is one of the most important
features, thus it is on top of the things I want to fix the next time. I
hope once Scaladoc code completion support is fixed, the Scaladoc view
and hover can easily be implemented too.

Just follow this ticket to be the first noticed when the feature gets
merged:
https://scala-ide-portfolio.assembla.com/spaces/scala-ide/tickets/1000210#/activity/ticket:

Greetings,
Simon

Robert Kuhar

unread,
May 15, 2013, 2:28:51 PM5/15/13
to scala-i...@googlegroups.com
Thanks.  I really look forward to this feature as it will flatten the learning curve for Scala.

Robert Kuhar

unread,
May 29, 2014, 7:48:51 PM5/29/14
to scala-i...@googlegroups.com
I stepped away from Scala-IDE for a year and came back just this week.  But still no ScalaDoc hover-over in the Scala-IDE?  Really?  I'm running the Scala-IDE in Eclipse Kepler.  I see this as a feature of Scala-IDE 3.0 (http://scala-ide.org/docs/current-user-doc/features/typingviewing/javadoc.html) but I don't seem to get the function on my machine.  Where did I go wrong?

Clint Gilbert

unread,
May 29, 2014, 7:58:56 PM5/29/14
to scala-i...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

It doesn't work for me either.

The refactorings have been broken for years too; it's too bad those
aren't on the roadmap.
> <https://groups.google.com/groups/opt_out>.
>>
>>
>
> -- You received this message because you are subscribed to the
> Google Groups "Scala IDE User" group. To unsubscribe from this
> group and stop receiving emails from it, send an email to
> scala-ide-use...@googlegroups.com
> <mailto:scala-ide-use...@googlegroups.com>. To view this
> discussion on the web visit
> https://groups.google.com/d/msgid/scala-ide-user/b92fdca5-5fdc-4c89-b7fe-80411bfc8412%40googlegroups.com
>
>
<https://groups.google.com/d/msgid/scala-ide-user/b92fdca5-5fdc-4c89-b7fe-80411bfc8412%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEARECAAYFAlOHyboACgkQ0GFaTS4nYxuGhgCffTATgq3aGXMKdEkGG5QKPqYh
/W8AoLP//3IGZP62ZlGe+wGibkWGcBRU
=OI65
-----END PGP SIGNATURE-----

Andrew Gaydenko

unread,
May 29, 2014, 8:10:17 PM5/29/14
to scala-i...@googlegroups.com
Yes, Scala is few orders of power more complicated rather Java, and not all those helpers we all have got for Java exist for Scala. At my every day work I mostly use two ways to get information about artifacts I'm not familiar with yet:

- using code completion to see methods signatures
- if above doesn't help (and it is a rare case), Ctrl-click to source - you will see both scaladoc and implementation :)

And Ctrl-click and semantic code highlighting do work in all those sources also! Just add sources for all libs you want is sbt project definition.

Andrew Gaydenko

unread,
May 29, 2014, 8:18:13 PM5/29/14
to scala-i...@googlegroups.com
On Friday, May 30, 2014 4:10:17 AM UTC+4, Andrew Gaydenko wrote:
Yes, Scala is few orders of power more complicated rather Java

Sorry, I must be more clear: I mean compiler complication rather language using.

Simon Schäfer

unread,
May 29, 2014, 8:24:13 PM5/29/14
to scala-i...@googlegroups.com

On 05/30/2014 01:48 AM, Robert Kuhar wrote:
I stepped away from Scala-IDE for a year and came back just this week.  But still no ScalaDoc hover-over in the Scala-IDE?  Really?  I'm running the Scala-IDE in Eclipse Kepler.  I see this as a feature of Scala-IDE 3.0 (http://scala-ide.org/docs/current-user-doc/features/typingviewing/javadoc.html) but I don't seem to get the function on my machine.  Where did I go wrong?
It is still not implemented or better: it is implemented but still doesn't work in a manner that it could be merged to master.

One of the main problems is that the UI code of Eclipse is horrible designed - it is practically impossible to extend it with all the features an IDE needs to provide. I know, this is no excuse that it is still not working, but that is the current situation. I tried it several times to get the UI integration to work, but always failed so far due to the complexity. And I don't want to see an implementation to be merged that shows you a black window box with ugly unformatted text.

Naftoli Gugenheim

unread,
May 29, 2014, 9:22:42 PM5/29/14
to scala-i...@googlegroups.com
On Thu, May 29, 2014 at 8:24 PM, Simon Schäfer <ma...@antoras.de> wrote:

On 05/30/2014 01:48 AM, Robert Kuhar wrote:
I stepped away from Scala-IDE for a year and came back just this week.  But still no ScalaDoc hover-over in the Scala-IDE?  Really?  I'm running the Scala-IDE in Eclipse Kepler.  I see this as a feature of Scala-IDE 3.0 (http://scala-ide.org/docs/current-user-doc/features/typingviewing/javadoc.html) but I don't seem to get the function on my machine.  Where did I go wrong?
It is still not implemented or better: it is implemented but still doesn't work in a manner that it could be merged to master.

One of the main problems is that the UI code of Eclipse is horrible designed - it is practically impossible to extend it with all the features an IDE needs to provide. I know, this is no excuse that it is still not working, but that is the current situation. I tried it several times to get the UI integration to work, but always failed so far due to the complexity. And I don't want to see an implementation to be merged that shows you a black window box with ugly unformatted text.

Sometimes I wonder if we would be a lot more ahead we would be if Scala-IDE was a standalone project. But I guess people need it to integrate with the rest of eclipse.

 

iulian dragos

unread,
May 30, 2014, 5:04:16 AM5/30/14
to scala-i...@googlegroups.com
On Fri, May 30, 2014 at 1:48 AM, Robert Kuhar <rober...@gmail.com> wrote:
I stepped away from Scala-IDE for a year and came back just this week.  But still no ScalaDoc hover-over in the Scala-IDE?  Really?  I'm running the Scala-IDE in Eclipse Kepler.  I see this as a feature of Scala-IDE 3.0 (http://scala-ide.org/docs/current-user-doc/features/typingviewing/javadoc.html) but I don't seem to get the function on my machine.  Where did I go wrong?

Actually, the Javadoc View works for Java elements. But Simon is right, we have put significant work into this feature but never merged it into master because it wasn't working reliably. Most of the difficulties come from the Scala compiler, and the fact that scaladoc is so much more powerful than Java doc (macro expansion, variables, etc).

Given the size of the team, we can only take small steps. Java IDEs took many years and hundreds of developers working on them to get where they are today. We are just a few, so we can use all the help we can get.

Eclipse isn't that bad as a platform, but it is a framework: it is opinionated, and fighting against the framework won't get you far. What is completely missing though is a good story for multi-language support. Java support is, unfortunatly, monolythic, and we have constant pain trying to make mixed projects work.

cheers,
iulian
 
For more options, visit https://groups.google.com/d/optout.



--
« Je déteste la montagne, ça cache le paysage »
Alphonse Allais

Naftoli Gugenheim

unread,
May 30, 2014, 7:52:02 AM5/30/14
to scala-i...@googlegroups.com
It seems there are two different problem: Scala methods not showing in the Javadoc view; and scala editors not showing any javadoc (even for Java APIs) on hover.



Simon Schäfer

unread,
May 30, 2014, 8:31:40 AM5/30/14
to scala-i...@googlegroups.com

On 05/30/2014 01:52 PM, Naftoli Gugenheim wrote:
It seems there are two different problem: Scala methods not showing in the Javadoc view; and scala editors not showing any javadoc (even for Java APIs) on hover.
At least Javadoc can be shown by pressing F1 (at least in my configuration). The feature is called "show tooltip description" in the keys preference page, if you want to remap it. Beside from that Scala hovers require more love to bring them on par with there Java counterparts.

Trym Møller

unread,
May 22, 2015, 4:20:06 AM5/22/15
to scala-i...@googlegroups.com
Hi

In Eclipse in a Maven Java project (having the M and the J letter marking in the Package Explorer), when I hover over a reference to a scala class, trait or function the generated javadoc is automatically displayed in a tooltip and if the cursor is on the reference and I press F2 (in my keymapping) then the tooltip is open without using the mouse.
When I do the same in a Maven Scala (mixed java/scala) project then nothing happens on mouse over and using the cursor and pressing F2 opens a tooltip with a text saying "Occurences of 'xxx'" where xxx is my class trait or function name.

What may cause behavior and can I do anything about it to make it work?

Thanks in advance.

Best regards Trym

Simon Schäfer

unread,
May 22, 2015, 5:05:31 AM5/22/15
to scala-i...@googlegroups.com


On 05/22/2015 10:20 AM, Trym Møller wrote:
Hi

In Eclipse in a Maven Java project (having the M and the J letter marking in the Package Explorer), when I hover over a reference to a scala class, trait or function the generated javadoc is automatically displayed in a tooltip and if the cursor is on the reference and I press F2 (in my keymapping) then the tooltip is open without using the mouse.
When I do the same in a Maven Scala (mixed java/scala) project then nothing happens on mouse over and using the cursor and pressing F2 opens a tooltip with a text saying "Occurences of 'xxx'" where xxx is my class trait or function name.

What may cause behavior and can I do anything about it to make it work?
Do you use the scala-maven-plugin? If not, please add it and try again.

Trym Møller

unread,
May 22, 2015, 6:14:08 AM5/22/15
to scala-i...@googlegroups.com
Hi

Thanks for your very quick answer.
I was using
                <groupId>org.scala-tools</groupId>
                <artifactId>maven-scala-plugin</artifactId>
but I tried to change this to (and deleted the maven scala project from Eclipse and imported it again using "Existing maven project" wizard)
                <groupId>net.alchim31.maven</groupId>
                <artifactId>scala-maven-plugin</artifactId>
                <version>3.2.0</version>
This has the same behavior.
I am using Eclipse
    Version: Luna Service Release 2 (4.4.2)
    Build id: 20150219-0600

It can be noted that a "simple" scala trait (having a single .class file) shows the javadoc very nicely, but scala classes resulting in more e.g. two .class files has no documentation shown.
It is even worse if two scala classes are defined in the same .scala file and I refer to them, here I can hardly import them without errors in Eclipse, but the tooltip is missing as well.

Best regards Trym
You received this message because you are subscribed to a topic in the Google Groups "Scala IDE User" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/scala-ide-user/ap_e43woDAQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to scala-ide-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scala-ide-user/555EF157.7020008%40antoras.de.

Simon Schäfer

unread,
May 22, 2015, 6:35:39 AM5/22/15
to scala-i...@googlegroups.com


On 05/22/2015 12:13 PM, Trym Møller wrote:
Hi

Thanks for your very quick answer.
I was using
                <groupId>org.scala-tools</groupId>
                <artifactId>maven-scala-plugin</artifactId>
but I tried to change this to (and deleted the maven scala project from Eclipse and imported it again using "Existing maven project" wizard)
                <groupId>net.alchim31.maven</groupId>
                <artifactId>scala-maven-plugin</artifactId>
                <version>3.2.0</version>
This has the same behavior.
I am using Eclipse
    Version: Luna Service Release 2 (4.4.2)
    Build id: 20150219-0600

It can be noted that a "simple" scala trait (having a single .class file) shows the javadoc very nicely, but scala classes resulting in more e.g. two .class files has no documentation shown.
It is even worse if two scala classes are defined in the same .scala file and I refer to them, here I can hardly import them without errors in Eclipse, but the tooltip is missing as well.
Generally, problems that arise in the Java editor have low priority on our side because they are actually JDT bugs/limitations and difficult to fix for us. Nevertheless, could you please create a small example project that shows the problem and upload it to Github + open a ticket? This way we have a reproducible test case for someone who may find the time working on this.

iulian dragos

unread,
May 22, 2015, 3:03:04 PM5/22/15
to scala-i...@googlegroups.com
I agree with Simon that it's unlikely we'll be able to fix Javadoc hovers in the Java editor for Scala classes (but Scaladoc should be available in the Scala editor..)

iulian


For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages