I am working with about 100 different files that are coded in python, JavaScript, and HTML. Many of these files are coupled in complicated ways. One of the problems I am having pretty consistently is trying to trace a variable or object back to where it is defined. My question is whether there is a smarter way to grep for a common word. For example, here are a few key-value pairs being returned at the end of a python function.
return {
"form": context["form"],
"groups": context["groups"],
"facilities": context["facilities"],
"student": user,
"topics": topics
}
If I grep for topics in the directories where these files are located:
$ grep 'topics' * -R
I end up with way too many files to sort through. I can't narrow down my search to just .py files, because some JS and HTML files are coupled too. Any advice would be much appreciated!