@Override
    @NotNull
    public @NlsSafe String getNodeText(@NotNull PsiElement element, boolean useFullName) {
        if (useFullName) {
            if (element instanceof NavigationItem navigationItem) {
              final ItemPresentation presentation = navigationItem.getPresentation();
                if (presentation != null && presentation.getPresentableText() != null) {
                    return presentation.getPresentableText();
                }
                final String name = navigationItem.getName();
                if (name != null) {
                    return name;
                }
            }
        }
        if (element instanceof PsiNamedElement) {
            final String name = ((PsiNamedElement)element).getName();
            if (name != null) return name;
        }
        return element.toString();
    }
@Override
    @NotNull
    public @NlsSafe String getNodeText(@NotNull PsiElement element, boolean useFullName)