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