mapstruct-idea
mapstruct-idea copied to clipboard
Find usages and renaming for constructor fields
I've been trying to make this work. However, there are some problems with the custom ConstructorParametersReferencesSearcher that I've implemented. Find usages works properly. However, that causes some other problems:
- When I rename the constructor parameter in the constructor method then my element in the annotation is not renamed. This is tested by
MapstructMethodUsagesSearcherTest.testRenameConstructorTargetReferenceMethod - When I rename the element in the annotation and the class is in the same file as my annotation there is an error happening. This is tested in
RenameHandlerTest.testRenameConstructorTargetParameter. When I run the plugin in an IDE and the class is not in the same file as my annotation then the renaming is correct.
Just a small idea: could it be related with referenceSearch? For now, this plugin only offers methodReferenceSearch and I think PsiParameter would not be tracked during the rename process.
You are right @KENNYSOFT. It might be related to that. Perhaps we should indeed provide a custom referenceSearch. That might solve all problems.