use of com.intellij.codeInsight.highlighting.HighlightUsagesDescriptionLocation in project intellij-plugins by JetBrains.
the class DartElementDescriptionProvider method getElementDescription.
@Nullable
@Override
public String getElementDescription(@NotNull final PsiElement element, @NotNull final ElementDescriptionLocation location) {
if (!(location instanceof HighlightUsagesDescriptionLocation))
return null;
if (element instanceof DartLibraryNameElement)
return "library " + ((DartLibraryNameElement) element).getName();
if (element instanceof DartNamedElement) {
final String name = ((DartNamedElement) element).getName();
final DartComponentType type = DartComponentType.typeOf(element);
if (type != null) {
final String typeText = type.toString().toLowerCase(Locale.US);
return name != null ? typeText + " " + name : typeText;
}
}
return null;
}
Aggregations