I am stuck at the conversion between PsiElement and Ftl specific element.
Here is the code:
PsiElement element = provider.findElementAt(cursorPosition, language); //language is <FreeMarker> and cursor is inside a Macro
PsiElement rootElement = SomeUtils.getRootElement(element);
From debugger, I can tell the rootElement is a FtlMacro but I can't directly cast it to it. I can only cast it to its super class FtlXmlTag.
How can I get the FtlMacro (or other Ftl related element) from the PsiElement?