Result (ExpressionContext context) { PsiDocumentManager.getInstance(context.getProject()).commitDocument(context.getEditor().getDocument()); SuggestedNameInfo info = getNameInfo(context); if (info == null) return new TextResult("p"); String[] names = info.names; if (names.length > 0) { return new TextResult(names[0]); } return null; }