Quantcast

Implicit and IDE Support

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Implicit and IDE Support

Peter Wolf
Starting a new thread.

Was just thinking...  Implicit would be a lot less scary for me if the IDE helped.

The scary thing about Implicits is that you don't know when they are doing something to your code.  For example, when my team replaced all the JavaConversions with JavaConverters, we discovered all sorts of unintended conversions sprinkled throughout our code.  Your code can behave very differently from the way it reads.

If the IDEA highlighted Implicit usage, perhaps in a different color or something, you would know it was there.  Hovering with the mouse could bring up a explanation of what Implicit was active, and what it was doing.

Implicit is a cool idea.  Perhaps it is just a problem with the development environment.

Peter 

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Implicit and IDE Support

Jasper-M
I think that's almost exactly what the Eclipse Scala IDE already does. I would think other IDEs have similar functionality.

Op dinsdag 28 maart 2017 20:05:01 UTC+2 schreef Peter Wolf:
Starting a new thread.

Was just thinking...  Implicit would be a lot less scary for me if the IDE helped.

The scary thing about Implicits is that you don't know when they are doing something to your code.  For example, when my team replaced all the JavaConversions with JavaConverters, we discovered all sorts of unintended conversions sprinkled throughout our code.  Your code can behave very differently from the way it reads.

If the IDEA highlighted Implicit usage, perhaps in a different color or something, you would know it was there.  Hovering with the mouse could bring up a explanation of what Implicit was active, and what it was doing.

Implicit is a cool idea.  Perhaps it is just a problem with the development environment.

Peter 

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Implicit and IDE Support

Clint Gilbert-2
In reply to this post by Peter Wolf
On 03/28/2017 02:05 PM, Peter Wolf wrote:
> If the IDEA highlighted Implicit usage, perhaps in a different color or
> something, you would know it was there.  Hovering with the mouse could
> bring up a explanation of what Implicit was active, and what it was doing.

The Eclipse plugin (ScalaIDE) does this currently.  It's very handy.



>
> Implicit is a cool idea.  Perhaps it is just a problem with the
> development environment.
>
> Peter
>
> --
> You received this message because you are subscribed to the Google
> Groups "scala-user" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [hidden email]
> <mailto:[hidden email]>.
> For more options, visit https://groups.google.com/d/optout.
--



--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Implicit and IDE Support

Oliver Ruebenacker
In reply to this post by Jasper-M
IntelliJ IDEA also highlights implicit conversions.

On Tue, Mar 28, 2017 at 2:19 PM, Jasper-M <[hidden email]> wrote:
I think that's almost exactly what the Eclipse Scala IDE already does. I would think other IDEs have similar functionality.

Op dinsdag 28 maart 2017 20:05:01 UTC+2 schreef Peter Wolf:
Starting a new thread.

Was just thinking...  Implicit would be a lot less scary for me if the IDE helped.

The scary thing about Implicits is that you don't know when they are doing something to your code.  For example, when my team replaced all the JavaConversions with JavaConverters, we discovered all sorts of unintended conversions sprinkled throughout our code.  Your code can behave very differently from the way it reads.

If the IDEA highlighted Implicit usage, perhaps in a different color or something, you would know it was there.  Hovering with the mouse could bring up a explanation of what Implicit was active, and what it was doing.

Implicit is a cool idea.  Perhaps it is just a problem with the development environment.

Peter 

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.



--
Oliver Ruebenacker
Senior Software Engineer, Diabetes Portal, Broad Institute

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Aw: [scala-user] Implicit and IDE Support

Dennis Haupt-2
In reply to this post by Peter Wolf
intellij and i think eclipse are both doing that
 
Gesendet: Dienstag, 28. März 2017 um 20:05 Uhr
Von: "Peter Wolf" <[hidden email]>
An: scala-user <[hidden email]>
Betreff: [scala-user] Implicit and IDE Support
Starting a new thread.
 
Was just thinking...  Implicit would be a lot less scary for me if the IDE helped.
 
The scary thing about Implicits is that you don't know when they are doing something to your code.  For example, when my team replaced all the JavaConversions with JavaConverters, we discovered all sorts of unintended conversions sprinkled throughout our code.  Your code can behave very differently from the way it reads.
 
If the IDEA highlighted Implicit usage, perhaps in a different color or something, you would know it was there.  Hovering with the mouse could bring up a explanation of what Implicit was active, and what it was doing.
 
Implicit is a cool idea.  Perhaps it is just a problem with the development environment.
 
Peter 

 

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Implicit and IDE Support

Peter Wolf
In reply to this post by Peter Wolf
Most Excellent :-D

I use IntelliJ.  How do I enable it?

Thanks
P

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Implicit and IDE Support

Peter Wolf
In reply to this post by Peter Wolf
Nevermind, I think I found it

Preferences > Languages & Frameworks > Scala > Performance > Implicit parameters search depth

By default it is set to -1 (off)

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Implicit and IDE Support

Naftoli Gugenheim

Not sure it’s that. Anyway here are some things IntelliJ gives you:

pasted2

The above underline means an implicit conversion is being used.

I clicked on query and pressed ctrl-shift-Q (for Qonversion?), and here's what I get:

pasted5

It shows all potentially applicable implicit conversions, and bolds and focuses the one that is being used.

Here’s how it works for implicit parameters:

pasted6

I clicked on column and pressed ctrl-shift-P. IntelliJ highlighted the expression that the implicit parameter is being passed to, and is showing me that column’s implicit parameter is filled out to be juDateColumnType, which itself is taking an implicit parameter for which timestampColumnType has been selected.



On Tue, Mar 28, 2017 at 3:38 PM Peter Wolf opus111@... wrote:

Nevermind, I think I found it

Preferences > Languages & Frameworks > Scala > Performance > Implicit parameters search depth

By default it is set to -1 (off)

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

pasted3 (222K) Download Attachment
pasted4 (36K) Download Attachment
Loading...