7

I'm searching a way to find implicit conversion. Something which give me the packages where a conversion from one to the other type is.

As an example:

found   : java.lang.String("")
required: net.liftweb.http.js.JsExp

After some searching in the Scaladoc i found the package with the implicit conversion. Isn't there some automated way to do this search?

Edit: I'm not so good at formulating. My problem is to find out which package i have to import. The IDE already displays when an implicit conversion is used. But sometimes i believe that somewhere a implicit conversion should exist but have no clue in which package.

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
Fabian
  • 1,224
  • 1
  • 11
  • 26
  • 3
    Sounds like a great tool for an IDE! – jsuereth Mar 07 '11 at 15:36
  • 1
    Or a search tool on the internet where you can enter the two types and which returns the possible packages. – Fabian Mar 07 '11 at 16:03
  • Just as a supplemental: the alternative scala plugin [Google Summer of Code 2010 @ Scala IDE](http://www.scala-ide.org/2010/08/google-summer-of-code-2010/) for eclipse shows implicit conversions but only the (implicit) method name and not the package. – Peter Schmitz Mar 07 '11 at 20:50
  • http://devnet.jetbrains.net/thread/289036 – Gene T Apr 10 '11 at 10:39
  • http://stackoverflow.com/questions/8685479/find-all-implicits – lcn Sep 18 '14 at 17:59

1 Answers1

2

The NetBeans plugin for Scala projects will allow you Ctrl-hover over a value to see any implicit conversions that have been applied. You can also use some of the compiler debugging options when attempting to compile your code; I think here -Xlog-implicits might be what you're looking for. More useful compiler flags can be found here: http://www.paulbutcher.com/2010/04/scala-compiler-advanced-options/

Kris Nuttycombe
  • 4,560
  • 1
  • 26
  • 29