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?

2
  • 1
    I think that "Show usage" list the implicit usage too, isn't it ?
    – JR Utily
    Commented Sep 15, 2018 at 22:04
  • "Show usage" does not list implicit usages, at least in my quick tests
    – Rich
    Commented Sep 19, 2018 at 9:39

3 Answers 3

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.

1
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.

1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.