I get the method (a `JSPropertyImpl` in my case - I'm using CoffeeScript), from a `FileEditorManager.selectionChanged` event like so:
val offset = editor.getCaretModel.getOffset()
val el = psiFile.getViewProvider.findElementAt(offset)
val method = PsiTreeUtil.getParentOfType(el, classOf[JSPropertyImpl])
My question is what is the best way to locate this `JSPropertyImpl` again?
My first idea is to send `psiFile.getVirtualFile.getCanonicalPath` and `method.getTextOffset` to the web client along with `method.getText`.
I could then look for open editors matching the canonical path and then use `psiFile.findElementAt(<text offset from client>)`.
I would prefer to be able to uniquely identify the JSPropertyImpl than relying on text offset of the element in a file. Is this possible?