@Nullable public static InflateContainer matchInflate(@Nullable PsiElement psiElement) { if(!(psiElement instanceof PsiIdentifierImpl)) { return null; } // View "rootView" = inflater.inflate(R.layout.fragment_main, container, false); PsiElement psiLocalVariable = psiElement.getParent(); if(psiLocalVariable instanceof PsiLocalVariable) { return matchInflate((PsiLocalVariable) psiLocalVariable); } return null; }