@NotNull @Override public String getMissingElementNameSpace(@NotNull String prefix, boolean addLinkRef) { MultiMarkdownProjectComponent projectComponent = MultiMarkdownPlugin.getProjectComponent(getProject()); PsiFile psiFile = getContainingFile(); VirtualFile virtualFile = psiFile.getOriginalFile() != null ? psiFile.getOriginalFile().getVirtualFile() : psiFile.getVirtualFile(); PathInfo filePathInfo = new PathInfo(virtualFile); GitHubVcsRoot gitHubVcsRoot = projectComponent != null ? projectComponent.getGitHubRepo(filePathInfo.getPath()) : null; String vcsHome = gitHubVcsRoot != null ? gitHubVcsRoot.getBasePath() + "::" : ""; if (addLinkRef) { String pageRef = MultiMarkdownPsiImplUtil.getLinkRefTextWithAnchor(this); if (pageRef.isEmpty()) pageRef = WikiLinkRef.fileAsLink(filePathInfo.getFileName()); return prefix + (vcsHome.isEmpty() ? vcsHome : vcsHome + "::") + (pageRef.isEmpty() ? pageRef : pageRef + "::"); } return prefix + (vcsHome.isEmpty() ? vcsHome : vcsHome + "::"); }
@Override public String getLinkTitle() { return MultiMarkdownPsiImplUtil.getLinkTitle(this); }
@Override public String getLinkAnchor() { return MultiMarkdownPsiImplUtil.getLinkAnchor(this); }
@Override public String getLinkRef() { return MultiMarkdownPsiImplUtil.getLinkRefText(this); }