Cool. My long-term vision for software development would be to make a new programming environment that structures code in ASTs and stores it in a database rather than file based. However, that will have to come later. First this :)
You should check Unison language. Each Unison definition is identified by a hash of its syntax tree. So if two unrelated functions have identical AST this means they that from language perspective it's the same function.
Sometimes I daydream that we moved beyond text files and had a format with a UUID per line.
Version control could reliably track movement between files, we could identify copy and paste (and prompt when refactoring), and code coverage changes would be accurate.