String () { String presentableUrl = myTarget.getFile().getPresentableUrl(); if (myTarget.getFile().isDirectory()) { return presentableUrl; } final PsiFile psiFile = PsiManager.getInstance(myTarget.getProject()).findFile(myTarget.getFile()); if (psiFile == null) return presentableUrl; StructureViewBuilder builder = LanguageStructureViewBuilder.INSTANCE.getStructureViewBuilder(psiFile); if (builder instanceof TreeBasedStructureViewBuilder) { StructureViewModel model = ((TreeBasedStructureViewBuilder)builder).createStructureViewModel(null); Object element; try { element = model.getCurrentEditorElement(); } finally { Disposer.dispose(model); } if (element instanceof NavigationItem) { ItemPresentation presentation = ((NavigationItem)element).getPresentation(); if (presentation != null) { presentableUrl = ((NavigationItem)element).getName() + " " + presentation.getLocationString(); } } } return BookmarkBundle.message("bookmark.file.X.line.Y", presentableUrl, getLine() + 1); }