void (@NotNull CompletionInitializationContext context) { if (context.getCompletionType() != CompletionType.SMART) return; PsiElement lastElement = context.getFile().findElementAt(context.getStartOffset() - 1); if (lastElement != null && lastElement.getText().equals("(")) { final PsiElement parent = lastElement.getParent(); if (parent instanceof GrTypeCastExpression) { context.setDummyIdentifier(""); } else if (parent instanceof GrParenthesizedExpression) { context.setDummyIdentifier("xxx)yyy "); // to handle type cast } } }