this is sort of what modern ides (e.g. jetbrains stuff) already do in the bg. when im working on stuff, i almost never navigate via text or the file explorer, i use things like "goto usages or definition" and navigate via what is essentially data tracing. this only works well with statically typed languages ime, though.
the indexing step is basically building this db in the background, it's just kept out of view / hidden unless you're building ide plugins or whatever.