Find all instances of a certain class

Viewed 76

Is there a way to pragmatically enumerate all instances of a class? In Pursuit I can see that Extend has 2 instances, but what if I have other instances declared in my code base? Can it be done at least in pulp repl?

1 Answers

As far as I'm aware no. But here's a cheap little hack using jq that might tell you what you need to know:

jq '..|.TypeInstanceRef? | select(. != null) | map(..|.Ident?) | add' output/*/externs.json

Run from the the root of your project this should print out all known instance names. And seeing as we conventionally name instances classType (e.g. showBoolean) you should be able to grep for the class(es) you're interested in.

Related