ColoredItemPresentation (@NotNull final PsiMethod psiMethod) { return new ColoredItemPresentation() { @Override public String getPresentableText() { return PsiFormatUtil.formatMethod( psiMethod, PsiSubstitutor.EMPTY, PsiFormatUtilBase.SHOW_NAME | PsiFormatUtilBase.SHOW_PARAMETERS, PsiFormatUtilBase.SHOW_TYPE ); } @Override public TextAttributesKey getTextAttributesKey() { try { if (psiMethod.isDeprecated()) { return CodeInsightColors.DEPRECATED_ATTRIBUTES; } } catch (IndexNotReadyException ignore) { } return null; } @Override public String getLocationString() { return getJavaSymbolContainerText(psiMethod); } @Override public Icon getIcon(boolean open) { return psiMethod.getIcon(Iconable.ICON_FLAG_VISIBILITY); } }; }