PsiElement (@NotNull Editor editor, @NotNull PsiFile file) { int offset = TargetElementUtil.adjustOffset(file, editor.getDocument(), editor.getCaretModel().getOffset()); if (offset == 0) { return null; } PsiElement atCaret = file.findElementAt(offset); SliceLanguageSupportProvider provider = LanguageSlicing.getProvider(file); if (provider == null || atCaret == null) { return null; } PsiElement expression = provider.getExpressionAtCaret(atCaret, myDataFlowToThis); if (expression != null && !expression.isPhysical()) { return null; } return expression; }