PsiElement (final @NotNull PsiElement element) { if (element instanceof PsiFile && InjectedLanguageManager.getInstance(element.getProject()).isInjectedFragment((PsiFile)element)) { return element.getParent(); } return element.getContext(); }