void () { final GrExpression expression = myContext.getExpression(); final GrVariable var = myContext.getVar(); final StringPartInfo stringPart = myContext.getStringPart(); List<String> list = new ArrayList<>(); if (var != null) { list.add(var.getName()); } list.addAll(suggestNames()); myNameField = new NameSuggestionsField(ArrayUtilRt.toStringArray(list), myContext.getProject(), GroovyFileType.GROOVY_FILE_TYPE); if (expression != null) { myTypeComboBox = GrTypeComboBox.createTypeComboBoxFromExpression(expression); } else if (stringPart != null) { myTypeComboBox = GrTypeComboBox.createTypeComboBoxFromExpression(stringPart.getLiteral()); } else { myTypeComboBox = GrTypeComboBox.createTypeComboBoxWithDefType(var.getDeclaredType(), var); } GrTypeComboBox.registerUpDownHint(myNameField, myTypeComboBox); }