When I'm going over a codebase, I wanna see how a piece of data flows throughout that codebase. For example, when I have an object, I wanna know how the object's reference gets passed around to various functions/methods/etc. I don't just mean "Find references/usages" that LSPs and IDEs provide.
Here's an example in python:
data = {
'foo': 123
}
def do_1(param1):
print(param1['foo'])
do_2(param1)
def do_2(param2):
print(param2['foo'])
do_1(data)
Here I have the object data
. I want to know all the places where this object is referenced, so that I can tell which places will be relevant when I have do something to this object (for example, change its structure). When I do "find references" using the python LSP (pyright), it finds only the last line of the code. However, I would like to also find the usages of param1 and param2 because they're also referencing the same object.
I wrote the same code in Java and tried this using intellij's "Find usages" feature, but I got the same results as with python's LSP.
Currently my workflow is:
- Find all references of variable
- For each reference where variable is used as function argument, go to function definition
- Repeat 1.
I would like the editor/IDE to do this grunt work for me.