Result (Expression @NotNull [] params, ExpressionContext context) { Project project = context.getProject(); PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(context.getEditor().getDocument()); if (!(file instanceof PsiJavaFile)) return new TextResult (""); return new TextResult (((PsiJavaFile)file).getPackageName()); }