use of com.intellij.openapi.vcs.IssueNavigationLink in project intellij-community by JetBrains.
the class JavadocHighlightingTest method testIssueLinksInJavaDoc.
public void testIssueLinksInJavaDoc() {
IssueNavigationConfiguration navigationConfiguration = IssueNavigationConfiguration.getInstance(getProject());
List<IssueNavigationLink> oldLinks = navigationConfiguration.getLinks();
try {
navigationConfiguration.setLinks(ContainerUtil.newArrayList(new IssueNavigationLink("ABC-\\d+", "http://example.com/$0"), new IssueNavigationLink("INVALID-\\d+", "http://example.com/$0/$1")));
configureByFile(getTestName(false) + ".java");
List<String> expected = ContainerUtil.newArrayList("http://example.com/ABC-1123", "http://example.com/ABC-2", "http://example.com/ABC-22", "http://example.com/ABC-11");
List<WebReference> refs = PlatformTestUtil.collectWebReferences(myFile);
assertTrue(refs.stream().allMatch(PsiReferenceBase::isSoft));
assertEquals(expected, refs.stream().map(WebReference::getUrl).collect(Collectors.toList()));
} finally {
navigationConfiguration.setLinks(oldLinks);
}
}
use of com.intellij.openapi.vcs.IssueNavigationLink in project intellij-community by JetBrains.
the class IssueNavigationConfigurationPanel method reset.
public void reset() {
IssueNavigationConfiguration configuration = IssueNavigationConfiguration.getInstance(myProject);
myLinks = new ArrayList<>();
for (IssueNavigationLink link : configuration.getLinks()) {
myLinks.add(new IssueNavigationLink(link.getIssueRegexp(), link.getLinkRegexp()));
}
myModel = new ListTableModel<>(new ColumnInfo[] { ISSUE_COLUMN, LINK_COLUMN }, myLinks, 0);
myLinkTable.setModel(myModel);
}
Aggregations