Open source for declaration for implied types

24 views
Skip to first unread message

Jim Kleckner

unread,
Aug 13, 2014, 7:59:51 PM8/13/14
to scala-i...@googlegroups.com
Scala, with really good type inference, means you can skip a lot of explicit type declarations.

The downside is that there is frequently no text in the source code for that type that you can select and use F3 to "Open Declaration" on that type in order to see the source *for the type*.

Does anyone have a tip about how to navigate easily to the source of the type of an expression whose type is inferred?

You can use F2 to see the type in a yellow dialog and to use the mouse to copy/paste it.  What you sort of really want though is to be able to highlight that type and use F3 on that...

I don't have much expectation of a trick, but thought I would ask.

Thanks.

Simon Schäfer

unread,
Aug 14, 2014, 6:12:21 AM8/14/14
to scala-i...@googlegroups.com

On 08/14/2014 01:59 AM, Jim Kleckner wrote:
Scala, with really good type inference, means you can skip a lot of explicit type declarations.

The downside is that there is frequently no text in the source code for that type that you can select and use F3 to "Open Declaration" on that type in order to see the source *for the type*.

Does anyone have a tip about how to navigate easily to the source of the type of an expression whose type is inferred?

You can use F2 to see the type in a yellow dialog and to use the mouse to copy/paste it.  What you sort of really want though is to be able to highlight that type and use F3 on that...
Yes, that would be very nice. The next upcoming Scala IDE version will have better hover support, but there is no hyperlinking of types implemented yet. Could you please open a ticket about that, maybe someone finds the time to implement it until the final release.


I don't have much expectation of a trick, but thought I would ask.
I get the name with the hover and then use the "open type" dialog to open it, but that is basically the same what you are doing.

Thanks.
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/scala-ide-user/bc89f35c-91b2-4ae3-84b1-d242ddc6ccfd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jim Kleckner

unread,
Aug 16, 2014, 5:51:46 PM8/16/14
to scala-i...@googlegroups.com


On Thursday, August 14, 2014 3:12:21 AM UTC-7, Simon Schäfer wrote:

On 08/14/2014 01:59 AM, Jim Kleckner wrote:
...
You can use F2 to see the type in a yellow dialog and to use the mouse to copy/paste it.  What you sort of really want though is to be able to highlight that type and use F3 on that...
Yes, that would be very nice. The next upcoming Scala IDE version will have better hover support, but there is no hyperlinking of types implemented yet. Could you please open a ticket about that, maybe someone finds the time to implement it until the final release.


iulian dragos

unread,
Aug 22, 2014, 5:21:10 AM8/22/14
to scala-i...@googlegroups.com
On Thu, Aug 14, 2014 at 1:59 AM, Jim Kleckner <j...@cloudphysics.com> wrote:
Scala, with really good type inference, means you can skip a lot of explicit type declarations.

The downside is that there is frequently no text in the source code for that type that you can select and use F3 to "Open Declaration" on that type in order to see the source *for the type*.

Does anyone have a tip about how to navigate easily to the source of the type of an expression whose type is inferred?

In the same spirit, you can open an "implicit", if one is available under the cursor. Ctrl-Click will show a small menu (open declaration, open implicit, sometimes open "apply"). It would be quite easy to add "open inferred type" if you are at a val/def declaration. Another feature ;-)

In the latest milestone for v4 you can use a quick-fix to automatically add the inferred type, and the hyperlink as usual. Intrusive, but it's another workaround.

cheers,
iulian
 

You can use F2 to see the type in a yellow dialog and to use the mouse to copy/paste it.  What you sort of really want though is to be able to highlight that type and use F3 on that...

I don't have much expectation of a trick, but thought I would ask.

Thanks.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/scala-ide-user/bc89f35c-91b2-4ae3-84b1-d242ddc6ccfd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



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

Naftoli Gugenheim

unread,
Aug 22, 2014, 5:58:47 AM8/22/14
to scala-i...@googlegroups.com
On Fri, Aug 22, 2014 at 5:20 AM, iulian dragos <jagu...@gmail.com> wrote:



On Thu, Aug 14, 2014 at 1:59 AM, Jim Kleckner <j...@cloudphysics.com> wrote:
Scala, with really good type inference, means you can skip a lot of explicit type declarations.

The downside is that there is frequently no text in the source code for that type that you can select and use F3 to "Open Declaration" on that type in order to see the source *for the type*.

Does anyone have a tip about how to navigate easily to the source of the type of an expression whose type is inferred?

In the same spirit, you can open an "implicit", if one is available under the cursor. Ctrl-Click will show a small menu (open declaration, open implicit, sometimes open "apply"). It would be quite easy to add "open inferred type" if you are at a val/def declaration. Another feature ;-)

May as well just be "open type" -- does it matter if it's explicit or inferred?

 

In the latest milestone for v4 you can use a quick-fix to automatically add the inferred type, and the hyperlink as usual. Intrusive, but it's another workaround.

cheers,
iulian
 

You can use F2 to see the type in a yellow dialog and to use the mouse to copy/paste it.  What you sort of really want though is to be able to highlight that type and use F3 on that...

I don't have much expectation of a trick, but thought I would ask.

Thanks.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/scala-ide-user/bc89f35c-91b2-4ae3-84b1-d242ddc6ccfd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



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

--
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.
Reply all
Reply to author
Forward
0 new messages