How do you search for all usages of a class, even ...
# intellij
k
How do you search for all usages of a class, even if a class isn't explicitly mentioned? For example:
Copy code
data class Test(val x: Int)
fun foo() = Test(3)
fun bar() {
    val test = foo()
    println(test)
}
Find usages of the Test class only yields the constructor call in
foo
, nothing about
bar
, even though it does obviously use it. I looked trough the find unsages settings, and there you can select a couple more things, eg "usages of functions" and "usages of properties", but that still does't cover my
bar
example. Is there a way to really find all usages?
k
Hmm that works fine in this case, but I'm looking for callsites that interact with the type more then with where exactly it is constructed.
m
I suspect this will require a feature request. May be a case jb doesn't cover yet?
d
I suppose intellij should use a feature where it searches ir
a
Structural search, might help I would've thought the find usages would work though
k
Structural search isn't implemented yet for Kotlin, right?
I wonder if Java's find usages is better here, with the introduction of
var
.