13

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?

jwvh
  • 50,871
  • 7
  • 38
  • 64
LoranceChen
  • 2,453
  • 2
  • 22
  • 48

3 Answers3

3

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.

Mario Galic
  • 47,285
  • 6
  • 56
  • 98
  • This seems to be broken for BSP projects. https://youtrack.jetbrains.com/issue/SCL-18816. – vlfig Mar 18 '21 at 10:47
1

It seems to me that the standard "Show usage" command ought to list where implicit values are used. It does not currently do so (IDEA v 2018.1), but I think that is just a bug (or omission).

I have raised https://youtrack.jetbrains.com/issue/IDEA-199104 to alert JetBrains to this bug; I suggest you vote for that and subscribe to changes there.

I can't see any workaround or any other way to do this in IDEA.

Rich
  • 15,048
  • 2
  • 66
  • 119
1

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