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

3

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?

Bouncy answered 27/10, 2017 at 9:53 Comment(2)
I think that "Show usage" list the implicit usage too, isn't it ?Roccoroch
"Show usage" does not list implicit usages, at least in my quick testsGleeson
A
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.

Amygdaloid answered 28/3, 2019 at 21:41 Comment(1)
This seems to be broken for BSP projects. youtrack.jetbrains.com/issue/SCL-18816.Megagamete
G
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.

Gleeson answered 19/9, 2018 at 9:54 Comment(0)
W
1

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

Watkin answered 27/10, 2018 at 16:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.