Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to find a implicit val or def used at in idea IDE?

Ctrl + Q to find implicit conversion

Shift + Cmd + P to find the place of an implicit parameter instance

How do I find where an implicit value/def is used?

like image 454
LoranceChen Avatar asked Oct 27 '17 09:10

LoranceChen


People also ask

What is an implicit parameter?

What Are Implicit Parameters? Implicit parameters are similar to regular method parameters, except they could be passed to a method silently without going through the regular parameters list. A method can define a list of implicit parameters, that is placed after the list of regular parameters.

What is implicit in Scala?

Implicit parameters are the parameters that are passed to a function with implicit keyword in Scala, which means the values will be taken from the context in which they are called.

How do I get Scala class in IntelliJ?

On the Project pane on the left, right-click src and select New => Scala class. If you don't see Scala class, right-click on HelloWorld and click on Add Framework Support…, select Scala and proceed. If you see Error: library is not specified, you can either click download button, or select the library path manually.


2 Answers

There is at least a how key like Ctrl + Shift + Q to find implicits in scope

like image 120
Mikhail Nemenko Avatar answered Oct 12 '22 11:10

Mikhail Nemenko


IntelliJ 2019.1 Scala Plugin now supports finding usages of implicits, in particular, going from the definition to the usage via Edit | Find | Find Usages:

...previously the implicits hints allowed you to see usages of implicits and go from usages to definitions, but you couldn’t do the reverse – go from definitions to usages, by invoking Find Usages. Well, now you can...

The feature worked on my machine using both the IntelliJ's internal build tool, as well as system sbt version 1.2.7 via Use sbt shell.

like image 40
Mario Galic Avatar answered Oct 12 '22 13:10

Mario Galic