I just started plugin development, so I've got a rather basic question for most of you I guess :
Is there an easy way of obtaining the PsiMethod-object for the currently selected method in an editor?
I know that I can use the PsiDocumentManager.getInstance(...).getPsiFile(...) in order to obtain the PsiFile for the current editor and then traverse the whole Psi-tree but I wonder if there isn't an easier solution?
A second question: At the moment I am using EditorFactory.getInstance().getEventMulticaster().addCaretListener(...) for listening to caret changes in an editor. Since I am not a singleton-fan , are there alternatives for that approach?
Thanks a lot in advance!