Sorry for dummy question, but I'm very confused.
I implemented PsiTreeChangeListener and I'm trying to detect all modifications of files with some extension, like *.java under project source folders.
I want to add path to these files to the some file, and reflect all changes in project structure, concerned with these files.
For the most part of operations with files, like addition or moving, it works perfect.
But for rename operation, I can't obtain previous file name.
I have some test code like this, where event is PsiTreeChangeEvent;
System.out.println(String.valueOf(event.getOldChild()) + " | " + String.valueOf(event.getChild()) + " | " + String.valueOf(event.getNewChild()));
System.out.println(String.valueOf(event.getOldParent()) + " | " + String.valueOf(event.getParent()) + " | " + String.valueOf(event.getNewParent()));
And for rename operation when I'm actually renamed s123.aaa to s1234.aaa. it's output is:
XmlFile:s1234.aaa | null | XmlFile:s1234.aaa
null | PsiDirectory:/..../IdeaProjects/untitled/src/test1 | null
By the way, maybe I can bind file to xml-tag directly?
for each of *.aaa files I'm trying to have xml tag like
<aaa_file path="actual_file_path" />
I'm looked at PsiReference, but didn't understand is it real, to use them. And how.