I am writing to create a plugin which will order methods in a specific way.
I was able to get the methods array from the PsiClass.getMethods. I was hoping to find a method within the PsiClass to reset or replace the methods with the newly ordered methods. I am not able to find any.
PsiMethod methods = psiClass.getMethods();
//anything like this ? -> psiClass.setMethods(reOrderedMethods)
I have been looking for ways to do this for the past couple of days without any success. Whatever code I find in github related to re-arranging code, does some sort of text replace. I was hoping to do the re-ordered with some built in functionality around the PsiJavaFile or PsiClass. Please show me some pointers on how to achieve this.