@NotNull
private static String getPresentableElementPosition(final @Nullable PsiElement element) {
if (element == null) return "";
final StringBuilder buf = new StringBuilder(element.getText());
DartComponent component = PsiTreeUtil.getParentOfType(element, DartComponent.class);
while (component != null) {
final DartComponentName componentName = component.getComponentName();
if (componentName != null && componentName != element) {
buf.insert(0, component.getName() + " -> ");
}
component = PsiTreeUtil.getParentOfType(component, DartComponent.class);
}
String path = element instanceof PsiDirectoryImpl ? ((PsiDirectoryImpl)element).getVirtualFile().getPath()
: element.getContainingFile().getVirtualFile().getPath();