I am developing a plugin in Intellij idea. I am stuck at inserting a piece of code after a statement.
I need to find the element launchPurchaseflow and add a piece of code after that statement.I used Psielement and string matcher to get to the corresponding string.
Now my PsiElement = mhelper.launchPurchaseFlow. If I use psiClass.addAfter(newElement, PsiElement.getContext());
It is only trying to add after the closing paranthesis.So its pop out my new element as Incorrect Statement.
Its adding at position mHelper.launchPurchaseflow(str,str,str)//newElement; But I need to add at mHelper.launchPurchaseflow(str,str,str); // new Element.
I am an Amateur developer.Any help will be useful to me. Thanks in advance