PsiFile (@NotNull Project project, @NotNull XExpression expression, @Nullable PsiElement context, boolean isPhysical) { TextWithImports text = TextWithImportsImpl.fromXExpression(expression); if (text != null) { CodeFragmentFactory factory = DebuggerUtilsEx.findAppropriateCodeFragmentFactory(text, context); JavaCodeFragment codeFragment = factory.createPresentationCodeFragment(text, context, project); if (context != null) { PsiType contextType = context.getUserData(DebuggerUtilsImpl.PSI_TYPE_KEY); if (contextType == null) { PsiClass contextClass = PsiTreeUtil.getNonStrictParentOfType(context, PsiClass.class); if (contextClass != null) { contextType = JavaPsiFacade.getElementFactory(codeFragment.getProject()).createType(contextClass); } } codeFragment.setThisType(contextType); } return codeFragment; } else { return super.createExpressionCodeFragment(project, expression, context, isPhysical); } }