Community
Participate
Working Groups
Mylar 0.9.0: The bugzilla web interface recognizes patterns like bug#158069 comment#22, and turns it out into a link not only to the bug, but directly to the comment too. The bug editor only recognizes bug#number, not the comment part.
There is much more editor don't recognize. See bug 146964 for details. So, this one is a duplicate, unless we want to deal with each issue separately...
My thinking is that this particular feature may be a little more involved than the other parsing issues identified on bug#146964 so lets keep this one alive.
This would be a useful addition. Frank, would you be interested in looking into this? Somewhat related is bug 166807 .
Should we finish bug#167941 first? Then we can add an commentNr attribute of the class TaskHyperlink. Is it possible to do an open of an editor with positioning on the requested comment or should we need to implement this?
Created attachment 98332 [details] mylyn/context/zip
I would like to hold off on bug#167941 until we have a better understanding of how the implement should work. In order for the task editor to scroll to the right comment we would need a method on TaskEditor that allows it to jump to a certain comment. Here is how it could work: - open task editor - get reference to editor - map anchor to corresponding ITaskComment object - invoke TaskEditor.reveal(ITaskComment) to make comment visible This will require a few API changes and it would makes sense to port the Bugzilla connector to the new editor architecture first. As a start we could modify the hyperlink detector to recognize the comment number and implement the actual revealing of the comment in the UI later?
Created attachment 98523 [details] patch (In reply to comment #6) > As a start we could modify the hyperlink detector to recognize the comment > number and implement the actual revealing of the comment in the UI later? Here the first part. Lets do the UI later.
Created attachment 98524 [details] mylyn/context/zip
No big rush here but for the text "bug#123" I get the following: java.lang.IndexOutOfBoundsException: No group 6 at java.util.regex.Matcher.group(Matcher.java:463) at org.eclipse.mylyn.internal.bugzilla.ui.tasklist.BugzillaConnectorUi.extractHyperlink(BugzillaConnectorUi.java:155) at org.eclipse.mylyn.internal.bugzilla.ui.tasklist.BugzillaConnectorUi.findHyperlinks(BugzillaConnectorUi.java:123) at org.eclipse.mylyn.internal.tasks.ui.editors.TaskHyperlinkDetector.detectHyperlinks(TaskHyperlinkDetector.java:79) at org.eclipse.ui.texteditor.HyperlinkDetectorRegistry$HyperlinkDetectorDelegate.detectHyperlinks(HyperlinkDetectorRegistry.java:80) at org.eclipse.jface.text.hyperlink.HyperlinkManager.findHyperlinks(HyperlinkManager.java:265) at org.eclipse.jface.text.hyperlink.HyperlinkManager.mouseMove(HyperlinkManager.java:466)
(In reply to comment #9) > No big rush here but for the text "bug#123" I get the following: > > java.lang.IndexOutOfBoundsException: No group 6 > at java.util.regex.Matcher.group(Matcher.java:463) > at > org.eclipse.mylyn.internal.bugzilla.ui.tasklist.BugzillaConnectorUi.extractHyperlink(BugzillaConnectorUi.java:155) > at > org.eclipse.mylyn.internal.bugzilla.ui.tasklist.BugzillaConnectorUi.findHyperlinks(BugzillaConnectorUi.java:123) > at > org.eclipse.mylyn.internal.tasks.ui.editors.TaskHyperlinkDetector.detectHyperlinks(TaskHyperlinkDetector.java:79) > at > org.eclipse.ui.texteditor.HyperlinkDetectorRegistry$HyperlinkDetectorDelegate.detectHyperlinks(HyperlinkDetectorRegistry.java:80) > at > org.eclipse.jface.text.hyperlink.HyperlinkManager.findHyperlinks(HyperlinkManager.java:265) > at > org.eclipse.jface.text.hyperlink.HyperlinkManager.mouseMove(HyperlinkManager.java:466) Sorry I can not reproduce this. What is the exact complete text of the comment? are there space or newline before or after the String?
bug#123 <---- just like so last time I tested
Created attachment 105284 [details] updated patch I add a try cach block to avoid this problem. Maybe the implementation of class PATTERn
Created attachment 105285 [details] mylyn/context/zip
Created attachment 130024 [details] patch for 3.2
Created attachment 130025 [details] mylyn/context/zip
*** Bug 281369 has been marked as a duplicate of this bug. ***
Status: Frank's attached patch looks good, just awaiting resolution of bug#178474.
Frank, you should now be able to go ahead with your patch. To make this work invoke TaskHyperlink.setSelection(attributeId) where attributeId is a String with the id of the comment attribute that should be revealed, e.g. TaskAttribute.PREFIX_COMMENT + "20" for comment 20 in Bugzilla.
Created attachment 160844 [details] commited patch I also add support for the new (Bugzilla 3.6) form of comments for attachments
Created attachment 160845 [details] mylyn/context/zip
Looks good to me. Any reason to keep the commented out code in BugzillaConnectorUi around?
(In reply to comment #21) > Looks good to me. Any reason to keep the commented out code in > BugzillaConnectorUi around? Cleanup and more junit tests are non in HEAD.
Great! Thanks Frank.
Bugzilla also recognizes the pattern comment #24 making a link to the comment in current task. Mylyn that I updated today does not seem to understand that. Perhaps a shortcut like bug 164221#24 would be nice to have too.
Andrew, could you file a new bug for that?
(In reply to comment #25) > Andrew, could you file a new bug for that? Sure, bug 304910. Hmm, that request matches the subject of this bug exactly.